bprocessor-commit Mailing List for B-processor (Page 22)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael L. <he...@us...> - 2008-11-03 14:26:24
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8031/src/net/sourceforge/bprocessor/model Modified Files: Command.java Space.java Project.java Plane.java Log Message: Refactor Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.237 retrieving revision 1.238 diff -C2 -d -r1.237 -r1.238 *** Space.java 3 Nov 2008 13:14:09 -0000 1.237 --- Space.java 3 Nov 2008 14:26:18 -0000 1.238 *************** *** 153,160 **** */ public static Container createUnion(String name) { ! Container s = createConstructionSpace(name); ! s.add(new CoordinateSystem(new Vertex(0, 0, 0))); ! s.setUnion(true); ! return s; } --- 153,159 ---- */ public static Container createUnion(String name) { ! Container union = createConstructionSpace(name); ! union.setUnion(true); ! return union; } *************** *** 745,749 **** * @param isUnion The isUnion to set. */ ! public void setUnion(boolean isUnion) { this.isUnion = isUnion; } --- 744,748 ---- * @param isUnion The isUnion to set. */ ! protected void setUnion(boolean isUnion) { this.isUnion = isUnion; } Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** Command.java 21 Apr 2008 12:23:08 -0000 1.75 --- Command.java 3 Nov 2008 14:26:18 -0000 1.76 *************** *** 933,937 **** Surface bottom = new Surface(edges); Container space = Project.getInstance().getActiveSpace(); ! Container union = new Container("Cylinder", Container.CONSTRUCTION, true); Set<Surface> sides = new HashSet<Surface>(); Surface top = bottom.extrusion(h, sides); --- 933,937 ---- Surface bottom = new Surface(edges); Container space = Project.getInstance().getActiveSpace(); ! Container union = Space.createUnion("Cylinder"); Set<Surface> sides = new HashSet<Surface>(); Surface top = bottom.extrusion(h, sides); *************** *** 1115,1119 **** Surface side3 = new Surface(list(e3, l3, l0)); ! Container union = new Container("Pyramid", Container.CONSTRUCTION, true); addSurfacesTo(union, list(s0, side0, side1, side2, side3)); --- 1115,1119 ---- Surface side3 = new Surface(list(e3, l3, l0)); ! Container union = Space.createUnion("Pyramid"); addSurfacesTo(union, list(s0, side0, side1, side2, side3)); *************** *** 1194,1198 **** } } ! Container union = new Container("Sphere", Container.CONSTRUCTION, true); for (Vertex current : vertices) { union.add(current); --- 1194,1198 ---- } } ! Container union = Space.createConstructionSpace("Sphere"); for (Vertex current : vertices) { union.add(current); *************** *** 1244,1248 **** Surface top = s0.extrusion(d, sides); ! Container union = new Container("Cube", Container.CONSTRUCTION, true); Collection<Surface> surfaces = new LinkedList(); surfaces.add(s0); --- 1244,1248 ---- Surface top = s0.extrusion(d, sides); ! Container union = Space.createUnion("Cube"); Collection<Surface> surfaces = new LinkedList(); surfaces.add(s0); *************** *** 1752,1756 **** Offset.offsetIt(boundary, -inside + (delta / 2)); ! Container union = new Container("Frame", Container.CONSTRUCTION, true); Collection<Surface> inserted = new LinkedList(); --- 1752,1756 ---- Offset.offsetIt(boundary, -inside + (delta / 2)); ! Container union = Space.createUnion("Frame"); Collection<Surface> inserted = new LinkedList(); *************** *** 1786,1791 **** { ! Container ext = new Container(exteriorName, Container.FUNCTIONAL, true); ! Container frame = new Container(frameName, Container.CONSTRUCTION, true); if (depth > 0) { exterior.assignBack(ext, true); --- 1786,1791 ---- { ! Container ext = Space.createFunctionalSpace(exteriorName); ! Container frame = Space.createConstructionSpace(frameName); if (depth > 0) { exterior.assignBack(ext, true); *************** *** 1808,1812 **** sign = depth; } ! Container hole = new Container(holeName + " " + i, Container.FUNCTIONAL, true); if (sign > 0) { current.assignFront(hole, true); --- 1808,1812 ---- sign = depth; } ! Container hole = Space.createFunctionalSpace(holeName + " " + i); if (sign > 0) { current.assignFront(hole, true); *************** *** 1918,1922 **** } } ! Container union = new Container("Layer", Container.CONSTRUCTION, true); for (Prism current : prisms) { Shape.addSurfacesTo(union, current.surfaces()); --- 1918,1922 ---- } } ! Container union = Space.createUnion("Layer"); for (Prism current : prisms) { Shape.addSurfacesTo(union, current.surfaces()); *************** *** 2140,2145 **** Collection<Vertex> vertices = Edge.vertices(edges); ! Container union = new Container("Frame", Space.CONSTRUCTION, true); ! union.setUnion(true); for (Vertex current : vertices) { union.add(current); --- 2140,2144 ---- Collection<Vertex> vertices = Edge.vertices(edges); ! Container union = Space.createUnion("Frame"); for (Vertex current : vertices) { union.add(current); *************** *** 2212,2228 **** if (net != null) { element.add(net); ! Container fema1 = new Container("Femacell", Container.CONSTRUCTION, true); { Classification classification = Project.getInstance().getClassification(PLATE, 0); fema1.setClassification(classification); } ! Container fema2 = new Container("Femacell", Container.CONSTRUCTION, true); ! Container bitumen = new Container("Bitumen", Container.CONSTRUCTION, true); ! Container foot1 = new Container("Bundrem", Container.CONSTRUCTION, true); ! Container foot2 = new Container("Fodrem", Container.CONSTRUCTION, true); ! Container top1 = new Container("Toprem", Container.CONSTRUCTION, true); ! Container top2 = new Container("Toprem", Container.CONSTRUCTION, true); ! Container post1 = new Container("Stolpe", Container.CONSTRUCTION, true); ! Container post2 = new Container("Stolpe", Container.CONSTRUCTION, true); element.add(fema1); element.add(fema2); --- 2211,2227 ---- if (net != null) { element.add(net); ! Container fema1 = Space.createConstructionSpace("Femacell"); { Classification classification = Project.getInstance().getClassification(PLATE, 0); fema1.setClassification(classification); } ! Container fema2 = Space.createConstructionSpace("Femacell"); ! Container bitumen = Space.createConstructionSpace("Bitumen"); ! Container foot1 = Space.createConstructionSpace("Bundrem"); ! Container foot2 = Space.createConstructionSpace("Fodrem"); ! Container top1 = Space.createConstructionSpace("Toprem"); ! Container top2 = Space.createConstructionSpace("Toprem"); ! Container post1 = Space.createConstructionSpace("Stolpe"); ! Container post2 = Space.createConstructionSpace("Stolpe"); element.add(fema1); element.add(fema2); *************** *** 2244,2249 **** { Map map = new HashMap(); ! Container inside = new Container("Inside", Container.CONSTRUCTION, true); ! Container outside = new Container("Outside", Container.FUNCTIONAL, false); Surface base = (Surface) surface.copy(map); Collection<Surface> sides = new LinkedList(); --- 2243,2248 ---- { Map map = new HashMap(); ! Container inside = Space.createConstructionSpace("Inside"); ! Container outside = Space.createFunctionalSpace("Outside"); Surface base = (Surface) surface.copy(map); Collection<Surface> sides = new LinkedList(); *************** *** 2263,2268 **** { Map map = new HashMap(); ! Container inside = new Container("Inside", Container.CONSTRUCTION, true); ! Container outside = new Container("Outside", Container.FUNCTIONAL, false); Surface base = (Surface) surface.copy(map); Vertex normal = base.normal(); --- 2262,2267 ---- { Map map = new HashMap(); ! Container inside = Container.createConstructionSpace("Inside"); ! Container outside = Container.createFunctionalSpace("Outside"); Surface base = (Surface) surface.copy(map); Vertex normal = base.normal(); *************** *** 2287,2292 **** { Map map = new HashMap(); ! Container inside = new Container("Inside", Container.CONSTRUCTION, true); ! Container outside = new Container("Outside", Container.FUNCTIONAL, false); Surface base = (Surface) surface.copy(map); Vertex normal = base.normal(); --- 2286,2291 ---- { Map map = new HashMap(); ! Container inside = Space.createConstructionSpace("Inside"); ! Container outside = Space.createFunctionalSpace("Outside"); Surface base = (Surface) surface.copy(map); Vertex normal = base.normal(); *************** *** 2327,2332 **** Edge e3 = new Edge(c, d); Edge e4 = new Edge(d, a); ! Container inside = new Container("Inside", Container.CONSTRUCTION, true); ! Container outside = new Container("Outside", Container.FUNCTIONAL, false); Surface base = new Surface(Shape.list(e1, e2, e3, e4)); Collection<Surface> sides = new LinkedList(); --- 2326,2331 ---- Edge e3 = new Edge(c, d); Edge e4 = new Edge(d, a); ! Container inside = Space.createConstructionSpace("Inside"); ! Container outside = Space.createFunctionalSpace("Outside"); Surface base = new Surface(Shape.list(e1, e2, e3, e4)); Collection<Surface> sides = new LinkedList(); *************** *** 2336,2340 **** all.addAll(sides); all.add(top); ! Container post = new Container("Post", Container.CONSTRUCTION, true); post.add(inside); post.add(outside); --- 2335,2339 ---- all.addAll(sides); all.add(top); ! Container post = Space.createConstructionSpace("Post"); post.add(inside); post.add(outside); Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Plane.java 23 Oct 2008 04:52:13 -0000 1.40 --- Plane.java 3 Nov 2008 14:26:18 -0000 1.41 *************** *** 232,236 **** private boolean assign = true; ! private Container silhouette = new Container("Section", Space.CONSTRUCTION, true); private List<Surface> surfaces = new LinkedList(); private Map map = new HashMap(); --- 232,236 ---- private boolean assign = true; ! private Container silhouette = Space.createUnion("Section"); private List<Surface> surfaces = new LinkedList(); private Map map = new HashMap(); Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.155 retrieving revision 1.156 diff -C2 -d -r1.155 -r1.156 *** Project.java 22 Sep 2008 15:58:10 -0000 1.155 --- Project.java 3 Nov 2008 14:26:18 -0000 1.156 *************** *** 261,265 **** staticObservers = new LinkedList(); scheduledObservers = new LinkedList(); ! world = new Container("World", Container.FUNCTIONAL, true); world.setId(new Long(0)); materials = new HashMap<Long, Material>(); --- 261,265 ---- staticObservers = new LinkedList(); scheduledObservers = new LinkedList(); ! world = Space.createFunctionalSpace("World"); world.setId(new Long(0)); materials = new HashMap<Long, Material>(); |
From: Michael L. <he...@us...> - 2008-11-03 14:26:22
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8019/src/net/sourceforge/bprocessor/gl/view Modified Files: PopupMenu.java Log Message: Refactor Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/PopupMenu.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** PopupMenu.java 3 Nov 2008 13:14:06 -0000 1.24 --- PopupMenu.java 3 Nov 2008 14:26:15 -0000 1.25 *************** *** 583,588 **** HashMap map = new HashMap(); Mesh copy = mesh.copy(map); ! Container union = Space.createConstructionSpace("Union"); ! union.setUnion(true); for (Vertex current : copy.vertices()) { union.add(current); --- 583,587 ---- HashMap map = new HashMap(); Mesh copy = mesh.copy(map); ! Container union = Space.createUnion("Union"); for (Vertex current : copy.vertices()) { union.add(current); *************** *** 803,808 **** AbstractAction action = new AbstractAction("Bounding Sphere") { private Container circle(Vertex i, Vertex j, Vertex origin, double radius) { ! Container union = Space.createConstructionSpace("Circle"); ! union.setUnion(true); LinkedList<Vertex> vertices = new LinkedList(); int n = 64; --- 802,806 ---- AbstractAction action = new AbstractAction("Bounding Sphere") { private Container circle(Vertex i, Vertex j, Vertex origin, double radius) { ! Container union = Space.createUnion("Circle"); LinkedList<Vertex> vertices = new LinkedList(); int n = 64; |
From: Michael L. <he...@us...> - 2008-11-03 13:14:25
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2332/src/net/sourceforge/bprocessor/model Modified Files: Space.java Container.java Log Message: Refactor Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.236 retrieving revision 1.237 diff -C2 -d -r1.236 -r1.237 *** Space.java 23 Oct 2008 05:35:36 -0000 1.236 --- Space.java 3 Nov 2008 13:14:09 -0000 1.237 *************** *** 26,29 **** --- 26,34 ---- /** * Space + * + * Space: name + * Container: classification, product, description + * Construct: type, level, transparent, material + * */ public abstract class Space extends Geometric implements Parametric { *************** *** 107,111 **** * @param container The container flag */ ! public Space(String name, int type, boolean container) { super(); this.name = name; --- 112,116 ---- * @param container The container flag */ ! protected Space(String name, int type, boolean container) { super(); this.name = name; *************** *** 128,132 **** * @return The space */ ! public Container createConstructionSpace(String name) { return new Container(name, Container.CONSTRUCTION, true); } --- 133,137 ---- * @return The space */ ! public static Container createConstructionSpace(String name) { return new Container(name, Container.CONSTRUCTION, true); } *************** *** 137,141 **** * @return The space */ ! public Container createFunctionalSpace(String name) { return new Container(name, Container.FUNCTIONAL, true); } --- 142,146 ---- * @return The space */ ! public static Container createFunctionalSpace(String name) { return new Container(name, Container.FUNCTIONAL, true); } *************** *** 147,151 **** * @return The space */ ! public Container createUnion(String name) { Container s = createConstructionSpace(name); s.add(new CoordinateSystem(new Vertex(0, 0, 0))); --- 152,156 ---- * @return The space */ ! public static Container createUnion(String name) { Container s = createConstructionSpace(name); s.add(new CoordinateSystem(new Vertex(0, 0, 0))); Index: Container.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Container.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Container.java 23 Oct 2008 05:35:36 -0000 1.16 --- Container.java 3 Nov 2008 13:14:09 -0000 1.17 *************** *** 56,60 **** * */ ! public Container() { super(); container = true; --- 56,60 ---- * */ ! protected Container() { super(); container = true; *************** *** 70,74 **** * @param container The container flag */ ! public Container(String name, int type, boolean container) { super(name, type, container); if (container) { --- 70,74 ---- * @param container The container flag */ ! protected Container(String name, int type, boolean container) { super(name, type, container); if (container) { |
From: Michael L. <he...@us...> - 2008-11-03 13:14:24
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2351/src/net/sourceforge/bprocessor/gui/actions Modified Files: ImportFileReader.java FileImportActionListener.java Log Message: Refactor Index: FileImportActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileImportActionListener.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** FileImportActionListener.java 3 Apr 2008 14:01:18 -0000 1.21 --- FileImportActionListener.java 3 Nov 2008 13:14:12 -0000 1.22 *************** *** 29,32 **** --- 29,33 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Container; + import net.sourceforge.bprocessor.model.Space; import org.apache.log4j.Logger; *************** *** 121,125 **** } else if (lfile.getName().endsWith(".obj")) { try { ! Container s = new Container(lfile.getName(), Container.CONSTRUCTION, true); s.setUnion(true); Component lo = new Component(Byte.MAX_VALUE, lfile, s); --- 122,126 ---- } else if (lfile.getName().endsWith(".obj")) { try { ! Container s = Space.createConstructionSpace(lfile.getName()); s.setUnion(true); Component lo = new Component(Byte.MAX_VALUE, lfile, s); Index: ImportFileReader.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/ImportFileReader.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ImportFileReader.java 3 Apr 2008 14:01:18 -0000 1.18 --- ImportFileReader.java 3 Nov 2008 13:14:12 -0000 1.19 *************** *** 31,34 **** --- 31,35 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Container; + import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 405,410 **** } if (spaceid != previousSpaceId) { ! currentSpace = new Container("Space with id " + spaceid, ! Container.CONSTRUCTION, true); where.add(currentSpace); currentSpace.setClassification(new Classification("Type " + classification, -1)); --- 406,410 ---- } if (spaceid != previousSpaceId) { ! currentSpace = Space.createConstructionSpace("Space with id " + spaceid); where.add(currentSpace); currentSpace.setClassification(new Classification("Type " + classification, -1)); *************** *** 602,606 **** */ public Container readFile() throws IOException { ! output = new Container("Design", Container.CONSTRUCTION, true); while (input.available() > 0) { readElement(); --- 602,606 ---- */ public Container readFile() throws IOException { ! output = Space.createConstructionSpace("Design"); while (input.available() > 0) { readElement(); |
From: Michael L. <he...@us...> - 2008-11-03 13:14:22
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2368/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java FacadeModellor.java Log Message: Refactor Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** NetFacadeModellor.java 17 Dec 2007 13:09:29 -0000 1.46 --- NetFacadeModellor.java 3 Nov 2008 13:14:15 -0000 1.47 *************** *** 28,31 **** --- 28,32 ---- import net.sourceforge.bprocessor.model.Selector; import net.sourceforge.bprocessor.model.Container; + import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 132,138 **** Project.getInstance().scheduleObserver(mod); s.setModellor(mod); ! frame = new Container("Frame", ! Container.CONSTRUCTION, ! true); Classification frameClass = Project.getInstance().getClassification(FRAME, 0); frame.setClassification(frameClass); --- 133,137 ---- Project.getInstance().scheduleObserver(mod); s.setModellor(mod); ! frame = Space.createConstructionSpace("Frame"); Classification frameClass = Project.getInstance().getClassification(FRAME, 0); frame.setClassification(frameClass); *************** *** 390,396 **** private void createDoubleFacade(Container net) { if (frame == null) { ! frame = new Container("Frame", ! Container.CONSTRUCTION, ! true); Classification frameClass = Project.getInstance().getClassification(FRAME, 0); frame.setClassification(frameClass); --- 389,393 ---- private void createDoubleFacade(Container net) { if (frame == null) { ! frame = Space.createConstructionSpace("Frame"); Classification frameClass = Project.getInstance().getClassification(FRAME, 0); frame.setClassification(frameClass); *************** *** 439,445 **** private void createSingleFacade(Container net) { if (frame == null) { ! frame = new Container("Frame", ! Container.CONSTRUCTION, ! true); space.add(frame); } --- 436,440 ---- private void createSingleFacade(Container net) { if (frame == null) { ! frame = Space.createConstructionSpace("Frame"); space.add(frame); } *************** *** 474,480 **** Surface hole = new Surface(Edge.placeOffset(field.getEdges(), field, offsetMap)); hole = space.insert(hole); ! Container holeSpace = new Container("Facade Hole", ! Container.FUNCTIONAL, ! true); space.add(holeSpace); Geometry.assignSame(front, hole, space, holeSpace); --- 469,473 ---- Surface hole = new Surface(Edge.placeOffset(field.getEdges(), field, offsetMap)); hole = space.insert(hole); ! Container holeSpace = Space.createFunctionalSpace("Facade Hole"); space.add(holeSpace); Geometry.assignSame(front, hole, space, holeSpace); *************** *** 519,530 **** Surface in = new Surface(Edge.placeOffset(hole.getEdges(), hole, offmap1)); Surface out = new Surface(Edge.placeOffset(hole.getEdges(), hole, offmap2)); ! Container f = new Container(type + " Frame", ! Container.CONSTRUCTION, ! true); Classification frameClass = Project.getInstance().getClassification(FRAME, 0); f.setClassification(frameClass); ! Container g = new Container("Glass", ! Container.CONSTRUCTION, ! true); Classification glassClass = Project.getInstance().getClassification(GLASS, 0); g.setClassification(glassClass); --- 512,519 ---- Surface in = new Surface(Edge.placeOffset(hole.getEdges(), hole, offmap1)); Surface out = new Surface(Edge.placeOffset(hole.getEdges(), hole, offmap2)); ! Container f = Space.createConstructionSpace(type + " Frame"); Classification frameClass = Project.getInstance().getClassification(FRAME, 0); f.setClassification(frameClass); ! Container g = Space.createConstructionSpace("Glass"); Classification glassClass = Project.getInstance().getClassification(GLASS, 0); g.setClassification(glassClass); Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** FacadeModellor.java 17 Dec 2007 13:09:29 -0000 1.41 --- FacadeModellor.java 3 Nov 2008 13:14:15 -0000 1.42 *************** *** 20,23 **** --- 20,24 ---- import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Attribute; + import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Project; *************** *** 365,369 **** if (front != null && depth > 0) { ! Container frame = new Container("Frame", Container.CONSTRUCTION, true); space.add(frame); Surface eFront = front.copy(space); --- 366,370 ---- if (front != null && depth > 0) { ! Container frame = Space.createConstructionSpace("Frame"); space.add(frame); Surface eFront = front.copy(space); *************** *** 690,694 **** Surface s = (Surface)it.next(); Set sides = new HashSet(); ! Container w = new Container("Window", Container.CONSTRUCTION, true); double u = s.normal().dot(front.normal()); if ((u > 0 && front.getBackDomain() == space) || --- 691,695 ---- Surface s = (Surface)it.next(); Set sides = new HashSet(); ! Container w = Space.createConstructionSpace("Window"); double u = s.normal().dot(front.normal()); if ((u > 0 && front.getBackDomain() == space) || |
From: Michael L. <he...@us...> - 2008-11-03 13:14:21
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2332/src/net/sourceforge/bprocessor/model/modellor Modified Files: TileModellor.java WallPartingModellor.java InnerWallModellor.java ModelBathModellor2.java Log Message: Refactor Index: TileModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/TileModellor.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** TileModellor.java 18 Dec 2007 10:36:59 -0000 1.29 --- TileModellor.java 3 Nov 2008 13:14:09 -0000 1.30 *************** *** 28,31 **** --- 28,32 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selector; + import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.SurfaceAnalysis; *************** *** 178,182 **** outer.addHole(newS); space.addAll(newS); ! Container sp = new Container("Tile", Container.CONSTRUCTION, true); if (sign == -1) { newS.setBackDomain(sp); --- 179,183 ---- outer.addHole(newS); space.addAll(newS); ! Container sp = Space.createConstructionSpace("Tile"); if (sign == -1) { newS.setBackDomain(sp); *************** *** 190,194 **** } ! Container joint = new Container("Tile", Container.CONSTRUCTION, true); if (sign == -1) { outer.setBackDomain(joint); --- 191,195 ---- } ! Container joint = Space.createConstructionSpace("Tile"); if (sign == -1) { outer.setBackDomain(joint); Index: WallPartingModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/WallPartingModellor.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** WallPartingModellor.java 13 Dec 2007 12:00:33 -0000 1.8 --- WallPartingModellor.java 3 Nov 2008 13:14:09 -0000 1.9 *************** *** 20,23 **** --- 20,24 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selector; + import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 162,166 **** Edge between2 = new Edge(inner.getTo(), outerCopy.getTo()); Surface s = new Surface(inner, between1, outerCopy, between2); ! Container concrete = new Container("Concrete", Container.CONSTRUCTION, true); space.add(concrete); if (s.normal().getZ() == 1.0) { --- 163,167 ---- Edge between2 = new Edge(inner.getTo(), outerCopy.getTo()); Surface s = new Surface(inner, between1, outerCopy, between2); ! Container concrete = Space.createConstructionSpace("Concrete"); space.add(concrete); if (s.normal().getZ() == 1.0) { *************** *** 181,185 **** between2 = new Edge(inner2.getTo(), tileCopy.getTo()); s = new Surface(inner2, between1, tileCopy, between2); ! Container tile = new Container("Tile", Container.CONSTRUCTION, true); space.add(tile); if (s.normal().getZ() == 1.0) { --- 182,186 ---- between2 = new Edge(inner2.getTo(), tileCopy.getTo()); s = new Surface(inner2, between1, tileCopy, between2); ! Container tile = Space.createConstructionSpace("Tile"); space.add(tile); if (s.normal().getZ() == 1.0) { Index: InnerWallModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/InnerWallModellor.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** InnerWallModellor.java 17 Dec 2007 13:09:18 -0000 1.17 --- InnerWallModellor.java 3 Nov 2008 13:14:09 -0000 1.18 *************** *** 217,221 **** Surface base = joistBase(); space.add(base); ! Container joist = new Container("joist", Container.CONSTRUCTION, true); Classification c = Project.getInstance().getClassification("-1.-205.01.01", 0); joist.setClassificationType(c.getPossibleTypes().getChildren().get(0)); --- 217,221 ---- Surface base = joistBase(); space.add(base); ! Container joist = Space.createConstructionSpace("joist"); Classification c = Project.getInstance().getClassification("-1.-205.01.01", 0); joist.setClassificationType(c.getPossibleTypes().getChildren().get(0)); *************** *** 269,275 **** Surface sheet1 = new Surface(outlineCopy1); Surface sheet2 = new Surface(outlineCopy2); ! Container sheetSpace1 = new Container("sheet1", Container.CONSTRUCTION, true); sheetSpace1.setClassification(woodSheet()); ! Container sheetSpace2 = new Container("sheet2", Container.CONSTRUCTION, true); sheetSpace2.setClassification(woodSheet()); Vertex j = cs.getJ().copy(); --- 269,275 ---- Surface sheet1 = new Surface(outlineCopy1); Surface sheet2 = new Surface(outlineCopy2); ! Container sheetSpace1 = Space.createConstructionSpace("sheet1"); sheetSpace1.setClassification(woodSheet()); ! Container sheetSpace2 = Space.createConstructionSpace("sheet2"); sheetSpace2.setClassification(woodSheet()); Vertex j = cs.getJ().copy(); Index: ModelBathModellor2.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/ModelBathModellor2.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ModelBathModellor2.java 17 Dec 2007 13:09:18 -0000 1.16 --- ModelBathModellor2.java 3 Nov 2008 13:14:09 -0000 1.17 *************** *** 157,167 **** */ private void generateBath() { ! floor = new Container("Floor", Container.CONSTRUCTION, true); space.add(floor); ! bath = new Container("Bath cabin", Container.FUNCTIONAL, true); space.add(bath); ! walls = new Container("Walls", Container.CONSTRUCTION, true); space.add(walls); ! ceiling = new Container("Ceiling", Container.CONSTRUCTION, true); space.add(ceiling); makeFloor(); --- 157,167 ---- */ private void generateBath() { ! floor = Space.createConstructionSpace("Floor"); space.add(floor); ! bath = Space.createFunctionalSpace("Bath cabin"); space.add(bath); ! walls = Space.createConstructionSpace("Walls"); space.add(walls); ! ceiling = Space.createConstructionSpace("Ceiling"); space.add(ceiling); makeFloor(); *************** *** 292,296 **** Edge between2 = new Edge(inner.getTo(), outerCopy.getTo()); Surface s = new Surface(inner, between1, outerCopy, between2); ! Container concrete = new Container("Concrete", Container.CONSTRUCTION, true); walls.add(concrete); if (s.normal().getZ() == 1.0) { --- 292,296 ---- Edge between2 = new Edge(inner.getTo(), outerCopy.getTo()); Surface s = new Surface(inner, between1, outerCopy, between2); ! Container concrete = Space.createConstructionSpace("Concrete"); walls.add(concrete); if (s.normal().getZ() == 1.0) { *************** *** 311,315 **** between2 = new Edge(inner2.getTo(), tileCopy.getTo()); s = new Surface(inner2, between1, tileCopy, between2); ! Container tile = new Container("Tile", Container.CONSTRUCTION, true); walls.add(tile); if (s.normal().getZ() == 1.0) { --- 311,315 ---- between2 = new Edge(inner2.getTo(), tileCopy.getTo()); s = new Surface(inner2, between1, tileCopy, between2); ! Container tile = Space.createConstructionSpace("Tile"); walls.add(tile); if (s.normal().getZ() == 1.0) { *************** *** 396,400 **** if (s.getCurrentValue().equals("Door")) { // make a door ! Container doorSpc = new Container("Door", Container.CONSTRUCTION, true); doorAndWindows.add(doorSpc); space.add(doorSpc); --- 396,400 ---- if (s.getCurrentValue().equals("Door")) { // make a door ! Container doorSpc = Space.createConstructionSpace("Door"); doorAndWindows.add(doorSpc); space.add(doorSpc); *************** *** 439,443 **** } else if (s.getCurrentValue().equals("Window")) { //make a window ! Container winSpc = new Container("Window", Container.CONSTRUCTION, true); doorAndWindows.add(winSpc); space.add(winSpc); --- 439,443 ---- } else if (s.getCurrentValue().equals("Window")) { //make a window ! Container winSpc = Space.createConstructionSpace("Window"); doorAndWindows.add(winSpc); space.add(winSpc); *************** *** 674,678 **** public Modellor newInstance(Container s) { if (s.getLevel() == Container.PROJECT_LEVEL) { ! Container bath = new Container("Bath-union", Container.CONSTRUCTION, true); bath.setUnion(true); s.add(bath); --- 674,678 ---- public Modellor newInstance(Container s) { if (s.getLevel() == Container.PROJECT_LEVEL) { ! Container bath = Space.createConstructionSpace("Bath-union"); bath.setUnion(true); s.add(bath); |
From: Michael L. <he...@us...> - 2008-11-03 13:14:19
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2351/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Refactor Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** GUI.java 8 May 2008 10:22:03 -0000 1.100 --- GUI.java 3 Nov 2008 13:14:12 -0000 1.101 *************** *** 34,37 **** --- 34,38 ---- import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Container; + import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 314,318 **** AbstractAction action = new AbstractAction("Union") { public void actionPerformed(ActionEvent e) { ! Container union = new Container("Union", Container.CONSTRUCTION, true); union.setUnion(true); Container active = Project.getInstance().getActiveSpace(); --- 315,319 ---- AbstractAction action = new AbstractAction("Union") { public void actionPerformed(ActionEvent e) { ! Container union = Space.createConstructionSpace("Union"); union.setUnion(true); Container active = Project.getInstance().getActiveSpace(); |
From: Michael L. <he...@us...> - 2008-11-03 13:14:19
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2316/src/net/sourceforge/bprocessor/gl/view Modified Files: PopupMenu.java Log Message: Refactor Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/PopupMenu.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** PopupMenu.java 13 Oct 2008 10:54:08 -0000 1.23 --- PopupMenu.java 3 Nov 2008 13:14:06 -0000 1.24 *************** *** 355,359 **** AbstractAction action = new SpaceMenuAction(sp, "Normals") { public void actionPerformed(ActionEvent event) { ! Container union = new Container("Normals", Container.CONSTRUCTION, true); for (Surface surface : space.getSurfaces()) { Vertex normal = surface.normal(); --- 355,359 ---- AbstractAction action = new SpaceMenuAction(sp, "Normals") { public void actionPerformed(ActionEvent event) { ! Container union = Space.createConstructionSpace("Normals"); for (Surface surface : space.getSurfaces()) { Vertex normal = surface.normal(); *************** *** 583,587 **** HashMap map = new HashMap(); Mesh copy = mesh.copy(map); ! Container union = new Container("Union", Container.CONSTRUCTION, true); union.setUnion(true); for (Vertex current : copy.vertices()) { --- 583,587 ---- HashMap map = new HashMap(); Mesh copy = mesh.copy(map); ! Container union = Space.createConstructionSpace("Union"); union.setUnion(true); for (Vertex current : copy.vertices()) { *************** *** 803,807 **** AbstractAction action = new AbstractAction("Bounding Sphere") { private Container circle(Vertex i, Vertex j, Vertex origin, double radius) { ! Container union = new Container("Circle", Container.CONSTRUCTION, true); union.setUnion(true); LinkedList<Vertex> vertices = new LinkedList(); --- 803,807 ---- AbstractAction action = new AbstractAction("Bounding Sphere") { private Container circle(Vertex i, Vertex j, Vertex origin, double radius) { ! Container union = Space.createConstructionSpace("Circle"); union.setUnion(true); LinkedList<Vertex> vertices = new LinkedList(); |
From: Michael L. <he...@us...> - 2008-11-03 13:14:19
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2316/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java Log Message: Refactor Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.147 retrieving revision 1.148 diff -C2 -d -r1.147 -r1.148 *** AbstractTool.java 2 Jun 2008 11:53:44 -0000 1.147 --- AbstractTool.java 3 Nov 2008 13:14:06 -0000 1.148 *************** *** 18,21 **** --- 18,22 ---- import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Container; + import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Transform; *************** *** 796,800 **** public void evaluate(Environment env, Stack<Object> stack) { String name = (String) env.get(0); ! Container result = new Container(name, Container.CONSTRUCTION, true); stack.push(result); } --- 797,801 ---- public void evaluate(Environment env, Stack<Object> stack) { String name = (String) env.get(0); ! Container result = Space.createConstructionSpace(name); stack.push(result); } |
From: Michael L. <he...@us...> - 2008-10-23 05:35:46
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26811/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Defaults.java Space.java Container.java Log Message: Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.220 retrieving revision 1.221 diff -C2 -d -r1.220 -r1.221 *** Surface.java 7 Apr 2008 11:20:31 -0000 1.220 --- Surface.java 23 Oct 2008 05:35:36 -0000 1.221 *************** *** 1340,1344 **** return backMaterial; } else { ! return frontDomain.material(); } } --- 1340,1344 ---- return backMaterial; } else { ! return backDomain.material(); } } *************** *** 1368,1372 **** return frontMaterial; } else { ! return backDomain.material(); } } --- 1368,1372 ---- return frontMaterial; } else { ! return frontDomain.material(); } } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.235 retrieving revision 1.236 diff -C2 -d -r1.235 -r1.236 *** Space.java 8 Oct 2008 10:26:39 -0000 1.235 --- Space.java 23 Oct 2008 05:35:36 -0000 1.236 *************** *** 82,86 **** /** The material */ ! private Material material; --- 82,86 ---- /** The material */ ! protected Material material; Index: Container.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Container.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Container.java 6 Feb 2008 14:41:52 -0000 1.15 --- Container.java 23 Oct 2008 05:35:36 -0000 1.16 *************** *** 1484,1487 **** --- 1484,1488 ---- copy.transparent = transparent; copy.type = type; + copy.material = material; return copy; } Index: Defaults.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Defaults.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Defaults.java 7 Apr 2008 11:20:31 -0000 1.4 --- Defaults.java 23 Oct 2008 05:35:36 -0000 1.5 *************** *** 12,22 **** */ public class Defaults { ! ! private static Material constructionMaterial ! = new Material("Construction", new float[] {0.96f, 0.87f, 0.70f}); private static Material voidMaterial = new Material("Void", new float[] {255f / 280, 228f / 280, 225f / 280}); ! private static Material functionalMaterial ! = new Material("Functional", new float[] {0.90f, 0.90f, 0.90f}); --- 12,22 ---- */ public class Defaults { ! ! private static Material functionalMaterial ! = new Material("Functional", new float[] {0.96f, 0.87f, 0.70f}); private static Material voidMaterial = new Material("Void", new float[] {255f / 280, 228f / 280, 225f / 280}); ! private static Material constructionMaterial ! = new Material("Construction", new float[] {0.90f, 0.90f, 0.90f}); |
From: Michael L. <he...@us...> - 2008-10-23 04:52:21
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24692/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Plane.java Log Message: clipping algorithm Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** Edge.java 8 Oct 2008 10:26:39 -0000 1.109 --- Edge.java 23 Oct 2008 04:52:13 -0000 1.110 *************** *** 509,514 **** --- 509,516 ---- Vertex to = getTo(); Edge e1 = new Edge(from, vertex); + e1.setStrippled(this.getStrippled()); added.add(e1); Edge e2 = new Edge(vertex, to); + e2.setStrippled(this.getStrippled()); added.add(e2); if (getOwner() != null) { Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Plane.java 15 Oct 2008 08:25:51 -0000 1.39 --- Plane.java 23 Oct 2008 04:52:13 -0000 1.40 *************** *** 11,18 **** --- 11,21 ---- import java.util.Comparator; import java.util.HashMap; + import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; + import java.util.Queue; + import java.util.Set; import net.sourceforge.bprocessor.model.SurfaceAnalysis.EdgeStructure; *************** *** 225,273 **** } ! /** ! * Calculates the intersection between the input geometry and this Plane ! * @param input Geometry in the form of a Mesh ! * @return intersection in the form of a Container ! */ ! public Container intersection(Mesh input) { ! Container silhouette = new Container("Section", Space.CONSTRUCTION, true); ! List<Surface> surfaces = new LinkedList(); ! List<Entry> entries = new LinkedList(); ! Map map = new HashMap(); ! Map<Edge, Entry> planar = new HashMap(); ! for (Space current : input.elements()) { ! if (!current.isVoid()) { ! Space element = current.shallowCopy(); ! map.put(current, element); ! silhouette.add(element); ! } else { ! map.put(current, silhouette.getEmpty()); } } ! for (Edge current : input.edges()) { ! if (contains(current)) { ! Edge edge = (Edge) current.copy(map); ! silhouette.insert(edge); ! Entry entry = new Entry(edge, Entry.PLANAR); ! entries.add(entry); ! planar.put(current, entry); } } ! for (Surface current : input.surfaces()) { Collection<Edge> contour = current.getEdges(); ! if (planar.keySet().containsAll(contour)) { ! for (Edge edge : contour) { ! Entry entry = planar.get(edge); ! entry.surfaces().add(current); } - Surface surface = (Surface) current.copy(map); - silhouette.insert(surface); - Space front = current.getFrontDomain(); - front = (Space) map.get(front); - Space back = current.getBackDomain(); - back = (Space) map.get(back); - surface.setFrontDomain((Container) front); - surface.setBackDomain((Container) back); } else { { LinkedList<Vertex> intersections = new LinkedList(); --- 228,332 ---- } ! private class Intersector implements Runnable { ! private Mesh input; ! private boolean assign = true; ! ! private Container silhouette = new Container("Section", Space.CONSTRUCTION, true); ! private List<Surface> surfaces = new LinkedList(); ! private Map map = new HashMap(); ! private Set<Edge> planar = new HashSet(); ! private Set<Surface> mark = new HashSet(); ! ! /** ! * Constructor ! * @param input Mesh ! */ ! public Intersector(Mesh input) { ! this.input = input; ! } ! ! /** ! * Insert a shallow copy of all elements in the silhouette ! */ ! private void copyElements() { ! for (Space current : input.elements()) { ! if (!current.isVoid()) { ! Space element = current.shallowCopy(); ! map.put(current, element); ! silhouette.add(element); ! } else { ! map.put(current, silhouette.getEmpty()); ! } } } ! ! /** ! * Insert a copy of all planar edges in the silhouette ! */ ! private void copyPlanarEdges() { ! for (Edge current : input.edges()) { ! if (contains(current)) { ! Edge edge = (Edge) current.copy(map); ! silhouette.insert(edge); ! planar.add(current); ! } } } ! ! private void intersect(Collection<Surface> surfaces) { ! for (Surface current : surfaces) { ! handle(current); ! } ! } ! ! private void handle(Surface surface) { ! if (!mark.contains(surface)) { ! mark.add(surface); ! if (surface.getExterior() != null) { ! handle(surface.getExterior()); ! } ! intersect(surface); ! } ! } ! ! private void insert(Edge line) { ! Queue<Edge> queue = new LinkedList(); ! queue.offer(line); ! while (!queue.isEmpty()) { ! splitting: ! { ! Edge edge = queue.remove(); ! for (Vertex current : silhouette.getVertices()) { ! if (edge.coincides(current)) { ! Collection<Edge> added = edge.split(current); ! queue.addAll(added); ! break splitting; ! } ! } ! silhouette.insert(edge); ! } ! } ! } ! ! private void intersect(Surface current) { Collection<Edge> contour = current.getEdges(); ! if (planar.containsAll(contour)) { ! // Insert a copy a planar surface along with space assignments ! if (assign) { ! Surface surface = (Surface) current.copy(map); ! silhouette.insert(surface); ! ! // Assign ! Space front = current.getFrontDomain(); ! front = (Space) map.get(front); ! Space back = current.getBackDomain(); ! back = (Space) map.get(back); ! surface.setFrontDomain((Container) front); ! surface.setBackDomain((Container) back); } } else { + // Compute intersections with the plane and compute a new + // contour for surface intersected with plane. + { LinkedList<Vertex> intersections = new LinkedList(); *************** *** 300,303 **** --- 359,363 ---- if (intersections.size() > 1) { + // Insert intersection lines in silhouette { final Vertex leader = intersections.getFirst(); *************** *** 336,343 **** if (silhouette.findEdge(line) == null) { line.setStrippled(true); ! silhouette.insert(line); ! Entry entry = new Entry(line, Entry.INTERSECTION); ! entries.add(entry); ! entry.surfaces().add(current); } } --- 396,400 ---- if (silhouette.findEdge(line) == null) { line.setStrippled(true); ! insert(line); } } *************** *** 345,376 **** } } { - List<Edge> frame = new LinkedList(); - for (Edge edge : lst) { - frame.add(silhouette.insert(edge)); - } - Vertex normal = current.normal(); ! Surface leader = new Surface(frame); ! silhouette.add(leader); ! Vertex n = leader.normal(); ! Container front = current.getFrontDomain(); ! front = (Container) map.get(front); ! Container back = current.getBackDomain(); ! back = (Container) map.get(back); ! if (n.dot(normal) < 0) { ! leader.setFrontDomain(back); ! leader.setBackDomain(front); ! } else { ! leader.setFrontDomain(front); ! leader.setBackDomain(back); } - - CoordinateSystem system = current.coordinateSystem(); - SurfaceAnalysis analysis = new SurfaceAnalysis(); - EdgeStructure structure = analysis.new EdgeStructure(silhouette, system, frame); - Collection<Surface> faces = structure.surfaceAnalysis(frame); - surfaces.addAll(faces); } } --- 402,440 ---- } } + + // Insert intersecting surface into silhouette for the purpose of space assignment { ! if (assign) { ! ! List<Edge> frame = new LinkedList(); ! for (Edge edge : lst) { ! frame.add(silhouette.insert(edge)); ! } ! ! Vertex normal = current.normal(); ! ! Surface leader = new Surface(frame); ! silhouette.add(leader); ! Vertex n = leader.normal(); ! Container front = current.getFrontDomain(); ! front = (Container) map.get(front); ! Container back = current.getBackDomain(); ! back = (Container) map.get(back); ! if (n.dot(normal) < 0) { ! leader.setFrontDomain(back); ! leader.setBackDomain(front); ! } else { ! leader.setFrontDomain(front); ! leader.setBackDomain(back); ! } ! ! CoordinateSystem system = current.coordinateSystem(); ! SurfaceAnalysis analysis = new SurfaceAnalysis(); ! EdgeStructure structure = analysis.new EdgeStructure(silhouette, system, frame); ! Collection<Surface> faces = structure.surfaceAnalysis(frame); ! surfaces.addAll(faces); } } } *************** *** 379,472 **** } ! ! ! CoordinateSystem system = coordinateSystem(); ! SurfaceAnalysis analysis = new SurfaceAnalysis(); ! ! EdgeStructure structure = analysis.new EdgeStructure(silhouette, system, silhouette.getEdges()); ! Collection<Surface> faces = structure.surfaceAnalysis(silhouette.getEdges()); ! ! SpaceAnalysis analizer = new SpaceAnalysis(); ! for (Surface face : faces) { ! analizer.subsume(face, 1); ! analizer.subsume(face, -1); ! } ! ! for (Surface surface : surfaces) { ! surface.delete(); ! } ! ! { ! List<Edge> deletion = new LinkedList(); ! for (Edge edge : silhouette.getEdges()) { ! if (!contains(edge)) { ! deletion.add(edge); ! } } ! for (Edge edge : deletion) { ! edge.delete(); } ! } ! return silhouette; ! } ! ! private class Entry { ! public static final int PLANAR = 0; ! public static final int INTERSECTION = 1; ! ! ! private Edge edge; ! private int kind; ! private List<Surface> surfaces; ! private double x; ! private double y0; ! private double y1; ! private double x0; ! private double x1; ! ! public Entry(Edge edge, int kind) { ! this.edge = edge; ! this.kind = kind; ! surfaces = new LinkedList(); ! } ! ! public List<Surface> surfaces() { ! return surfaces; ! } ! ! public boolean eq(double a, double b) { ! return Math.abs(a - b) < 0.0000001; ! } ! ! public boolean ignore() { ! return eq(y0, y1); ! } ! ! public void order() { ! if (edge.from.y < edge.to.y) { ! y0 = edge.from.y; ! x0 = edge.from.x; ! y1 = edge.to.y; ! x1 = edge.from.x; ! } else { ! y0 = edge.to.y; ! x0 = edge.to.x; ! y1 = edge.from.y; ! x1 = edge.to.x; } } ! public void findIntersectingX(double y) { ! double dx = x1 - x0; ! double dy = y1 - y0; ! x = x1 + ((y - y0 / dy)) * dx; } ! public String toString() { ! return "{" + edge + " " + y0 + " " + y1 + "}"; } } /** * Return the projection of the vertex into this Plane * @param vertex Vertex --- 443,521 ---- } ! /** ! * Compute space assignments ! */ ! private void assign() { ! CoordinateSystem system = coordinateSystem(); ! ! SurfaceAnalysis analysis = new SurfaceAnalysis(); ! ! EdgeStructure structure = ! analysis.new EdgeStructure(silhouette, system, silhouette.getEdges()); ! Collection<Surface> faces = structure.surfaceAnalysis(silhouette.getEdges()); ! ! SpaceAnalysis analizer = new SpaceAnalysis(); ! for (Surface face : faces) { ! analizer.subsume(face, 1); ! analizer.subsume(face, -1); } ! ! // Delete extra geometry ! for (Surface surface : surfaces) { ! surface.delete(); } ! ! { ! List<Edge> deletion = new LinkedList(); ! for (Edge edge : silhouette.getEdges()) { ! if (!contains(edge)) { ! deletion.add(edge); ! } ! } ! for (Edge edge : deletion) { ! edge.delete(); ! } } } ! public void run() { ! if (assign) { ! copyElements(); ! } ! ! copyPlanarEdges(); ! ! intersect(input.surfaces()); ! ! if (assign) { ! assign(); ! } ! ! for (Surface current : silhouette.getSurfaces()) { ! Geometry.holeAnalysis(current); ! } } ! /** ! * Container ! * @return silhouette ! */ ! public Container silhouette() { ! return silhouette; } } /** + * Calculates the intersection between the input geometry and this Plane + * @param input Geometry in the form of a Mesh + * @return intersection in the form of a Container + */ + public Container intersection(Mesh input) { + Intersector intersector = new Intersector(input); + intersector.run(); + return intersector.silhouette(); + } + + /** * Return the projection of the vertex into this Plane * @param vertex Vertex |
From: Michael L. <he...@us...> - 2008-10-15 08:28:35
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32328/src/net/sourceforge/bprocessor/model Modified Files: Plane.java Log Message: Remove extra lines from section Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Plane.java 15 Oct 2008 08:18:57 -0000 1.38 --- Plane.java 15 Oct 2008 08:25:51 -0000 1.39 *************** *** 397,400 **** --- 397,411 ---- } + { + List<Edge> deletion = new LinkedList(); + for (Edge edge : silhouette.getEdges()) { + if (!contains(edge)) { + deletion.add(edge); + } + } + for (Edge edge : deletion) { + edge.delete(); + } + } return silhouette; } |
From: Michael L. <he...@us...> - 2008-10-15 08:19:10
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32062/src/net/sourceforge/bprocessor/model Modified Files: Plane.java Log Message: Section algorithm Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Plane.java 8 Oct 2008 10:26:39 -0000 1.37 --- Plane.java 15 Oct 2008 08:18:57 -0000 1.38 *************** *** 232,235 **** --- 232,236 ---- public Container intersection(Mesh input) { Container silhouette = new Container("Section", Space.CONSTRUCTION, true); + List<Surface> surfaces = new LinkedList(); List<Entry> entries = new LinkedList(); Map map = new HashMap(); *************** *** 271,274 **** --- 272,276 ---- { LinkedList<Vertex> intersections = new LinkedList(); + List<Edge> lst = new LinkedList(); Vertex from = current.getFirstVertex(); Vertex to = null; *************** *** 277,289 **** --- 279,302 ---- if (contains(from)) { intersections.add(from); + lst.add((Edge) edge.copy(map)); } else if (!contains(to)) { Vertex intersection = intersection(edge); if (intersection != null) { intersections.add(intersection); + Edge e1 = new Edge((Vertex) from.copy(map), intersection); + Edge e2 = new Edge(intersection, (Vertex) to.copy(map)); + lst.add(e1); + lst.add(e2); + } else { + lst.add((Edge) edge.copy(map)); } + } else { + lst.add((Edge) edge.copy(map)); } from = to; } + + if (intersections.size() > 1) { { *************** *** 332,335 **** --- 345,377 ---- } } + { + List<Edge> frame = new LinkedList(); + for (Edge edge : lst) { + frame.add(silhouette.insert(edge)); + } + + Vertex normal = current.normal(); + + Surface leader = new Surface(frame); + silhouette.add(leader); + Vertex n = leader.normal(); + Container front = current.getFrontDomain(); + front = (Container) map.get(front); + Container back = current.getBackDomain(); + back = (Container) map.get(back); + if (n.dot(normal) < 0) { + leader.setFrontDomain(back); + leader.setBackDomain(front); + } else { + leader.setFrontDomain(front); + leader.setBackDomain(back); + } + + CoordinateSystem system = current.coordinateSystem(); + SurfaceAnalysis analysis = new SurfaceAnalysis(); + EdgeStructure structure = analysis.new EdgeStructure(silhouette, system, frame); + Collection<Surface> faces = structure.surfaceAnalysis(frame); + surfaces.addAll(faces); + } } } *************** *** 337,345 **** } CoordinateSystem system = coordinateSystem(); SurfaceAnalysis analysis = new SurfaceAnalysis(); EdgeStructure structure = analysis.new EdgeStructure(silhouette, system, silhouette.getEdges()); ! structure.surfaceAnalysis(silhouette.getEdges()); return silhouette; --- 379,399 ---- } + + CoordinateSystem system = coordinateSystem(); SurfaceAnalysis analysis = new SurfaceAnalysis(); EdgeStructure structure = analysis.new EdgeStructure(silhouette, system, silhouette.getEdges()); ! Collection<Surface> faces = structure.surfaceAnalysis(silhouette.getEdges()); ! ! SpaceAnalysis analizer = new SpaceAnalysis(); ! for (Surface face : faces) { ! analizer.subsume(face, 1); ! analizer.subsume(face, -1); ! } ! ! for (Surface surface : surfaces) { ! surface.delete(); ! } return silhouette; |
From: Michael L. <he...@us...> - 2008-10-13 10:54:29
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19501/src/net/sourceforge/bprocessor/model Modified Files: SpaceAnalysis.java Log Message: Index: SpaceAnalysis.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SpaceAnalysis.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** SpaceAnalysis.java 31 Jan 2008 14:32:12 -0000 1.12 --- SpaceAnalysis.java 13 Oct 2008 10:54:13 -0000 1.13 *************** *** 86,94 **** while (!queue.isEmpty()) { Element element = queue.remove(); ! process(element); } } ! private void process(Element element) { Surface surface = element.surface(); int side = element.side; --- 86,95 ---- while (!queue.isEmpty()) { Element element = queue.remove(); ! propgate(element); } } ! ! private void propgate(Element element) { Surface surface = element.surface(); int side = element.side; *************** *** 100,118 **** if (selected != null) { if (!mark.contains(selected)) { if (travel(surface, current) == travel(selected, current)) { ! if (side == 1) { ! selected.setBackDomain(surface.getFrontDomain()); ! } else { ! selected.setFrontDomain(surface.getBackDomain()); ! } ! queue.offer(new Element(selected, -side)); } else { ! if (side == 1) { ! selected.setFrontDomain(surface.getFrontDomain()); ! } else { ! selected.setBackDomain(surface.getBackDomain()); ! } ! queue.offer(new Element(selected, side)); } } } --- 101,112 ---- if (selected != null) { if (!mark.contains(selected)) { + int other = 0; if (travel(surface, current) == travel(selected, current)) { ! other = -side; } else { ! other = side; } + setSide(selected, other, getSide(surface, side)); + queue.offer(new Element(selected, other)); } } *************** *** 121,124 **** --- 115,187 ---- } + /** + * Subsume a space assignment in specified direction + * 1 = front and -1 = back from a neighbour + * @param surface Surface whose space assigment is propagated + * @param side side of surface to start + */ + public void subsume(Surface surface, int side) { + Container space = surface.getOwner(); + edgemap = new HashMap(); + for (Edge current : space.getEdges()) { + edgemap.put(current, new LinkedList()); + } + for (Surface current : space.getSurfaces()) { + for (Edge edge : current.getEdges()) { + edgemap.get(edge).add(current); + } + } + + mark = new HashSet(); + Element element = new Element(surface, side); + subsume(element); + } + + + private void subsume(Element element) { + Surface surface = element.surface(); + int side = element.side; + if (!mark.contains(surface)) { + mark.add(surface); + Container assigned = getSide(surface, side); + if (assigned.isVoid()) { + for (Edge current : surface.getEdges()) { + List<Surface> surfaces = edgemap.get(current); + if (surfaces.size() > 1) { + Surface selected = select(current, surfaces, surface, side); + int other = 0; + if (travel(surface, current) == travel(selected, current)) { + other = -side; + } else { + other = side; + } + subsume(new Element(selected, other)); + Container container = getSide(selected, other); + if (!container.isVoid()) { + setSide(surface, side, container); + } + } + } + } + } + } + + private Container getSide(Surface surface, int side) { + if (side == 1) { + return surface.getFrontDomain(); + } else { + return surface.getBackDomain(); + } + } + + private void setSide(Surface surface, int side, Container space) { + if (side == 1) { + surface.setFrontDomain(space); + } else { + surface.setBackDomain(space); + } + } + + private Surface select(Edge edge, List<Surface> surfaces, Surface leader, int side) { Vertex n = edge.getDirection(); |
From: Michael L. <he...@us...> - 2008-10-13 10:54:18
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19481/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.142 retrieving revision 1.143 diff -C2 -d -r1.142 -r1.143 *** GenericTreeView.java 22 Sep 2008 15:58:17 -0000 1.142 --- GenericTreeView.java 13 Oct 2008 10:54:11 -0000 1.143 *************** *** 607,614 **** * @return the menu */ ! public JPopupMenu menu() { JPopupMenu pm = GUI.getInstance().menuFactory().menuFor(Selection.primary()); if (pm == null) { Object object = this.getUserObject(); if (object instanceof Attribute) { pm = GUI.getInstance().menuFactory().menuFor((Attribute)object); --- 607,616 ---- * @return the menu */ ! public JPopupMenu menu() { ! System.out.println("menu.."); JPopupMenu pm = GUI.getInstance().menuFactory().menuFor(Selection.primary()); if (pm == null) { Object object = this.getUserObject(); + System.out.println("menu: " + object); if (object instanceof Attribute) { pm = GUI.getInstance().menuFactory().menuFor((Attribute)object); |
From: Michael L. <he...@us...> - 2008-10-13 10:54:16
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19464/src/net/sourceforge/bprocessor/gl/view Modified Files: PopupMenu.java Log Message: Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/PopupMenu.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** PopupMenu.java 21 Apr 2008 12:23:15 -0000 1.22 --- PopupMenu.java 13 Oct 2008 10:54:08 -0000 1.23 *************** *** 38,41 **** --- 38,42 ---- import net.sourceforge.bprocessor.model.Classification; import net.sourceforge.bprocessor.model.ClassificationType; + import net.sourceforge.bprocessor.model.ClippingPlane; import net.sourceforge.bprocessor.model.Command; import net.sourceforge.bprocessor.model.Component; *************** *** 52,55 **** --- 53,57 ---- import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; + import net.sourceforge.bprocessor.model.SpaceAnalysis; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.SurfaceAnalysis; *************** *** 111,114 **** --- 113,128 ---- { + AbstractAction action = new EntityMenuAction(s, "Assign from Neighbours") { + public void actionPerformed(ActionEvent event) { + Surface surface = (Surface) entity; + SpaceAnalysis analysis = new SpaceAnalysis(); + analysis.subsume(surface, 1); + analysis.subsume(surface, -1); + } + }; + menu.add(action); + } + + { AbstractAction action = new GeometricMenuAction(surfaces, "Smooth...") { public void actionPerformed(ActionEvent event) { *************** *** 968,973 **** --- 982,1009 ---- } + + /** + * + * @param planes collection of clippingplanes + * @return menu + */ + public JPopupMenu getClippingPlaneMenu(Collection<ClippingPlane> planes) { + JPopupMenu menu = new JPopupMenu(); + AbstractAction action = new GeometricMenuAction(planes, "Insert Section") { + public void actionPerformed(ActionEvent arg0) { + for (Geometric geomeric : entities) { + ClippingPlane clip = (ClippingPlane) geomeric; + Container silhouette = clip.getSilhouette(); + Project.getInstance().getActiveSpace().add(silhouette); + } + } + }; + menu.add(action); + return menu; + } + /** {@inheritDoc} */ public JPopupMenu menuFor(Collection<? extends Entity> geometrics) { + if (geometrics.isEmpty()) { return getBackgroundMenu(); *************** *** 981,985 **** } } ! if (type instanceof Container) { return getSpaceMenu(new LinkedList<Container>((Collection<Container>)geometrics)); } else if (type instanceof Surface) { --- 1017,1023 ---- } } ! if (type instanceof ClippingPlane) { ! return getClippingPlaneMenu(new LinkedList(geometrics)); ! } else if (type instanceof Container) { return getSpaceMenu(new LinkedList<Container>((Collection<Container>)geometrics)); } else if (type instanceof Surface) { *************** *** 1002,1005 **** --- 1040,1044 ---- /** {@inheritDoc} */ public JPopupMenu menuFor(Entity entity) { + System.out.println("get menu for " + entity); Collection<Entity> c = new LinkedList<Entity>(); c.add(entity); |
From: Michael L. <he...@us...> - 2008-10-08 10:29:19
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24802/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: Clippingplane improved Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** Display.java 10 Sep 2008 22:53:50 -0000 1.84 --- Display.java 8 Oct 2008 10:26:36 -0000 1.85 *************** *** 827,832 **** gl.glEnd(); if (clipplane.isActive()) { ! Collection<Surface> surfaces = clipplane.getSilhouette().getSurfaces(); ! paintSurfaces(surfaces, TRUE); gl.glColor3fv(View.CLIP_PLANE_COLOR, 0); --- 827,834 ---- gl.glEnd(); if (clipplane.isActive()) { ! if (!clipplane.isOnlyLines()) { ! Collection<Surface> surfaces = clipplane.getSilhouette().getSurfaces(); ! paintSurfaces(surfaces, TRUE); ! } gl.glColor3fv(View.CLIP_PLANE_COLOR, 0); |
From: Michael L. <he...@us...> - 2008-10-08 10:27:42
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24813/src/net/sourceforge/bprocessor/model Modified Files: Edge.java ClippingPlane.java SurfaceAnalysis.java Space.java Plane.java Log Message: Clippingplane improved Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.234 retrieving revision 1.235 diff -C2 -d -r1.234 -r1.235 *** Space.java 7 Apr 2008 11:20:31 -0000 1.234 --- Space.java 8 Oct 2008 10:26:39 -0000 1.235 *************** *** 416,420 **** @Override public String toString() { ! return "[" + getLevelString() + " " + getName() + "]"; } --- 416,420 ---- @Override public String toString() { ! return "[" + getLevelString() + " " + getDisplayName() + "]"; } *************** *** 664,667 **** --- 664,670 ---- return Project.getInstance().getName(); } else { + if (this.isVoid()) { + return "empty"; + } String lvl = getKindName(); if (lvl == null) { Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClippingPlane.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** ClippingPlane.java 18 Sep 2008 10:43:14 -0000 1.34 --- ClippingPlane.java 8 Oct 2008 10:26:39 -0000 1.35 *************** *** 43,46 **** --- 43,48 ---- /** To make a visual slice */ private boolean slice = false; + + private boolean onlyLines = true; /** *************** *** 275,278 **** --- 277,296 ---- this.isActive = isActive; } + + /** + * + * @return only lines + */ + public boolean isOnlyLines() { + return onlyLines; + } + + /** + * + * @param value new value + */ + public void setOnlyLines(boolean value) { + onlyLines = value; + } /** {@inheritDoc} */ *************** *** 295,298 **** --- 313,321 ---- res.add(new Attribute("isSlice", Boolean.FALSE)); } + if (isOnlyLines()) { + res.add(new Attribute("Only Lines", Boolean.TRUE)); + } else { + res.add(new Attribute("Only Lines", Boolean.FALSE)); + } res.add(new Attribute("Flip", Boolean.FALSE)); return res; *************** *** 320,323 **** --- 343,348 ---- } else if (a.getName().equals("isSlice")) { setSlice(((Boolean)a.getValue()).booleanValue()); + } else if (a.getName().equals("Only Lines")) { + setOnlyLines(((Boolean)a.getValue()).booleanValue()); } else if (a.getName().equals("Flip")) { if ((Boolean)a.getValue() == Boolean.TRUE) { Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** Edge.java 21 Jan 2008 13:37:25 -0000 1.108 --- Edge.java 8 Oct 2008 10:26:39 -0000 1.109 *************** *** 289,296 **** */ public boolean equivalent(Edge other) { ! if (other.getFrom() == from && other.getTo() == to) { return true; } ! if (other.getFrom() == to && other.getTo() == from) { return true; } --- 289,296 ---- */ public boolean equivalent(Edge other) { ! if (other.from.equalEps(from) && other.to.equalEps(to)) { return true; } ! if (other.to.equalEps(from) && other.from.equalEps(to)) { return true; } Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Plane.java 18 Sep 2008 10:43:14 -0000 1.36 --- Plane.java 8 Oct 2008 10:26:39 -0000 1.37 *************** *** 16,19 **** --- 16,21 ---- import java.util.Map; + import net.sourceforge.bprocessor.model.SurfaceAnalysis.EdgeStructure; + import org.apache.log4j.Logger; *************** *** 233,236 **** --- 235,247 ---- Map map = new HashMap(); Map<Edge, Entry> planar = new HashMap(); + for (Space current : input.elements()) { + if (!current.isVoid()) { + Space element = current.shallowCopy(); + map.put(current, element); + silhouette.add(element); + } else { + map.put(current, silhouette.getEmpty()); + } + } for (Edge current : input.edges()) { if (contains(current)) { *************** *** 249,252 **** --- 260,271 ---- entry.surfaces().add(current); } + Surface surface = (Surface) current.copy(map); + silhouette.insert(surface); + Space front = current.getFrontDomain(); + front = (Space) map.get(front); + Space back = current.getBackDomain(); + back = (Space) map.get(back); + surface.setFrontDomain((Container) front); + surface.setBackDomain((Container) back); } else { { *************** *** 320,412 **** CoordinateSystem system = coordinateSystem(); SurfaceAnalysis analysis = new SurfaceAnalysis(); - analysis.surfaceAnalysis(silhouette, coordinateSystem(), silhouette.getEdges()); ! { ! List<Vertex> vertices = new LinkedList(silhouette.getVertices()); ! system.translateIt(vertices); ! ! for (Entry current : entries) { ! current.order(); ! } ! ! { ! Iterator<Entry> iter = entries.iterator(); ! while (iter.hasNext()) { ! Entry current = iter.next(); ! if (current.ignore()) { ! iter.remove(); ! } ! } ! } ! ! final Comparator<Entry> compareY = new Comparator<Entry> () { ! public int compare(Entry left, Entry right) { ! if (left.y0 < right.y0) { ! return -1; ! } else if (left.y0 > right.y0) { ! return 1; ! } else { ! return 0; ! } ! } ! }; ! ! final Comparator<Entry> compareX = new Comparator<Entry> () { ! public int compare(Entry left, Entry right) { ! if (left.x < right.x) { ! return -1; ! } else if (left.x > right.x) { ! return 1; ! } else { ! return 0; ! } ! } ! }; ! ! Collections.sort(entries, compareY); ! ! ! Iterator<Entry> iterator = entries.iterator(); ! Entry next = iterator.next(); ! List<Entry> active = new LinkedList(); ! ! while (next != null) { ! double y = next.y0; ! // weed ! { ! Iterator<Entry> iter = active.iterator(); ! while (iter.hasNext()) { ! Entry current = iter.next(); ! if (current.y1 >= y) { ! iter.remove(); ! } ! } ! } ! // insert ! { ! while (next != null && next.y0 == y) { ! active.add(next); ! if (iterator.hasNext()) { ! next = iterator.next(); ! } else { ! next = null; ! } ! } ! } ! // intersection ! { ! Iterator<Entry> iter = active.iterator(); ! while (iter.hasNext()) { ! Entry current = iter.next(); ! current.findIntersectingX(y); ! } ! } ! // sort ! Collections.sort(active, compareX); ! // scan ! } ! ! system.unTranslateIt(vertices); ! } return silhouette; } --- 339,346 ---- CoordinateSystem system = coordinateSystem(); SurfaceAnalysis analysis = new SurfaceAnalysis(); ! EdgeStructure structure = analysis.new EdgeStructure(silhouette, system, silhouette.getEdges()); ! structure.surfaceAnalysis(silhouette.getEdges()); ! return silhouette; } Index: SurfaceAnalysis.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SurfaceAnalysis.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** SurfaceAnalysis.java 30 Sep 2008 13:20:46 -0000 1.17 --- SurfaceAnalysis.java 8 Oct 2008 10:26:39 -0000 1.18 *************** *** 280,283 **** --- 280,293 ---- private CoordinateSystem system; + + /** + * + * @param edge Edge + * @return EdgeNode + */ + public EdgeNode getEdgeNode(Edge edge) { + return emap.get(edge); + } + private List<Edge> rightContour(EdgeNode start) { List<Edge> edges = new LinkedList(); *************** *** 507,511 **** } ! private Collection<Surface> surfaceAnalysis(Collection<Edge> start) { Set<Surface> added = new HashSet(); Set<Surface> removed = new HashSet(); --- 517,526 ---- } ! /** ! * ! * @param start Collection of Edges ! * @return Collection of Surfaces ! */ ! public Collection<Surface> surfaceAnalysis(Collection<Edge> start) { Set<Surface> added = new HashSet(); Set<Surface> removed = new HashSet(); |
From: Michael L. <he...@us...> - 2008-09-30 13:21:24
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9407/src/net/sourceforge/bprocessor/model Modified Files: SurfaceAnalysis.java Log Message: Refactored surfaceanalysis Index: SurfaceAnalysis.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SurfaceAnalysis.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** SurfaceAnalysis.java 11 Jan 2008 09:22:08 -0000 1.16 --- SurfaceAnalysis.java 30 Sep 2008 13:20:46 -0000 1.17 *************** *** 22,26 **** public class SurfaceAnalysis { private static final boolean VERBOSE = false; ! /** * --- 22,26 ---- public class SurfaceAnalysis { private static final boolean VERBOSE = false; ! /** * *************** *** 37,41 **** return false; } ! /** * --- 37,41 ---- return false; } ! /** * *************** *** 58,62 **** return false; } ! /** * Remove all coordinatesystems from space --- 58,62 ---- return false; } ! /** * Remove all coordinatesystems from space *************** *** 69,74 **** } } ! ! /** * --- 69,74 ---- } } ! ! /** * *************** *** 79,83 **** return planeAnalysis(space, space.getEdges()); } ! /** * @param space Space --- 79,83 ---- return planeAnalysis(space, space.getEdges()); } ! /** * @param space Space *************** *** 93,99 **** { Collection<Vertex> vertices = space.getVertices(); ! Map<Vertex, List<Edge>> edgemap = space.getEdgeMap(vertices); ! for (Edge current : edges) { List<Edge> incident = new LinkedList(); --- 93,99 ---- { Collection<Vertex> vertices = space.getVertices(); ! Map<Vertex, List<Edge>> edgemap = space.getEdgeMap(vertices); ! for (Edge current : edges) { List<Edge> incident = new LinkedList(); *************** *** 144,148 **** return systems; } ! /** * Clear surfaces in specified space --- 144,148 ---- return systems; } ! /** * Clear surfaces in specified space *************** *** 155,159 **** } } ! /** * Find surfaces in the space starting with the --- 155,159 ---- } } ! /** * Find surfaces in the space starting with the *************** *** 174,178 **** return added; } ! /** * Find surfaces in specified space --- 174,178 ---- return added; } ! /** * Find surfaces in specified space *************** *** 185,435 **** } } ! /** - * Find surfaces in specified space that lies in the specified - * coordinatesystem * @param space Space ! * @param system CoordinateSystem ! * @param start collection of edges ! * @return collection of Surfaces */ public Collection<Surface> surfaceAnalysis(Container space, CoordinateSystem system, Collection<Edge> start) { ! ! if (VERBOSE) { ! System.out.println(" plane " + system.getN()); ! } ! ! Plane plane = system.plane(); ! Map<Vertex, VertexNode> vmap = new LinkedHashMap(); ! Map<Edge, EdgeNode> emap = new LinkedHashMap(); ! { ! List<Vertex> vertices = new LinkedList(space.getVertices()); ! Entity.sort(vertices); ! for (Vertex current : vertices) { ! if (plane.contains(current)) { ! vmap.put(current, new VertexNode(current)); ! } ! } ! } ! { ! List<Edge> edges = new LinkedList(space.getEdges()); ! Entity.sort(edges); ! for (Edge current : edges) { ! VertexNode from = vmap.get(current.getFrom()); ! VertexNode to = vmap.get(current.getTo()); ! if (from != null && to != null) { ! EdgeNode node = new EdgeNode(current, from, to); ! emap.put(current, node); ! from.add(node); ! to.add(node); ! } ! } ! } ! for (VertexNode current : vmap.values()) { ! current.sort(system); ! } ! { ! Set<Edge> keys = emap.keySet(); ! Collection<Surface> surfaces = space.getSurfaces(); ! for (Surface current : surfaces) { ! if (keys.containsAll(current.getEdges())) { ! int direction = Surface.direction(current.getEdges(), system); ! if (direction == Surface.RIGHT) { ! VertexNode from = vmap.get(current.getFirstVertex()); ! for (Edge edge : current.getEdges()) { ! EdgeNode node = emap.get(edge); ! VertexNode to = node.other(from); ! node.addRight(to, current); ! from = to; ! } ! } ! if (direction == Surface.LEFT) { ! VertexNode from = (VertexNode) vmap.get(current.getFirstVertex()); ! for (Edge edge : current.getEdges()) { ! EdgeNode node = (EdgeNode) emap.get(edge); ! VertexNode to = node.other(from); ! node.addLeft(to, current); ! from = to; ! } ! } ! } ! } ! } ! Set<Surface> added = new HashSet(); ! Set<Surface> removed = new HashSet(); ! for (Edge current : start) { ! if (emap.containsKey(current)) { ! EdgeNode node = emap.get(current); ! surfaceAnalysis(node, system, added, removed); ! } ! } ! for (Surface current : removed) { ! current.delete(); ! } ! for (Surface current : added) { ! space.add(current); ! } ! return added; ! } ! ! private List<Edge> rightContour(EdgeNode start) { ! List<Edge> edges = new LinkedList(); ! VertexNode to = start.to; ! EdgeNode current = start; ! EdgeNode next = null; ! while (next != start) { ! edges.add(current.edge); ! next = current.succ(to); ! if (next.left == next.right) { ! next = next.succ(to); ! } ! to = next.other(to); ! current = next; ! } ! return edges; ! } ! ! private List<Edge> leftContour(EdgeNode start) { ! List<Edge> edges = new LinkedList(); ! VertexNode to = start.to; ! EdgeNode current = start; ! EdgeNode next = null; ! while (next != start) { ! edges.add(current.edge); ! next = current.pred(to); ! if (next.left == next.right) { ! next = next.pred(to); ! } ! to = next.other(to); ! current = next; ! } ! return edges; ! } ! ! private boolean isVoid(Space space) { ! if (space != null) { ! return space.isVoid(); ! } else { ! return true; ! } ! } ! ! private void assign(Surface surface, Collection<Surface> surfaces) { ! if (VERBOSE) { ! System.out.println(" assign " + surface); ! for (Surface current : surfaces) { ! String name = current.getName(); ! Space front = current.getFrontDomain(); ! Space back = current.getBackDomain(); ! String desc = "[" + name + " " + front + " | " + back + "]"; ! System.out.println(" " + desc); ! } ! } ! ! Container back = null; ! Material backmaterial = null; ! Container front = null; ! Material frontmaterial = null; ! Vertex n1 = surface.normal(); ! for (Surface other : surfaces) { ! Vertex n2 = other.normal(); ! if (n1.dot(n2) > 0) { ! if (isVoid(back)) { ! back = other.getBackDomain(); ! backmaterial = other.getBackMaterial(); ! } ! if (isVoid(front)) { ! front = other.getFrontDomain(); ! frontmaterial = other.getFrontMaterial(); ! } ! } else { ! if (isVoid(back)) { ! back = other.getFrontDomain(); ! backmaterial = other.getFrontMaterial(); ! } ! if (isVoid(front)) { ! front = other.getBackDomain(); ! frontmaterial = other.getBackMaterial(); ! } ! } ! } ! if (VERBOSE) { ! System.out.println(" " + front + " | " + back); ! } ! surface.setBackDomain(back); ! surface.setBackMaterial(backmaterial); ! surface.setFrontDomain(front); ! surface.setFrontMaterial(frontmaterial); ! } ! ! private boolean marked(SurfaceNode node) { ! if (node == null) { ! return false; ! } else { ! return node.mark; ! } ! } ! ! private void surfaceAnalysis (EdgeNode start, CoordinateSystem system, ! Set<Surface> added, Set<Surface> removed) { ! if (!marked(start.left)) { ! if (VERBOSE) { ! System.out.println(" left-side " + start.edge); ! } ! ! SurfaceNode s = new SurfaceNode(); ! s.mark = true; ! VertexNode to = start.to; ! EdgeNode current = start; ! while (current.getLeft(to) != s) { ! s.consume(current.getLeft(to)); ! current.setLeft(to, s); ! current = current.pred(to); ! to = current.other(to); ! } ! if (start.left != start.right) { ! List<Edge> edges = leftContour(start); ! if (edges.size() > 2) { ! int turn = Surface.direction(edges, system); ! if (turn == Surface.LEFT) { ! Surface surface = new Surface(edges); ! assign(surface, s.surfaces); ! added.add(surface); ! removed.addAll(s.surfaces); ! } ! } ! } ! } ! if (!marked(start.right)) { ! if (VERBOSE) { ! System.out.println(" right-side " + start.edge); ! } ! ! SurfaceNode s = new SurfaceNode(); ! s.mark = true; ! VertexNode to = start.to; ! EdgeNode current = start; ! while (current.getRight(to) != s) { ! s.consume(current.getRight(to)); ! current.setRight(to, s); ! current = current.succ(to); ! to = current.other(to); ! } ! if (start.right != start.left) { ! List<Edge> edges = rightContour(start); ! if (edges.size() > 2) { ! int turn = Surface.direction(edges, system); ! if (turn == Surface.RIGHT) { ! Surface surface = new Surface(edges); ! assign(surface, s.surfaces); ! added.add(surface); ! removed.addAll(s.surfaces); ! } ! } ! } ! } } ! /** * VertexNode --- 185,202 ---- } } ! ! /** * @param space Space ! * @param system CoordinteSystem ! * @param start Start list of edges ! * @return surfaces */ public Collection<Surface> surfaceAnalysis(Container space, CoordinateSystem system, Collection<Edge> start) { ! EdgeStructure structure = new EdgeStructure(space, system, start); ! return structure.surfaceAnalysis(start); } ! /** * VertexNode *************** *** 440,444 **** /** edges */ private List<EdgeNode> edges; ! /** * Constructor --- 207,211 ---- /** edges */ private List<EdgeNode> edges; ! /** * Constructor *************** *** 449,453 **** edges = new LinkedList(); } ! /** * Return vertex --- 216,220 ---- edges = new LinkedList(); } ! /** * Return vertex *************** *** 457,461 **** return vertex; } ! /** * --- 224,228 ---- return vertex; } ! /** * *************** *** 465,469 **** edges.add(edge); } ! /** * Sort edges --- 232,236 ---- edges.add(edge); } ! /** * Sort edges *************** *** 495,499 **** } } ! /** * @return String --- 262,266 ---- } } ! /** * @return String *************** *** 503,507 **** } } ! /** * EdgeNode --- 270,531 ---- } } ! ! /** ! * ! */ ! public class EdgeStructure { ! private Map<Vertex, VertexNode> vmap; ! private Map<Edge, EdgeNode> emap; ! private Container space; ! private CoordinateSystem system; ! ! private List<Edge> rightContour(EdgeNode start) { ! List<Edge> edges = new LinkedList(); ! VertexNode to = start.to; ! EdgeNode current = start; ! EdgeNode next = null; ! while (next != start) { ! edges.add(current.edge); ! next = current.succ(to); ! if (next.left == next.right) { ! next = next.succ(to); ! } ! to = next.other(to); ! current = next; ! } ! return edges; ! } ! ! private List<Edge> leftContour(EdgeNode start) { ! List<Edge> edges = new LinkedList(); ! VertexNode to = start.to; ! EdgeNode current = start; ! EdgeNode next = null; ! while (next != start) { ! edges.add(current.edge); ! next = current.pred(to); ! if (next.left == next.right) { ! next = next.pred(to); ! } ! to = next.other(to); ! current = next; ! } ! return edges; ! } ! ! private boolean isVoid(Space space) { ! if (space != null) { ! return space.isVoid(); ! } else { ! return true; ! } ! } ! ! private void assign(Surface surface, Collection<Surface> surfaces) { ! if (VERBOSE) { ! System.out.println(" assign " + surface); ! for (Surface current : surfaces) { ! String name = current.getName(); ! Space front = current.getFrontDomain(); ! Space back = current.getBackDomain(); ! String desc = "[" + name + " " + front + " | " + back + "]"; ! System.out.println(" " + desc); ! } ! } ! ! Container back = null; ! Material backmaterial = null; ! Container front = null; ! Material frontmaterial = null; ! Vertex n1 = surface.normal(); ! for (Surface other : surfaces) { ! Vertex n2 = other.normal(); ! if (n1.dot(n2) > 0) { ! if (isVoid(back)) { ! back = other.getBackDomain(); ! backmaterial = other.getBackMaterial(); ! } ! if (isVoid(front)) { ! front = other.getFrontDomain(); ! frontmaterial = other.getFrontMaterial(); ! } ! } else { ! if (isVoid(back)) { ! back = other.getFrontDomain(); ! backmaterial = other.getFrontMaterial(); ! } ! if (isVoid(front)) { ! front = other.getBackDomain(); ! frontmaterial = other.getBackMaterial(); ! } ! } ! } ! if (VERBOSE) { ! System.out.println(" " + front + " | " + back); ! } ! surface.setBackDomain(back); ! surface.setBackMaterial(backmaterial); ! surface.setFrontDomain(front); ! surface.setFrontMaterial(frontmaterial); ! } ! ! private boolean marked(SurfaceNode node) { ! if (node == null) { ! return false; ! } else { ! return node.mark; ! } ! } ! ! ! private void surfaceAnalysis (EdgeNode start, CoordinateSystem system, ! Set<Surface> added, Set<Surface> removed) { ! if (!marked(start.left)) { ! if (VERBOSE) { ! System.out.println(" left-side " + start.edge); ! } ! ! SurfaceNode s = new SurfaceNode(); ! s.mark = true; ! VertexNode to = start.to; ! EdgeNode current = start; ! while (current.getLeft(to) != s) { ! s.consume(current.getLeft(to)); ! current.setLeft(to, s); ! current = current.pred(to); ! to = current.other(to); ! } ! if (start.left != start.right) { ! List<Edge> edges = leftContour(start); ! if (edges.size() > 2) { ! int turn = Surface.direction(edges, system); ! if (turn == Surface.LEFT) { ! Surface surface = new Surface(edges); ! assign(surface, s.surfaces); ! added.add(surface); ! removed.addAll(s.surfaces); ! } ! } ! } ! } ! if (!marked(start.right)) { ! if (VERBOSE) { ! System.out.println(" right-side " + start.edge); ! } ! ! SurfaceNode s = new SurfaceNode(); ! s.mark = true; ! VertexNode to = start.to; ! EdgeNode current = start; ! while (current.getRight(to) != s) { ! s.consume(current.getRight(to)); ! current.setRight(to, s); ! current = current.succ(to); ! to = current.other(to); ! } ! if (start.right != start.left) { ! List<Edge> edges = rightContour(start); ! if (edges.size() > 2) { ! int turn = Surface.direction(edges, system); ! if (turn == Surface.RIGHT) { ! Surface surface = new Surface(edges); ! assign(surface, s.surfaces); ! added.add(surface); ! removed.addAll(s.surfaces); ! } ! } ! } ! } ! } ! ! /** ! * ! * @param space Space ! * @param system CoordinateSystem ! * @param start List of edges ! */ ! public EdgeStructure(Container space, CoordinateSystem system, ! Collection<Edge> start) { ! this.space = space; ! this.system = system; ! Plane plane = system.plane(); ! vmap = new LinkedHashMap(); ! emap = new LinkedHashMap(); ! { ! List<Vertex> vertices = new LinkedList(space.getVertices()); ! Entity.sort(vertices); ! for (Vertex current : vertices) { ! if (plane.contains(current)) { ! vmap.put(current, new VertexNode(current)); ! } ! } ! } ! { ! List<Edge> edges = new LinkedList(space.getEdges()); ! Entity.sort(edges); ! for (Edge current : edges) { ! VertexNode from = vmap.get(current.getFrom()); ! VertexNode to = vmap.get(current.getTo()); ! if (from != null && to != null) { ! EdgeNode node = new EdgeNode(current, from, to); ! emap.put(current, node); ! from.add(node); ! to.add(node); ! } ! } ! } ! for (VertexNode current : vmap.values()) { ! current.sort(system); ! } ! { ! Set<Edge> keys = emap.keySet(); ! Collection<Surface> surfaces = space.getSurfaces(); ! for (Surface current : surfaces) { ! if (keys.containsAll(current.getEdges())) { ! int direction = Surface.direction(current.getEdges(), system); ! if (direction == Surface.RIGHT) { ! VertexNode from = vmap.get(current.getFirstVertex()); ! for (Edge edge : current.getEdges()) { ! EdgeNode node = emap.get(edge); ! VertexNode to = node.other(from); ! node.addRight(to, current); ! from = to; ! } ! } ! if (direction == Surface.LEFT) { ! VertexNode from = (VertexNode) vmap.get(current.getFirstVertex()); ! for (Edge edge : current.getEdges()) { ! EdgeNode node = (EdgeNode) emap.get(edge); ! VertexNode to = node.other(from); ! node.addLeft(to, current); ! from = to; ! } ! } ! } ! } ! } ! } ! ! private Collection<Surface> surfaceAnalysis(Collection<Edge> start) { ! Set<Surface> added = new HashSet(); ! Set<Surface> removed = new HashSet(); ! for (Edge current : start) { ! if (emap.containsKey(current)) { ! EdgeNode node = emap.get(current); ! surfaceAnalysis(node, system, added, removed); ! } ! } ! for (Surface current : removed) { ! current.delete(); ! } ! for (Surface current : added) { ! space.add(current); ! } ! return added; ! ! ! } ! } ! /** * EdgeNode *************** *** 526,530 **** /** right surface */ private SurfaceNode right; ! /** * --- 550,554 ---- /** right surface */ private SurfaceNode right; ! /** * *************** *** 538,542 **** this.to = to; } ! /** * --- 562,566 ---- this.to = to; } ! /** * *************** *** 553,557 **** return null; } ! /** * --- 577,581 ---- return null; } ! /** * *************** *** 568,572 **** return null; } ! /** * --- 592,596 ---- return null; } ! /** * *************** *** 583,587 **** return null; } ! /** * --- 607,611 ---- return null; } ! /** * *************** *** 598,602 **** return null; } ! /** * @param end VertexNode --- 622,626 ---- return null; } ! /** * @param end VertexNode *************** *** 611,615 **** } } ! /** * --- 635,639 ---- } } ! /** * *************** *** 626,630 **** return null; } ! /** * --- 650,654 ---- return null; } ! /** * *************** *** 640,644 **** } } ! /** * --- 664,668 ---- } } ! /** * *************** *** 655,659 **** } } ! /** * --- 679,683 ---- } } ! /** * *************** *** 670,674 **** } } ! /** * @return String --- 694,698 ---- } } ! /** * @return String *************** *** 676,687 **** public String toString() { return "{" + edge.getName() ! + " fp:" + ((fromPred == null) ? "nil" : fromPred.edge.getName()) ! + " fs:" + ((fromSucc == null) ? "nil" : fromSucc.edge.getName()) ! + " tp:" + ((toPred == null) ? "nil" : toPred.edge.getName()) ! + " ts:" + ((toSucc == null) ? "nil" : toSucc.edge.getName()) + "}"; } } ! /** * SurfaceNode --- 700,711 ---- public String toString() { return "{" + edge.getName() ! + " fp:" + ((fromPred == null) ? "nil" : fromPred.edge.getName()) ! + " fs:" + ((fromSucc == null) ? "nil" : fromSucc.edge.getName()) ! + " tp:" + ((toPred == null) ? "nil" : toPred.edge.getName()) ! + " ts:" + ((toSucc == null) ? "nil" : toSucc.edge.getName()) + "}"; } } ! /** * SurfaceNode *************** *** 699,708 **** */ private Set<Surface> surfaces; ! /** * Mark used while visiting all sides of adjacent edges. */ private boolean mark; ! /** * Constructs this SurfaceNode with an empty set of surfaces --- 723,732 ---- */ private Set<Surface> surfaces; ! /** * Mark used while visiting all sides of adjacent edges. */ private boolean mark; ! /** * Constructs this SurfaceNode with an empty set of surfaces *************** *** 724,728 **** mark = false; } ! /** * Adds the surfaces from another SurfaceNode to the set of --- 748,752 ---- mark = false; } ! /** * Adds the surfaces from another SurfaceNode to the set of *************** *** 736,740 **** } } ! /** * Adds the surface to the set of surfaces of this SurfaceNode. --- 760,764 ---- } } ! /** * Adds the surface to the set of surfaces of this SurfaceNode. *************** *** 744,748 **** surfaces.add(surface); } ! /** * {@inheritDoc} --- 768,772 ---- surfaces.add(surface); } ! /** * {@inheritDoc} |
From: Michael L. <he...@us...> - 2008-09-18 10:43:04
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26404/src/net/sourceforge/bprocessor/model Modified Files: ClippingPlane.java Plane.java Log Message: Clipping plane improvement Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClippingPlane.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** ClippingPlane.java 10 Sep 2008 22:53:44 -0000 1.33 --- ClippingPlane.java 18 Sep 2008 10:43:14 -0000 1.34 *************** *** 8,16 **** import java.util.Collection; - import java.util.HashMap; import java.util.Iterator; import java.util.ArrayList; import java.util.List; - import java.util.Map; import java.util.Set; import java.util.HashSet; --- 8,14 ---- *************** *** 190,227 **** } - private Container calculateSilhouette(Mesh input) { - Container silhouette = new Container("Section", Space.CONSTRUCTION, true); - Plane plane = getPlane(); - Map map = new HashMap(); - Map<Edge, Surface> e2s = new HashMap(); - for (Edge current : input.edges()) { - if (plane.contains(current)) { - Edge edge = (Edge) current.copy(map); - silhouette.insert(edge); - } - } - for (Surface current : input.surfaces()) { - Collection<Edge> contour = current.getEdges(); - Vertex from = null; - for (Edge edge : contour) { - Vertex vertex = plane.intersection(edge); - if (vertex != null) { - if (from != null) { - Edge line = new Edge(from, vertex); - line.setStrippled(true); - line = silhouette.insert(line); - e2s.put(line, current); - from = null; - } else { - from = vertex; - } - } - } - } - SurfaceAnalysis analysis = new SurfaceAnalysis(); - analysis.surfaceAnalysis(silhouette, plane.coordinateSystem(), silhouette.getEdges()); - return silhouette; - } - /** * Returns the silhouette --- 188,191 ---- *************** *** 232,236 **** Container space = Project.getInstance().getActiveSpace(); Mesh input = space.mesh(); ! silhouette = calculateSilhouette(input); } return silhouette; --- 196,201 ---- Container space = Project.getInstance().getActiveSpace(); Mesh input = space.mesh(); ! Plane plane = getPlane(); ! silhouette = plane.intersection(input); } return silhouette; Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Plane.java 11 Dec 2007 14:49:02 -0000 1.35 --- Plane.java 18 Sep 2008 10:43:14 -0000 1.36 *************** *** 8,12 **** --- 8,18 ---- import java.util.Collection; + import java.util.Collections; + import java.util.Comparator; + import java.util.HashMap; import java.util.Iterator; + import java.util.LinkedList; + import java.util.List; + import java.util.Map; import org.apache.log4j.Logger; *************** *** 218,221 **** --- 224,473 ---- /** + * Calculates the intersection between the input geometry and this Plane + * @param input Geometry in the form of a Mesh + * @return intersection in the form of a Container + */ + public Container intersection(Mesh input) { + Container silhouette = new Container("Section", Space.CONSTRUCTION, true); + List<Entry> entries = new LinkedList(); + Map map = new HashMap(); + Map<Edge, Entry> planar = new HashMap(); + for (Edge current : input.edges()) { + if (contains(current)) { + Edge edge = (Edge) current.copy(map); + silhouette.insert(edge); + Entry entry = new Entry(edge, Entry.PLANAR); + entries.add(entry); + planar.put(current, entry); + } + } + for (Surface current : input.surfaces()) { + Collection<Edge> contour = current.getEdges(); + if (planar.keySet().containsAll(contour)) { + for (Edge edge : contour) { + Entry entry = planar.get(edge); + entry.surfaces().add(current); + } + } else { + { + LinkedList<Vertex> intersections = new LinkedList(); + Vertex from = current.getFirstVertex(); + Vertex to = null; + for (Edge edge : contour) { + to = edge.otherVertex(from); + if (contains(from)) { + intersections.add(from); + } else if (!contains(to)) { + Vertex intersection = intersection(edge); + if (intersection != null) { + intersections.add(intersection); + } + } + from = to; + } + + if (intersections.size() > 1) { + { + final Vertex leader = intersections.getFirst(); + Vertex last = intersections.getLast(); + final Vertex direction = last.minus(leader); + + Comparator<Vertex> compare = new Comparator<Vertex>() { + public double distance(Vertex vertex) { + Vertex delta = vertex.minus(leader); + double distance = delta.length(); + double dot = direction.dot(delta); + if (dot < 0) { + distance = -distance; + } + return distance; + } + public int compare(Vertex o1, Vertex o2) { + double d1 = distance(o1); + double d2 = distance(o2); + if (d1 < d2) { + return -1; + } else if (d1 > d2) { + return 1; + } else { + return 0; + } + } + }; + + Collections.sort(intersections, compare); + + Vertex previous = null; + for (Vertex vertex : intersections) { + if (previous != null) { + Edge line = new Edge(previous, vertex); + if (silhouette.findEdge(line) == null) { + line.setStrippled(true); + silhouette.insert(line); + Entry entry = new Entry(line, Entry.INTERSECTION); + entries.add(entry); + entry.surfaces().add(current); + } + } + previous = vertex; + } + } + } + } + } + } + + CoordinateSystem system = coordinateSystem(); + SurfaceAnalysis analysis = new SurfaceAnalysis(); + analysis.surfaceAnalysis(silhouette, coordinateSystem(), silhouette.getEdges()); + + { + List<Vertex> vertices = new LinkedList(silhouette.getVertices()); + system.translateIt(vertices); + + for (Entry current : entries) { + current.order(); + } + + { + Iterator<Entry> iter = entries.iterator(); + while (iter.hasNext()) { + Entry current = iter.next(); + if (current.ignore()) { + iter.remove(); + } + } + } + + final Comparator<Entry> compareY = new Comparator<Entry> () { + public int compare(Entry left, Entry right) { + if (left.y0 < right.y0) { + return -1; + } else if (left.y0 > right.y0) { + return 1; + } else { + return 0; + } + } + }; + + final Comparator<Entry> compareX = new Comparator<Entry> () { + public int compare(Entry left, Entry right) { + if (left.x < right.x) { + return -1; + } else if (left.x > right.x) { + return 1; + } else { + return 0; + } + } + }; + + Collections.sort(entries, compareY); + + + Iterator<Entry> iterator = entries.iterator(); + Entry next = iterator.next(); + List<Entry> active = new LinkedList(); + + while (next != null) { + double y = next.y0; + // weed + { + Iterator<Entry> iter = active.iterator(); + while (iter.hasNext()) { + Entry current = iter.next(); + if (current.y1 >= y) { + iter.remove(); + } + } + } + // insert + { + while (next != null && next.y0 == y) { + active.add(next); + if (iterator.hasNext()) { + next = iterator.next(); + } else { + next = null; + } + } + } + // intersection + { + Iterator<Entry> iter = active.iterator(); + while (iter.hasNext()) { + Entry current = iter.next(); + current.findIntersectingX(y); + } + } + // sort + Collections.sort(active, compareX); + // scan + } + + system.unTranslateIt(vertices); + } + return silhouette; + } + + private class Entry { + public static final int PLANAR = 0; + public static final int INTERSECTION = 1; + + + private Edge edge; + private int kind; + private List<Surface> surfaces; + private double x; + private double y0; + private double y1; + private double x0; + private double x1; + + public Entry(Edge edge, int kind) { + this.edge = edge; + this.kind = kind; + surfaces = new LinkedList(); + } + + public List<Surface> surfaces() { + return surfaces; + } + + public boolean eq(double a, double b) { + return Math.abs(a - b) < 0.0000001; + } + + public boolean ignore() { + return eq(y0, y1); + } + + public void order() { + if (edge.from.y < edge.to.y) { + y0 = edge.from.y; + x0 = edge.from.x; + y1 = edge.to.y; + x1 = edge.from.x; + } else { + y0 = edge.to.y; + x0 = edge.to.x; + y1 = edge.from.y; + x1 = edge.to.x; + } + } + + public void findIntersectingX(double y) { + double dx = x1 - x0; + double dy = y1 - y0; + x = x1 + ((y - y0 / dy)) * dx; + } + + public String toString() { + return "{" + edge + " " + y0 + " " + y1 + "}"; + } + } + + /** * Return the projection of the vertex into this Plane * @param vertex Vertex |
From: Michael L. <he...@us...> - 2008-09-18 10:42:59
|
Update of /cvsroot/bprocessor/bprocessor/src/etc/clip In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26373/src/etc/clip Added Files: clip.xml Log Message: Clipping plane improvement --- NEW FILE: clip.xml --- <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <bmodel> <active>1</active> <cs>80</cs> <name>new project</name> <space name="World" type="1" union="false" voidref="2" net="false" transparent="true" progid="0" id="1"> <description/> <Classification>unassigned</Classification> <constructor xsi:type="CoordinateSystemType" onlyplane="false" active="true" editable="true" progid="1" id="80" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <vertex z="0.0" x="0.0" y="0.0" id="81"/> <ijn> <vertex z="0.0" x="1.0" y="0.0" id="77"/> <vertex z="0.0" x="0.0" y="1.0" id="78"/> <vertex z="1.0" x="0.0" y="0.0" id="79"/> </ijn> </constructor> <space name="Void" type="1" union="false" net="false" transparent="true" progid="1" id="2"> <description/> <Classification>unassigned</Classification> <boundary>3</boundary> <boundary>4</boundary> <boundary>5</boundary> <boundary>6</boundary> <boundary>7</boundary> <boundary>8</boundary> <boundary>9</boundary> <boundary>10</boundary> <boundary>11</boundary> <boundary>12</boundary> <boundary>13</boundary> <boundary>14</boundary> <boundary>15</boundary> <boundary>16</boundary> </space> <surface progid="27" id="3"> <edgeref>21</edgeref> <edgeref>26</edgeref> <edgeref>25</edgeref> <edgeref>19</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="31" id="4"> <edgeref>17</edgeref> <edgeref>18</edgeref> <edgeref>19</edgeref> <edgeref>20</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="53" id="5"> <edgeref>37</edgeref> <edgeref>44</edgeref> <edgeref>42</edgeref> <edgeref>38</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="58" id="6"> <edgeref>29</edgeref> <edgeref>27</edgeref> <edgeref>22</edgeref> <edgeref>28</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="59" id="7"> <edgeref>38</edgeref> <edgeref>40</edgeref> <edgeref>30</edgeref> <edgeref>39</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="60" id="8"> <edgeref>41</edgeref> <edgeref>44</edgeref> <edgeref>43</edgeref> <edgeref>29</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="66" id="9"> <edgeref>45</edgeref> <edgeref>51</edgeref> <edgeref>36</edgeref> <edgeref>47</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="67" id="10"> <edgeref>45</edgeref> <edgeref>50</edgeref> <edgeref>46</edgeref> <edgeref>52</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="68" id="11"> <edgeref>46</edgeref> <edgeref>48</edgeref> <edgeref>33</edgeref> <edgeref>49</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="69" id="12"> <edgeref>36</edgeref> <edgeref>34</edgeref> <edgeref>26</edgeref> <edgeref>35</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="71" id="13"> <edgeref>33</edgeref> <edgeref>32</edgeref> <edgeref>30</edgeref> <edgeref>31</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="76" id="14"> <edgeref>23</edgeref> <edgeref>27</edgeref> <edgeref>43</edgeref> <edgeref>37</edgeref> <edgeref>40</edgeref> <edgeref>32</edgeref> <edgeref>49</edgeref> <edgeref>50</edgeref> <edgeref>51</edgeref> <edgeref>34</edgeref> <edgeref>25</edgeref> <edgeref>20</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="77" id="15"> <edgeref>23</edgeref> <edgeref>22</edgeref> <edgeref>24</edgeref> <edgeref>17</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="78" id="16"> <edgeref>47</edgeref> <edgeref>52</edgeref> <edgeref>48</edgeref> <edgeref>31</edgeref> <edgeref>39</edgeref> <edgeref>42</edgeref> <edgeref>41</edgeref> <edgeref>28</edgeref> <edgeref>24</edgeref> <edgeref>18</edgeref> <edgeref>21</edgeref> <edgeref>35</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <edge smooth="false" constructor="false" progid="28" id="17"> <from>54</from> <to>56</to> </edge> <edge smooth="false" constructor="false" progid="29" id="18"> <from>56</from> <to>55</to> </edge> <edge smooth="false" constructor="false" progid="30" id="19"> <from>55</from> <to>53</to> </edge> <edge smooth="false" constructor="false" progid="31" id="20"> <from>53</from> <to>54</to> </edge> <edge smooth="false" constructor="false" progid="32" id="21"> <from>55</from> <to>59</to> </edge> <edge smooth="false" constructor="false" progid="34" id="22"> <from>58</from> <to>57</to> </edge> <edge smooth="false" constructor="false" progid="35" id="23"> <from>54</from> <to>58</to> </edge> <edge smooth="false" constructor="false" progid="36" id="24"> <from>56</from> <to>57</to> </edge> <edge smooth="false" constructor="false" progid="37" id="25"> <from>53</from> <to>60</to> </edge> <edge smooth="false" constructor="false" progid="38" id="26"> <from>59</from> <to>60</to> </edge> <edge smooth="false" constructor="false" progid="41" id="27"> <from>61</from> <to>58</to> </edge> <edge smooth="false" constructor="false" progid="42" id="28"> <from>57</from> <to>62</to> </edge> <edge smooth="false" constructor="false" progid="44" id="29"> <from>62</from> <to>61</to> </edge> <edge smooth="false" constructor="false" progid="49" id="30"> <from>64</from> <to>63</to> </edge> <edge smooth="false" constructor="false" progid="50" id="31"> <from>64</from> <to>65</to> </edge> <edge smooth="false" constructor="false" progid="53" id="32"> <from>66</from> <to>63</to> </edge> <edge smooth="false" constructor="false" progid="54" id="33"> <from>65</from> <to>66</to> </edge> <edge smooth="false" constructor="false" progid="55" id="34"> <from>60</from> <to>67</to> </edge> <edge smooth="false" constructor="false" progid="58" id="35"> <from>68</from> <to>59</to> </edge> <edge smooth="false" constructor="false" progid="59" id="36"> <from>68</from> <to>67</to> </edge> <edge smooth="false" constructor="false" progid="68" id="37"> <from>70</from> <to>71</to> </edge> <edge smooth="false" constructor="false" progid="69" id="38"> <from>72</from> <to>70</to> </edge> <edge smooth="false" constructor="false" progid="70" id="39"> <from>64</from> <to>72</to> </edge> <edge smooth="false" constructor="false" progid="71" id="40"> <from>63</from> <to>70</to> </edge> <edge smooth="false" constructor="false" progid="72" id="41"> <from>62</from> <to>69</to> </edge> <edge smooth="false" constructor="false" progid="73" id="42"> <from>69</from> <to>72</to> </edge> <edge smooth="false" constructor="false" progid="74" id="43"> <from>61</from> <to>71</to> </edge> <edge smooth="false" constructor="false" progid="75" id="44"> <from>71</from> <to>69</to> </edge> <edge smooth="false" constructor="false" progid="76" id="45"> <from>73</from> <to>75</to> </edge> <edge smooth="false" constructor="false" progid="77" id="46"> <from>74</from> <to>76</to> </edge> <edge smooth="false" constructor="false" progid="78" id="47"> <from>68</from> <to>73</to> </edge> <edge smooth="false" constructor="false" progid="79" id="48"> <from>65</from> <to>76</to> </edge> <edge smooth="false" constructor="false" progid="80" id="49"> <from>66</from> <to>74</to> </edge> <edge smooth="false" constructor="false" progid="81" id="50"> <from>75</from> <to>74</to> </edge> <edge smooth="false" constructor="false" progid="82" id="51"> <from>67</from> <to>75</to> </edge> <edge smooth="false" constructor="false" progid="83" id="52"> <from>76</from> <to>73</to> </edge> <vertex z="0.0" x="24.1726098927" y="5.1849290038" progid="15" id="53"/> <vertex z="0.0" x="4.8235526752" y="5.1849290038" progid="16" id="54"/> <vertex z="0.0" x="24.1726098927" y="15.1847544861" progid="17" id="55"/> <vertex z="0.0" x="4.8235526752" y="15.1847544861" progid="18" id="56"/> <vertex z="4.2018862618" x="4.8235526752" y="15.1847544861" progid="19" id="57"/> <vertex z="4.2018862618" x="4.8235526752" y="5.1849290038" progid="20" id="58"/> <vertex z="4.2018862618" x="24.1726098927" y="15.1847544861" progid="21" id="59"/> <vertex z="4.2018862618" x="24.1726098927" y="5.1849290038" progid="22" id="60"/> <vertex z="4.2018862618" x="8.1864137195" y="5.1849290038" progid="23" id="61"/> <vertex z="4.2018862618" x="8.1864137195" y="15.1847544861" progid="24" id="62"/> <vertex z="4.2018862618" x="12.004241304" y="5.1849290038" progid="25" id="63"/> <vertex z="4.2018862618" x="12.004241304" y="15.1847544861" progid="26" id="64"/> <vertex z="4.2018862618" x="16.7043991838" y="15.1847544861" progid="27" id="65"/> <vertex z="4.2018862618" x="16.7043991838" y="5.1849290038" progid="28" id="66"/> <vertex z="4.2018862618" x="21.0314897364" y="5.1849290038" progid="29" id="67"/> <vertex z="4.2018862618" x="21.0314897364" y="15.1847544861" progid="30" id="68"/> <vertex z="2.2416503521" x="8.1864137195" y="15.1847544861" progid="35" id="69"/> <vertex z="2.2416503521" x="12.004241304" y="5.1849290038" progid="36" id="70"/> <vertex z="2.2416503521" x="8.1864137195" y="5.1849290038" progid="37" id="71"/> <vertex z="2.2416503521" x="12.004241304" y="15.1847544861" progid="38" id="72"/> <vertex z="8.5875463854" x="21.0314897364" y="15.1847544861" progid="39" id="73"/> <vertex z="8.5875463854" x="16.7043991838" y="5.1849290038" progid="40" id="74"/> <vertex z="8.5875463854" x="21.0314897364" y="5.1849290038" progid="41" id="75"/> <vertex z="8.5875463854" x="16.7043991838" y="15.1847544861" progid="42" id="76"/> </space> <material name="Functional" B="0.9" R="0.9" G="0.9" id="82"/> <material name="Construction" B="0.7" R="0.96" G="0.87" id="83"/> <material name="Void" B="0.8035714" R="0.91071427" G="0.8142857" id="84"/> <view name="(Current)" id="85"> <scalefactor>0</scalefactor> <camera y="-15.403704087771667" z="18.03780883923955" x="15.528805977998537"/> <center y="10.577221135912419" z="3.93207415708883" x="14.673310601314089"/> <roll y="-0.241790851248723" z="0.9702957262759982" x="0.00796164700013602"/> <focalwidth>35.0</focalwidth> <type>6</type> </view> <global> <key>brick</key> <value xsi:type="DoubleType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <double>0.12</double> </value> </global> <global> <key>isolation</key> <value xsi:type="DoubleType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <double>0.1</double> </value> </global> <global> <key>pi</key> <value xsi:type="DoubleType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <double>3.141592653589793</double> </value> </global> <global> <key>roof</key> <value xsi:type="DoubleType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <double>0.07</double> </value> </global> <global> <key>wall</key> <value xsi:type="DoubleType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <double>0.15</double> </value> </global> </bmodel> |
From: Michael L. <he...@us...> - 2008-09-18 10:42:55
|
Update of /cvsroot/bprocessor/bprocessor/src/etc/clip In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26020/src/etc/clip Log Message: Directory /cvsroot/bprocessor/bprocessor/src/etc/clip added to the repository |
From: Michael L. <he...@us...> - 2008-09-10 22:53:40
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27099/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java Log Message: ClippingPlane improved Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** Display.java 9 Sep 2008 13:42:51 -0000 1.83 --- Display.java 10 Sep 2008 22:53:50 -0000 1.84 *************** *** 50,55 **** public class Display { private static final boolean TRUE = true; ! ! private static boolean initialized; private static boolean selecting; --- 50,55 ---- public class Display { private static final boolean TRUE = true; ! [...1382 lines suppressed...] ! if (!selecting()) { disableClipplanes(); *************** *** 1484,1490 **** translateToCoordinatesystem((Instance) active); } ! hilite(geometrics); ! if (active.isInstance()) { gl.glPopMatrix(); --- 1491,1497 ---- translateToCoordinatesystem((Instance) active); } ! hilite(geometrics); ! if (active.isInstance()) { gl.glPopMatrix(); Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.282 retrieving revision 1.283 diff -C2 -d -r1.282 -r1.283 *** View.java 9 Sep 2008 12:15:03 -0000 1.282 --- View.java 10 Sep 2008 22:53:50 -0000 1.283 *************** *** 669,673 **** pushName(gl, current); gl.glColor3fv(SELECTED_COLOR, 0); ! drawClipplane(current); popName(gl); gl.glEnable(GL.GL_DEPTH_TEST); --- 669,673 ---- pushName(gl, current); gl.glColor3fv(SELECTED_COLOR, 0); ! Display.draw(current); popName(gl); gl.glEnable(GL.GL_DEPTH_TEST); *************** *** 679,683 **** } pushName(gl, current); ! drawClipplane(current); popName(gl); } --- 679,683 ---- } pushName(gl, current); ! Display.draw(current); popName(gl); } *************** *** 1263,1295 **** /** - * Draw a clippingPlane - * @param clipplane The clipplane to draw - */ - private void drawClipplane(ClippingPlane clipplane) { - Collection<Vertex> corners = clipplane.getCorners(); - gl.glLineWidth(3.0f); - gl.glBegin(GL.GL_LINE_LOOP); - for (Vertex current : corners) { - gl.glVertex3d(current.getX(), - current.getY(), - current.getZ()); - } - gl.glEnd(); - if (clipplane.isActive()) { - gl.glLineWidth(1.5f); - Collection<Edge> lines = clipplane.getLines(); - for (Edge current : lines) { - if (current.getStrippled()) { - gl.glEnable(GL.GL_LINE_STIPPLE); - drawEdge(current); - gl.glDisable(GL.GL_LINE_STIPPLE); - } else { - drawEdge(current); - } - } - } - } - - /** * FIXME edge-drawing * Draw an Edge --- 1263,1266 ---- |
From: Michael L. <he...@us...> - 2008-09-10 22:53:37
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27090/src/net/sourceforge/bprocessor/model Modified Files: ClippingPlane.java Log Message: ClippingPlane improved Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClippingPlane.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** ClippingPlane.java 9 Sep 2008 14:03:09 -0000 1.32 --- ClippingPlane.java 10 Sep 2008 22:53:44 -0000 1.33 *************** *** 8,14 **** --- 8,16 ---- import java.util.Collection; + import java.util.HashMap; import java.util.Iterator; import java.util.ArrayList; import java.util.List; + import java.util.Map; import java.util.Set; import java.util.HashSet; *************** *** 33,37 **** /** The silhouette */ ! private ArrayList<Edge> silhouette; /** The plane of the ClippingPlane */ --- 35,39 ---- /** The silhouette */ ! private Container silhouette; /** The plane of the ClippingPlane */ *************** *** 40,47 **** /** If the ClippingPlane is on or off */ private boolean isActive; ! /** To make a visual slice */ private boolean slice = false; ! /** * The constructor --- 42,49 ---- /** If the ClippingPlane is on or off */ private boolean isActive; ! /** To make a visual slice */ private boolean slice = false; ! /** * The constructor *************** *** 52,60 **** this.isActive = true; this.plane = system.plane(); - this.silhouette = new ArrayList<Edge>(); this.corners = new ArrayList<Vertex>(); Project.getInstance().addObserver(this); } ! /** * Copy the ClippingPlane --- 54,61 ---- this.isActive = true; this.plane = system.plane(); this.corners = new ArrayList<Vertex>(); Project.getInstance().addObserver(this); } ! /** * Copy the ClippingPlane *************** *** 66,70 **** return copy; } ! /** * Getter for plan representing the ClippingPlane --- 67,71 ---- return copy; } ! /** * Getter for plan representing the ClippingPlane *************** *** 77,81 **** return plane; } ! /** * gets the center --- 78,82 ---- return plane; } ! /** * gets the center *************** *** 85,89 **** return system.getOrigin(); } ! /** * gets the normal of the ClippingPlane --- 86,90 ---- return system.getOrigin(); } ! /** * gets the normal of the ClippingPlane *************** *** 93,97 **** return system.getN().copy(); } ! /** * Update this clipping from the defining CoordinateSystem attribute --- 94,98 ---- return system.getN().copy(); } ! /** * Update this clipping from the defining CoordinateSystem attribute *************** *** 99,106 **** public void update() { plane = null; ! computeSilhouette(); findCorners(); } ! /** * Set the number clipping plane this plane represents in the GL --- 100,107 ---- public void update() { plane = null; ! silhouette = null; findCorners(); } ! /** * Set the number clipping plane this plane represents in the GL *************** *** 119,123 **** return number; } ! /** * Getter for corners --- 120,124 ---- return number; } ! /** * Getter for corners *************** *** 130,134 **** return corners; } ! /** * collects the vertices for this ClippingPlane --- 131,135 ---- return corners; } ! /** * collects the vertices for this ClippingPlane *************** *** 140,145 **** return result; } ! ! /** * {@inheritDoc} --- 141,146 ---- return result; } ! ! /** * {@inheritDoc} *************** *** 150,154 **** c.removeClipplane(this); } ! /** * Returns true if surface is contained in this ClippingPlane --- 151,155 ---- c.removeClipplane(this); } ! /** * Returns true if surface is contained in this ClippingPlane *************** *** 160,164 **** return plane.contains(surface); } ! /** * Returns true if edge is contained in this ClippingPlane --- 161,165 ---- return plane.contains(surface); } ! /** * Returns true if edge is contained in this ClippingPlane *************** *** 170,174 **** return plane.contains(edge); } ! /** --- 171,175 ---- return plane.contains(edge); } ! /** *************** *** 186,245 **** */ public Collection<Edge> getLines() { ! return silhouette; } ! ! ! private void computeSilhouette() { ! Container space = Project.getInstance().getActiveSpace(); ! Collection<Edge> edges = Geometry.getActiveEdges(space); ! silhouette.clear(); ! Plane plane = system.plane(); ! for (Edge current : edges) { if (plane.contains(current)) { ! Edge edge = current.copy(); ! edge.setStrippled(false); ! silhouette.add(edge); } } ! Collection<Surface> surfaces = Geometry.getActiveSurfaces(space); ! for (Surface current : surfaces) { Collection<Edge> contour = current.getEdges(); ! Vertex first = null; for (Edge edge : contour) { ! Vertex v = plane.intersection(edge); ! if (v != null) { ! if (first == null) { ! first = v; } else { ! Edge newE = new Edge(first, v); ! newE.setStrippled(true); ! first = null; ! silhouette.add(newE); ! break; } } } } } - - /** ! * Find intersections with all edges and return the vertices ! * (Have side effects) ! * @return The set of all intersection vertices */ ! public Collection<Vertex> findIntersections() { ! return Edge.vertices(silhouette); } ! /** ! * Find the 4 corners among intersections ! * (Have side effects) */ public void findCorners() { ! Collection c = findIntersections(); CoordinateSystem system = getPlane().coordinateSystem(); ! if (c.isEmpty()) { if (!corners.isEmpty()) { Vertex v1 = system.translate((Vertex)corners.get(0)); --- 187,247 ---- */ public Collection<Edge> getLines() { ! return silhouette.getEdges(); } ! ! private Container calculateSilhouette(Mesh input) { ! Container silhouette = new Container("Section", Space.CONSTRUCTION, true); ! Plane plane = getPlane(); ! Map map = new HashMap(); ! Map<Edge, Surface> e2s = new HashMap(); ! for (Edge current : input.edges()) { if (plane.contains(current)) { ! Edge edge = (Edge) current.copy(map); ! silhouette.insert(edge); } } ! for (Surface current : input.surfaces()) { Collection<Edge> contour = current.getEdges(); ! Vertex from = null; for (Edge edge : contour) { ! Vertex vertex = plane.intersection(edge); ! if (vertex != null) { ! if (from != null) { ! Edge line = new Edge(from, vertex); ! line.setStrippled(true); ! line = silhouette.insert(line); ! e2s.put(line, current); ! from = null; } else { ! from = vertex; } } } } + SurfaceAnalysis analysis = new SurfaceAnalysis(); + analysis.surfaceAnalysis(silhouette, plane.coordinateSystem(), silhouette.getEdges()); + return silhouette; } /** ! * Returns the silhouette ! * @return silhouette */ ! public Container getSilhouette() { ! if (silhouette == null) { ! Container space = Project.getInstance().getActiveSpace(); ! Mesh input = space.mesh(); ! silhouette = calculateSilhouette(input); ! } ! return silhouette; } ! /** ! * Find the 4 corners among the silhouette */ public void findCorners() { ! Collection vertices = getSilhouette().getVertices(); CoordinateSystem system = getPlane().coordinateSystem(); ! if (vertices.isEmpty()) { if (!corners.isEmpty()) { Vertex v1 = system.translate((Vertex)corners.get(0)); *************** *** 258,262 **** } } else { ! Iterator it = c.iterator(); double minX = Integer.MAX_VALUE; double minY = Integer.MAX_VALUE; --- 260,264 ---- } } else { ! Iterator it = vertices.iterator(); double minX = Integer.MAX_VALUE; double minY = Integer.MAX_VALUE; *************** *** 337,341 **** return s; } ! /** {@inheritDoc} */ public String title() { --- 339,343 ---- return s; } ! /** {@inheritDoc} */ public String title() { |
From: Michael L. <he...@us...> - 2008-09-09 14:02:59
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20579/src/net/sourceforge/bprocessor/model Modified Files: ClippingPlane.java Log Message: ClippingPlane improvements Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClippingPlane.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ClippingPlane.java 9 Sep 2008 13:42:54 -0000 1.31 --- ClippingPlane.java 9 Sep 2008 14:03:09 -0000 1.32 *************** *** 8,16 **** import java.util.Collection; - import java.util.HashMap; import java.util.Iterator; import java.util.ArrayList; import java.util.List; - import java.util.Map; import java.util.Set; import java.util.HashSet; --- 8,14 ---- *************** *** 36,42 **** /** The silhouette */ private ArrayList<Edge> silhouette; - - /** The edge map */ - private Map<Edge, Edge> e2e; /** The plane of the ClippingPlane */ --- 34,37 ---- *************** *** 59,63 **** this.silhouette = new ArrayList<Edge>(); this.corners = new ArrayList<Vertex>(); - this.e2e = new HashMap(); Project.getInstance().addObserver(this); } --- 54,57 ---- *************** *** 105,108 **** --- 99,103 ---- public void update() { plane = null; + computeSilhouette(); findCorners(); } *************** *** 195,210 **** ! ! /** ! * Find intersections with all edges and return the vertices ! * (Have side effects) ! * @return The set of all intersection vertices ! */ ! public Collection<Vertex> findIntersections() { ! e2e.clear(); Container space = Project.getInstance().getActiveSpace(); Collection<Edge> edges = Geometry.getActiveEdges(space); silhouette.clear(); - Collection<Vertex> vertices = new ArrayList<Vertex>(); Plane plane = system.plane(); for (Edge current : edges) { --- 190,197 ---- ! private void computeSilhouette() { Container space = Project.getInstance().getActiveSpace(); Collection<Edge> edges = Geometry.getActiveEdges(space); silhouette.clear(); Plane plane = system.plane(); for (Edge current : edges) { *************** *** 212,224 **** Edge edge = current.copy(); edge.setStrippled(false); - vertices.add(edge.getFrom()); - vertices.add(edge.getTo()); silhouette.add(edge); - e2e.put(edge, current); - } else { - Vertex intersection = plane.intersection(current); - if (intersection != null) { - vertices.add(intersection); - } } } --- 199,203 ---- *************** *** 237,241 **** first = null; silhouette.add(newE); - e2e.put(newE, newE); break; } --- 216,219 ---- *************** *** 243,247 **** } } ! return vertices; } --- 221,235 ---- } } ! } ! ! ! ! /** ! * Find intersections with all edges and return the vertices ! * (Have side effects) ! * @return The set of all intersection vertices ! */ ! public Collection<Vertex> findIntersections() { ! return Edge.vertices(silhouette); } *************** *** 251,255 **** */ public void findCorners() { ! Collection c = this.findIntersections(); CoordinateSystem system = getPlane().coordinateSystem(); if (c.isEmpty()) { --- 239,243 ---- */ public void findCorners() { ! Collection c = findIntersections(); CoordinateSystem system = getPlane().coordinateSystem(); if (c.isEmpty()) { *************** *** 389,407 **** this.slice = slice; } - - /** - * Find the edge or surface the given edge correspond to in the model - * @param e the Edge in the contour - * @return The geometry in the model or null if none - */ - public Geometric toModel(Edge e) { - if (e2e != null) { - Object o = e2e.get(e); - if (o != null) { - return (Geometric)o; - } - } - return null; - } /** --- 377,380 ---- |