bprocessor-commit Mailing List for B-processor (Page 31)
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...> - 2007-12-13 12:40:03
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4271/src/net/sourceforge/bprocessor/model Modified Files: Space.java Container.java Log Message: moved actual fields down to container Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.226 retrieving revision 1.227 diff -C2 -d -r1.226 -r1.227 *** Space.java 13 Dec 2007 12:28:57 -0000 1.226 --- Space.java 13 Dec 2007 12:39:36 -0000 1.227 *************** *** 16,20 **** import java.util.List; import java.util.Set; - import java.util.Map; import net.sourceforge.bprocessor.model.modellor.Modellor; --- 16,19 ---- *************** *** 78,106 **** protected Container empty; - /** The elements (a list of spaces) */ - protected HashMap<Long, Space> elements; - - /** The next element id */ - protected long nextElementId; - - /** The vertices */ - protected HashMap<Long, Vertex> vertices; - /** The next vertex id */ - protected long nextVertexId; - - /** The edges */ - protected HashMap<Long, Edge> edges; - /** The next edge id */ - protected long nextEdgeId; - - /** The surfaces */ - protected HashMap<Long, Surface> surfaces; - /** The next surface id */ - protected long nextSurfaceId; - - /** The constructors */ - protected Map<Long, Constructor> constructors; - /** The next constructor id */ - protected long nextConstructorId; /** The modellor */ --- 77,80 ---- *************** *** 110,117 **** - - - - /** * Constructor for persistence layer --- 84,87 ---- *************** *** 120,141 **** super(); envelope = new HashSet<Surface>(); - initializeContainers(); } ! /** ! * Initialize the data structures ! */ ! private void initializeContainers() { ! vertices = new HashMap<Long, Vertex>(); ! nextVertexId = 1; ! edges = new HashMap<Long, Edge>(); ! nextEdgeId = 1; ! surfaces = new HashMap<Long, Surface>(); ! nextSurfaceId = 1; ! elements = new HashMap<Long, Space>(); ! nextElementId = 1; ! constructors = new HashMap<Long, Constructor>(); ! nextConstructorId = 1; ! } /** --- 90,96 ---- super(); envelope = new HashSet<Surface>(); } ! /** *************** *** 157,165 **** description = new Description(""); envelope = new HashSet<Surface>(); - if (container) { - initializeContainers(); - empty = new Container("Void", FUNCTIONAL, false); - ((Container) this).add(empty); - } } --- 112,115 ---- *************** *** 411,454 **** /** - * Set the vertices - * @param vertices HashMap - */ - public void setVertices(HashMap<Long, Vertex> vertices) { - this.vertices = vertices; - nextVertexId = Entity.maxId(vertices.values()) + 1; - } - - /** - * Set the edges - * @param edges HashMap - */ - public void setEdges(HashMap<Long, Edge> edges) { - this.edges = edges; - nextEdgeId = Entity.maxId(edges.values()) + 1; - } - - /** - * Set the surfaces - * @param surfaces HashMap - */ - public void setSurfaces(HashMap<Long, Surface> surfaces) { - this.surfaces = surfaces; - nextSurfaceId = Entity.maxId(surfaces.values()) + 1; - } - - - - /** - * Compute next id - * - */ - public void computeNextId() { - nextVertexId = Entity.maxId(vertices.values()) + 1; - nextEdgeId = Entity.maxId(edges.values()) + 1; - nextSurfaceId = Entity.maxId(surfaces.values()) + 1; - nextElementId = Entity.maxId(elements.values()) + 1; - } - - /** * Add a surface to the envelope * @param surface The surface --- 361,364 ---- *************** *** 465,473 **** envelope.remove(surface); } - - - - - /** --- 375,378 ---- *************** *** 739,761 **** public Set<Vertex> collectInterior() { Set<Vertex> result = new HashSet<Vertex>(); - Iterator it; - if (container) { - it = elements.values().iterator(); - while (it.hasNext()) { - result.addAll(((Geometric)it.next()).collect()); - } - it = surfaces.values().iterator(); - while (it.hasNext()) { - result.addAll(((Geometric)it.next()).collect()); - } - it = edges.values().iterator(); - while (it.hasNext()) { - result.addAll(((Geometric)it.next()).collect()); - } - it = vertices.values().iterator(); - while (it.hasNext()) { - result.addAll(((Geometric)it.next()).collect()); - } - } return result; } --- 644,647 ---- Index: Container.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Container.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Container.java 13 Dec 2007 12:28:57 -0000 1.5 --- Container.java 13 Dec 2007 12:39:36 -0000 1.6 *************** *** 24,27 **** --- 24,55 ---- */ public class Container extends Space { + + /** The elements (a list of spaces) */ + protected HashMap<Long, Space> elements; + + /** The next element id */ + protected long nextElementId; + + /** The vertices */ + protected HashMap<Long, Vertex> vertices; + /** The next vertex id */ + protected long nextVertexId; + + /** The edges */ + protected HashMap<Long, Edge> edges; + /** The next edge id */ + protected long nextEdgeId; + + /** The surfaces */ + protected HashMap<Long, Surface> surfaces; + /** The next surface id */ + protected long nextSurfaceId; + + /** The constructors */ + protected Map<Long, Constructor> constructors; + /** The next constructor id */ + protected long nextConstructorId; + + /** * Empty constructor *************** *** 29,32 **** --- 57,62 ---- */ public Container() { + super(); + initializeContainers(); } *************** *** 39,42 **** --- 69,93 ---- public Container(String name, int type, boolean container) { super(name, type, container); + if (container) { + initializeContainers(); + empty = new Container("Void", FUNCTIONAL, false); + ((Container) this).add(empty); + } + } + + /** + * Initialize the data structures + */ + private void initializeContainers() { + vertices = new HashMap<Long, Vertex>(); + nextVertexId = 1; + edges = new HashMap<Long, Edge>(); + nextEdgeId = 1; + surfaces = new HashMap<Long, Surface>(); + nextSurfaceId = 1; + elements = new HashMap<Long, Space>(); + nextElementId = 1; + constructors = new HashMap<Long, Constructor>(); + nextConstructorId = 1; } *************** *** 1289,1291 **** --- 1340,1408 ---- Project.getInstance().changed(Project.getInstance()); } + + /** + * + * @return the interior set of vertices + */ + public Set<Vertex> collectInterior() { + Set<Vertex> result = new HashSet<Vertex>(); + Iterator it; + if (container) { + it = elements.values().iterator(); + while (it.hasNext()) { + result.addAll(((Geometric)it.next()).collect()); + } + it = surfaces.values().iterator(); + while (it.hasNext()) { + result.addAll(((Geometric)it.next()).collect()); + } + it = edges.values().iterator(); + while (it.hasNext()) { + result.addAll(((Geometric)it.next()).collect()); + } + it = vertices.values().iterator(); + while (it.hasNext()) { + result.addAll(((Geometric)it.next()).collect()); + } + } + return result; + } + + /** + * Compute next id + * + */ + public void computeNextId() { + nextVertexId = Entity.maxId(vertices.values()) + 1; + nextEdgeId = Entity.maxId(edges.values()) + 1; + nextSurfaceId = Entity.maxId(surfaces.values()) + 1; + nextElementId = Entity.maxId(elements.values()) + 1; + } + + /** + * Set the vertices + * @param vertices HashMap + */ + public void setVertices(HashMap<Long, Vertex> vertices) { + this.vertices = vertices; + nextVertexId = Entity.maxId(vertices.values()) + 1; + } + + /** + * Set the edges + * @param edges HashMap + */ + public void setEdges(HashMap<Long, Edge> edges) { + this.edges = edges; + nextEdgeId = Entity.maxId(edges.values()) + 1; + } + + /** + * Set the surfaces + * @param surfaces HashMap + */ + public void setSurfaces(HashMap<Long, Surface> surfaces) { + this.surfaces = surfaces; + nextSurfaceId = Entity.maxId(surfaces.values()) + 1; + } } |
From: Michael L. <he...@us...> - 2007-12-13 12:29:04
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32145/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: moved a ton of functionality from space to container Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** Display.java 13 Dec 2007 12:00:50 -0000 1.68 --- Display.java 13 Dec 2007 12:29:02 -0000 1.69 *************** *** 1195,1201 **** } Collection<Surface> envelope = new LinkedList(space.getEnvelope()); - if (envelope.isEmpty()) { - envelope.addAll(space.getSurfaces()); - } Collection<Edge> edges = Surface.edges(envelope); --- 1195,1198 ---- |
From: Michael L. <he...@us...> - 2007-12-13 12:29:03
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32464/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: moved a ton of functionality from space to container Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** PopupMenu.java 13 Dec 2007 12:00:55 -0000 1.90 --- PopupMenu.java 13 Dec 2007 12:29:05 -0000 1.91 *************** *** 346,359 **** if (CHECKS) { - AbstractAction envelope = new SpaceMenuAction(sp, "Compute Envelope") { - public void actionPerformed(ActionEvent arg0) { - if (space != null) { - space.computeEnvelope(); - Project.getInstance().changed(Project.getInstance()); - Project.getInstance().checkpoint(); - } - } - }; - menu.add(envelope); AbstractAction check = new SpaceMenuAction(sp, "Consistency Check") { public void actionPerformed(ActionEvent arg0) { --- 346,349 ---- |
From: Michael L. <he...@us...> - 2007-12-13 12:29:03
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32128/src/net/sourceforge/bprocessor/model Modified Files: Instance.java Space.java Container.java Log Message: moved a ton of functionality from space to container Index: Instance.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Instance.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Instance.java 13 Dec 2007 12:00:30 -0000 1.4 --- Instance.java 13 Dec 2007 12:28:57 -0000 1.5 *************** *** 97,99 **** --- 97,108 ---- return result; } + + /** {@inheritDoc} */ + @Override + public void delete() { + // TODO Auto-generated method stub + + } + + } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.225 retrieving revision 1.226 diff -C2 -d -r1.225 -r1.226 *** Space.java 13 Dec 2007 12:15:40 -0000 1.225 --- Space.java 13 Dec 2007 12:28:57 -0000 1.226 *************** *** 8,14 **** import java.util.ArrayList; - import java.util.Collection; import java.util.Collections; - import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; --- 8,12 ---- *************** *** 87,108 **** [...1155 lines suppressed...] - if (s1 != s2 && !(delete.contains(s1) || delete.contains(s2)) - && s1.getEdges().containsAll(s2.getEdges())) { - if (s1.id < s2.id) { - delete.add(s2); - } else { - delete.add(s1); - } - } - } - } - for (Surface s : delete) { - remove(s); - } - } - } - Project.getInstance().changed(Project.getInstance()); - } /** --- 876,880 ---- Index: Container.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Container.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Container.java 13 Dec 2007 12:15:41 -0000 1.4 --- Container.java 13 Dec 2007 12:28:57 -0000 1.5 *************** *** 8,16 **** --- 8,21 ---- package net.sourceforge.bprocessor.model; + import java.util.ArrayList; import java.util.Collection; import java.util.Collections; + import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; [...1024 lines suppressed...] + for (Surface s1 : e.getSurfaces()) { + for (Surface s2 : e.getSurfaces()) { + if (s1 != s2 && !(delete.contains(s1) || delete.contains(s2)) + && s1.getEdges().containsAll(s2.getEdges())) { + if (s1.id < s2.id) { + delete.add(s2); + } else { + delete.add(s1); + } + } + } + } + for (Surface s : delete) { + remove(s); + } + } + } + Project.getInstance().changed(Project.getInstance()); + } } |
From: Michael L. <he...@us...> - 2007-12-13 12:15:51
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26870/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Move elements from space to container Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.134 retrieving revision 1.135 diff -C2 -d -r1.134 -r1.135 *** GenericTreeView.java 13 Dec 2007 12:00:55 -0000 1.134 --- GenericTreeView.java 13 Dec 2007 12:15:48 -0000 1.135 *************** *** 697,710 **** if (space.isContainer()) { int inx = 0; ! ((GenericNode)getChildAt(inx++)).update(s.getEnvelope()); ! ((GenericNode)getChildAt(inx++)).update(s.getElements()); if (Project.doDisplayGeometry()) { ! ((GenericNode)getChildAt(inx++)).update(s); } ! ((GenericNode)getChildAt(inx++)).update(s.getConstructors()); int placement = inx; if (s.getModellor() != null) { if (getChildCount() >= placement + 1) { ! ((GenericNode)getChildAt(placement)).update(s.getModellor()); } else { add(new ModellorNode(s.getModellor())); --- 697,710 ---- if (space.isContainer()) { int inx = 0; ! ((GenericNode)getChildAt(inx++)).update(space.getEnvelope()); ! ((GenericNode)getChildAt(inx++)).update(space.getElements()); if (Project.doDisplayGeometry()) { ! ((GenericNode)getChildAt(inx++)).update(space); } ! ((GenericNode)getChildAt(inx++)).update(space.getConstructors()); int placement = inx; if (s.getModellor() != null) { if (getChildCount() >= placement + 1) { ! ((GenericNode)getChildAt(placement)).update(space.getModellor()); } else { add(new ModellorNode(s.getModellor())); |
From: Michael L. <he...@us...> - 2007-12-13 12:15:47
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26856/src/net/sourceforge/bprocessor/model Modified Files: Space.java Persistence.java Container.java Log Message: Move elements from space to container Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** Persistence.java 13 Dec 2007 12:00:31 -0000 1.70 --- Persistence.java 13 Dec 2007 12:15:40 -0000 1.71 *************** *** 990,996 **** map.put(space, xml); if (!space.isInstance()) { //Only save geometry if space isn't a instance { ! List elements = new LinkedList(space.getElements()); Entity.sort(elements); Iterator iter = elements.iterator(); --- 990,997 ---- map.put(space, xml); if (!space.isInstance()) { + Container container = (Container) space; //Only save geometry if space isn't a instance { ! List elements = new LinkedList(container.getElements()); Entity.sort(elements); Iterator iter = elements.iterator(); *************** *** 1001,1005 **** } { ! List surfaces = new LinkedList(space.getSurfaces()); Entity.sort(surfaces); Iterator iter = surfaces.iterator(); --- 1002,1006 ---- } { ! List surfaces = new LinkedList(container.getSurfaces()); Entity.sort(surfaces); Iterator iter = surfaces.iterator(); *************** *** 1010,1014 **** } { ! List edges = new LinkedList(space.getEdges()); Entity.sort(edges); Iterator iter = edges.iterator(); --- 1011,1015 ---- } { ! List edges = new LinkedList(container.getEdges()); Entity.sort(edges); Iterator iter = edges.iterator(); *************** *** 1019,1023 **** } { ! List vertices = new LinkedList(space.getVertices()); Entity.sort(vertices); Iterator iter = vertices.iterator(); --- 1020,1024 ---- } { ! List vertices = new LinkedList(container.getVertices()); Entity.sort(vertices); Iterator iter = vertices.iterator(); *************** *** 1028,1032 **** } { ! Iterator iter = space.getConstructors().iterator(); while (iter.hasNext()) { Constructor current = (Constructor) iter.next(); --- 1029,1033 ---- } { ! Iterator iter = container.getConstructors().iterator(); while (iter.hasNext()) { Constructor current = (Constructor) iter.next(); Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.224 retrieving revision 1.225 diff -C2 -d -r1.224 -r1.225 *** Space.java 13 Dec 2007 12:00:31 -0000 1.224 --- Space.java 13 Dec 2007 12:15:40 -0000 1.225 *************** *** 84,88 **** /** The next element id */ ! private long nextElementId; /** The vertices */ --- 84,88 ---- /** The next element id */ ! protected long nextElementId; /** The vertices */ *************** *** 187,191 **** initializeContainers(); empty = new Container("Void", FUNCTIONAL, false); ! this.add(empty); } } --- 187,191 ---- initializeContainers(); empty = new Container("Void", FUNCTIONAL, false); ! ((Container) this).add(empty); } } *************** *** 352,356 **** nextConstructorId = 1; empty.clear(); ! add(empty); } } --- 352,356 ---- nextConstructorId = 1; empty.clear(); ! ((Container) this).add(empty); } } *************** *** 874,890 **** } - /** - * Find element by name - * @param name String - * @return element - */ - public Space find(String name) { - for (Space element : getElements()) { - if (element.getName().equals(name)) { - return element; - } - } - return null; - } /** --- 874,877 ---- *************** *** 951,963 **** } ! /** ! * Set the elements ! * @param elements HashMap ! */ ! public void setElements(HashMap<Long, Space> elements) { ! this.elements = elements; ! nextElementId = Entity.maxId(elements.values()) + 1; ! } ! /** --- 938,942 ---- } ! /** *************** *** 988,1083 **** } - /** - * Add a space as element - * @param element The space to add as element - */ - public void add(Space element) { - if (container && elements != null) { - Long id; - if (element.getId() != null) { - id = element.getId(); - nextElementId = Math.max(nextElementId, id.longValue() + 1); - } else { - id = new Long(nextElementId++); - element.setId(id); - } - elements.put(id, element); - element.setOwner((Container) this); - } else { - throw new Error("adding element to non-container " + this); - } - } - /** - * Remove a space as element - * @param element The space to remove as element - */ - public void remove(Container element) { - if (container) { - Set surfs = element.getEnvelope(); - element.setEnvelope(new HashSet<Surface>()); - if (surfs != null) { - Iterator iter = surfs.iterator(); - while (iter.hasNext()) { - Surface current = (Surface)iter.next(); - Container back = current.getBackDomain(); - Container front = current.getFrontDomain(); - if (back == element) { - current.setBackDomain(empty); - } - if (front == element) { - current.setFrontDomain(empty); - } - } - } - if (element != null) { - Container superSpace = findElement(element); - if (superSpace != null) { - superSpace.elements.remove(element.getId()); - element.setId(null); - } - } - if (element.getModellor() != null) { - element.getModellor().delete(); - } - } - } - /** - * Finds an element contained in this space or some subspace of this space. - * @param element the element to be found. - * @return the space that directly contains the element in its elements set - * that space maybe a subspace of this space. If the element is not found null - * is returned. - */ - protected Container findElement(Container element) { - if (elements != null) { - if (elements.get(element.getId()) == element) { - return (Container) this; - } else { - Iterator it = elements.values().iterator(); - while (it.hasNext()) { - Container space = (Container)it.next(); - Container result = space.findElement(element); - if (result != null) { - return result; - } - } - } - } - return null; - } ! /** ! * Get elements ! * @return Elements ! */ ! public Collection<Space> getElements() { ! if (container) { ! return elements.values(); ! } else { ! return Collections.EMPTY_LIST; ! } ! } /** --- 967,974 ---- } ! /** *************** *** 1371,1386 **** } ! /** ! * Collect all interior surfaces to specified container ! * @param surfaces Set of surfaces ! */ ! public void collectSurfaces(Collection<Surface> surfaces) { ! surfaces.addAll(getSurfaces()); ! Iterator iter = getElements().iterator(); ! while (iter.hasNext()) { ! Container element = (Container) iter.next(); ! element.collectSurfaces(surfaces); ! } ! } /** {@inheritDoc} */ --- 1262,1266 ---- } ! /** {@inheritDoc} */ *************** *** 1497,1579 **** } - /** - * Perform a consistency check of the geometry. - * @return True of sucessful - */ - public boolean check() { - { - { - Iterator iter = getElements().iterator(); - while (iter.hasNext()) { - Geometric current = (Geometric) iter.next(); - if (current.getOwner() != this) { - throw new Error(current + " not owned by " + this); - } - } - } - { - Iterator iter = getSurfaces().iterator(); - while (iter.hasNext()) { - Geometric current = (Geometric) iter.next(); - if (current.getOwner() != this) { - throw new Error(current + " not owned by " + this); - } - } - } - { - Iterator iter = getEdges().iterator(); - while (iter.hasNext()) { - Geometric current = (Geometric) iter.next(); - if (current.getOwner() != this) { - throw new Error(current + " not owned by " + this); - } - } - } - { - Iterator iter = getVertices().iterator(); - while (iter.hasNext()) { - Geometric current = (Geometric) iter.next(); - if (current.getOwner() != this) { - throw new Error(current + " not owned by " + this); - } - } - } - } - { - // Exterior - hole check - { - Iterator iter = getSurfaces().iterator(); - while (iter.hasNext()) { - Surface current = (Surface) iter.next(); - Iterator holes = current.getHoles().iterator(); - while (holes.hasNext()) { - Surface hole = (Surface) holes.next(); - if (hole.getExterior() != current) { - throw new Error(current + " not exterior to " + hole); - } - } - Set<Surface> mark = new HashSet<Surface>(); - while (current != null) { - if (mark.contains(current)) { - throw new Error("cycle in exterior " + current); - } else { - mark.add(current); - current = current.getExterior(); - } - } - } - } - } - { - for (Space element : getElements()) { - for (Surface surface : element.getEnvelope()) { - if (surface.getOwner() != this) { - throw new Error("inconsistency in envelope of " + element); - } - } - } - } - return true; - } /** --- 1377,1380 ---- *************** *** 2217,2234 **** /** - * Verify that everything is OK - */ - public void verify() { - for (Space space : getElements()) { - for (Surface surface : space.getEnvelope()) { - if (surface.getOwner() == null) { - System.out.println(" NOT OK"); - } - } - } - } - - - /** * Info * @param object Object --- 2018,2021 ---- Index: Container.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Container.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Container.java 12 Dec 2007 14:38:43 -0000 1.3 --- Container.java 13 Dec 2007 12:15:41 -0000 1.4 *************** *** 8,11 **** --- 8,18 ---- package net.sourceforge.bprocessor.model; + import java.util.Collection; + import java.util.Collections; + import java.util.HashMap; + import java.util.HashSet; + import java.util.Iterator; + import java.util.Set; + /** * *************** *** 35,37 **** --- 42,253 ---- return false; } + + /** + * Add a space as element + * @param element The space to add as element + */ + public void add(Space element) { + if (container && elements != null) { + Long id; + if (element.getId() != null) { + id = element.getId(); + nextElementId = Math.max(nextElementId, id.longValue() + 1); + } else { + id = new Long(nextElementId++); + element.setId(id); + } + elements.put(id, element); + element.setOwner((Container) this); + } else { + throw new Error("adding element to non-container " + this); + } + } + + /** + * Remove a space as element + * @param element The space to remove as element + */ + public void remove(Container element) { + if (container) { + Set surfs = element.getEnvelope(); + element.setEnvelope(new HashSet<Surface>()); + if (surfs != null) { + Iterator iter = surfs.iterator(); + while (iter.hasNext()) { + Surface current = (Surface)iter.next(); + Container back = current.getBackDomain(); + Container front = current.getFrontDomain(); + if (back == element) { + current.setBackDomain(empty); + } + if (front == element) { + current.setFrontDomain(empty); + } + } + } + if (element != null) { + Container superSpace = findElement(element); + if (superSpace != null) { + superSpace.elements.remove(element.getId()); + element.setId(null); + } + } + if (element.getModellor() != null) { + element.getModellor().delete(); + } + } + } + + /** + * Finds an element contained in this space or some subspace of this space. + * @param element the element to be found. + * @return the space that directly contains the element in its elements set + * that space maybe a subspace of this space. If the element is not found null + * is returned. + */ + protected Container findElement(Container element) { + if (elements != null) { + if (elements.get(element.getId()) == element) { + return (Container) this; + } else { + Iterator it = elements.values().iterator(); + while (it.hasNext()) { + Container space = (Container)it.next(); + Container result = space.findElement(element); + if (result != null) { + return result; + } + } + } + } + return null; + } + + /** + * Get elements + * @return Elements + */ + public Collection<Space> getElements() { + if (container) { + return elements.values(); + } else { + return Collections.EMPTY_LIST; + } + } + + /** + * Set the elements + * @param elements HashMap + */ + public void setElements(HashMap<Long, Space> elements) { + this.elements = elements; + nextElementId = Entity.maxId(elements.values()) + 1; + } + + /** + * Find element by name + * @param name String + * @return element + */ + public Space find(String name) { + for (Space element : getElements()) { + if (element.getName().equals(name)) { + return element; + } + } + return null; + } + + /** + * Collect all interior surfaces to specified container + * @param surfaces Set of surfaces + */ + public void collectSurfaces(Collection<Surface> surfaces) { + surfaces.addAll(getSurfaces()); + Iterator iter = getElements().iterator(); + while (iter.hasNext()) { + Container element = (Container) iter.next(); + element.collectSurfaces(surfaces); + } + } + + /** + * Perform a consistency check of the geometry. + * @return True of sucessful + */ + public boolean check() { + { + { + Iterator iter = getElements().iterator(); + while (iter.hasNext()) { + Geometric current = (Geometric) iter.next(); + if (current.getOwner() != this) { + throw new Error(current + " not owned by " + this); + } + } + } + { + Iterator iter = getSurfaces().iterator(); + while (iter.hasNext()) { + Geometric current = (Geometric) iter.next(); + if (current.getOwner() != this) { + throw new Error(current + " not owned by " + this); + } + } + } + { + Iterator iter = getEdges().iterator(); + while (iter.hasNext()) { + Geometric current = (Geometric) iter.next(); + if (current.getOwner() != this) { + throw new Error(current + " not owned by " + this); + } + } + } + { + Iterator iter = getVertices().iterator(); + while (iter.hasNext()) { + Geometric current = (Geometric) iter.next(); + if (current.getOwner() != this) { + throw new Error(current + " not owned by " + this); + } + } + } + } + { + // Exterior - hole check + { + Iterator iter = getSurfaces().iterator(); + while (iter.hasNext()) { + Surface current = (Surface) iter.next(); + Iterator holes = current.getHoles().iterator(); + while (holes.hasNext()) { + Surface hole = (Surface) holes.next(); + if (hole.getExterior() != current) { + throw new Error(current + " not exterior to " + hole); + } + } + Set<Surface> mark = new HashSet<Surface>(); + while (current != null) { + if (mark.contains(current)) { + throw new Error("cycle in exterior " + current); + } else { + mark.add(current); + current = current.getExterior(); + } + } + } + } + } + { + for (Space element : getElements()) { + for (Surface surface : element.getEnvelope()) { + if (surface.getOwner() != this) { + throw new Error("inconsistency in envelope of " + element); + } + } + } + } + return true; + } } |
From: Michael L. <he...@us...> - 2007-12-13 12:00:58
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20795/src/net/sourceforge/bprocessor/gui/actions Modified Files: CreateConstructionSpaceActionListener.java SpaceMenuAction.java ModellorMenuAction.java CreateNetActionListener.java CreateFunctionalSpaceActionListener.java ImportFileReader.java FileImportActionListener.java Log Message: Major change wrt Space/Container Index: ImportFileReader.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/ImportFileReader.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ImportFileReader.java 12 Dec 2007 12:48:31 -0000 1.16 --- ImportFileReader.java 13 Dec 2007 12:00:55 -0000 1.17 *************** *** 25,34 **** import net.sourceforge.bprocessor.model.Classification; - import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Material; import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; --- 25,33 ---- import net.sourceforge.bprocessor.model.Classification; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Material; import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 72,76 **** * @throws IOException a possible file read error */ ! public static void importObjFile(File f, Space into, double scale, int basisPlane, boolean calcNormals) throws IOException { --- 71,75 ---- * @throws IOException a possible file read error */ ! public static void importObjFile(File f, Container into, double scale, int basisPlane, boolean calcNormals) throws IOException { *************** *** 85,91 **** Set<Surface> surfaces = new HashSet<Surface>(); Map<Vertex, Set<Edge>> v2es = new HashMap<Vertex, Set<Edge>>(); ! List<Space> groups = new LinkedList<Space>(); Map<String, Material> materialMap = new HashMap<String, Material>(); ! Space currentGroup = into.createConstructionSpace("Object"); Material currentMaterial = null; boolean missNormals = false; --- 84,90 ---- Set<Surface> surfaces = new HashSet<Surface>(); Map<Vertex, Set<Edge>> v2es = new HashMap<Vertex, Set<Edge>>(); ! List<Container> groups = new LinkedList<Container>(); Map<String, Material> materialMap = new HashMap<String, Material>(); ! Container currentGroup = into.createConstructionSpace("Object"); Material currentMaterial = null; boolean missNormals = false; *************** *** 200,204 **** } } ! for (Space s : groups) { if (!s.collect().isEmpty()) { into.add(s); --- 199,203 ---- } } ! for (Container s : groups) { if (!s.collect().isEmpty()) { into.add(s); *************** *** 343,347 **** * @throws IOException A possible file read exception */ ! public static void importCsvFile(File file, Space where, int chosenFloor) throws IOException { if (file.exists()) { BufferedReader bf; --- 342,346 ---- * @throws IOException A possible file read exception */ ! public static void importCsvFile(File file, Container where, int chosenFloor) throws IOException { if (file.exists()) { BufferedReader bf; *************** *** 360,364 **** int previousSpaceId = spaceid; int classification = 0; ! Space currentSpace = null; Surface outerSurface = null; List<Vertex> verts = new ArrayList<Vertex>(); --- 359,363 ---- int previousSpaceId = spaceid; int classification = 0; ! Container currentSpace = null; Surface outerSurface = null; List<Vertex> verts = new ArrayList<Vertex>(); *************** *** 406,410 **** if (spaceid != previousSpaceId) { currentSpace = new Container("Space with id " + spaceid, ! Space.CONSTRUCTION, true); where.add(currentSpace); currentSpace.setClassification(new Classification("Type " + classification, -1)); --- 405,409 ---- if (spaceid != previousSpaceId) { currentSpace = new Container("Space with id " + spaceid, ! Container.CONSTRUCTION, true); where.add(currentSpace); currentSpace.setClassification(new Classification("Type " + classification, -1)); *************** *** 480,484 **** * @return the generated surface */ ! private static Surface addToRead(List<Vertex> verts, Space currentSpace, Space where, Surface outer) { List<Edge> es = makeEdgesFromVertexes(verts); --- 479,483 ---- * @return the generated surface */ ! private static Surface addToRead(List<Vertex> verts, Container currentSpace, Container where, Surface outer) { List<Edge> es = makeEdgesFromVertexes(verts); Index: SpaceMenuAction.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/SpaceMenuAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SpaceMenuAction.java 26 Sep 2006 09:50:54 -0000 1.1 --- SpaceMenuAction.java 13 Dec 2007 12:00:55 -0000 1.2 *************** *** 9,13 **** import javax.swing.AbstractAction; ! import net.sourceforge.bprocessor.model.Space; --- 9,13 ---- import javax.swing.AbstractAction; ! import net.sourceforge.bprocessor.model.Container; *************** *** 17,21 **** public abstract class SpaceMenuAction extends AbstractAction { /** The entity */ ! protected Space space; /** --- 17,21 ---- public abstract class SpaceMenuAction extends AbstractAction { /** The entity */ ! protected Container space; /** *************** *** 24,28 **** * @param name the name of the action */ ! public SpaceMenuAction(Space s, String name) { super(name); this.space = s; --- 24,28 ---- * @param name the name of the action */ ! public SpaceMenuAction(Container s, String name) { super(name); this.space = s; Index: CreateNetActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateNetActionListener.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CreateNetActionListener.java 2 Nov 2007 12:11:22 -0000 1.6 --- CreateNetActionListener.java 13 Dec 2007 12:00:55 -0000 1.7 *************** *** 11,15 **** import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Space; --- 11,15 ---- import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Container; *************** *** 23,28 **** */ public void actionPerformed(ActionEvent event) { ! Space net = Space.createNet("B-net"); ! Space active = Project.getInstance().getActiveSpace(); active.add(net); active.changed(); --- 23,28 ---- */ public void actionPerformed(ActionEvent event) { ! Container net = Container.createNet("B-net"); ! Container active = Project.getInstance().getActiveSpace(); active.add(net); active.changed(); Index: FileImportActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileImportActionListener.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** FileImportActionListener.java 12 Dec 2007 12:48:31 -0000 1.18 --- FileImportActionListener.java 13 Dec 2007 12:00:55 -0000 1.19 *************** *** 27,33 **** import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.model.Component; - import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Space; import org.apache.log4j.Logger; --- 27,32 ---- import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.model.Component; import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Container; import org.apache.log4j.Logger; *************** *** 109,113 **** } else if (lfile.getName().endsWith(".obj")) { try { ! Space s = new Container(lfile.getName(), Space.CONSTRUCTION, true); s.setUnion(true); Component lo = new Component(Byte.MAX_VALUE, lfile, s); --- 108,112 ---- } 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); Index: CreateConstructionSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateConstructionSpaceActionListener.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** CreateConstructionSpaceActionListener.java 17 Oct 2007 09:08:11 -0000 1.16 --- CreateConstructionSpaceActionListener.java 13 Dec 2007 12:00:55 -0000 1.17 *************** *** 9,13 **** import net.sourceforge.bprocessor.gui.attrview.AttributeView; import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Space; import java.awt.event.ActionEvent; --- 9,13 ---- import net.sourceforge.bprocessor.gui.attrview.AttributeView; import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Container; import java.awt.event.ActionEvent; *************** *** 29,34 **** */ public void actionPerformed(ActionEvent e) { ! Space owner = Project.getInstance().getActiveSpace(); ! Space space; space = owner.createConstructionSpace(""); owner.add(space); --- 29,34 ---- */ public void actionPerformed(ActionEvent e) { ! Container owner = Project.getInstance().getActiveSpace(); ! Container space; space = owner.createConstructionSpace(""); owner.add(space); Index: CreateFunctionalSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateFunctionalSpaceActionListener.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** CreateFunctionalSpaceActionListener.java 17 Oct 2007 09:08:11 -0000 1.15 --- CreateFunctionalSpaceActionListener.java 13 Dec 2007 12:00:55 -0000 1.16 *************** *** 9,13 **** import net.sourceforge.bprocessor.gui.attrview.AttributeView; import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Space; import java.awt.event.ActionEvent; --- 9,13 ---- import net.sourceforge.bprocessor.gui.attrview.AttributeView; import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Container; import java.awt.event.ActionEvent; *************** *** 29,34 **** */ public void actionPerformed(ActionEvent e) { ! Space owner = Project.getInstance().getActiveSpace(); ! Space space; space = owner.createFunctionalSpace(""); owner.add(space); --- 29,34 ---- */ public void actionPerformed(ActionEvent e) { ! Container owner = Project.getInstance().getActiveSpace(); ! Container space; space = owner.createFunctionalSpace(""); owner.add(space); Index: ModellorMenuAction.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/ModellorMenuAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ModellorMenuAction.java 10 Apr 2007 21:01:10 -0000 1.2 --- ModellorMenuAction.java 13 Dec 2007 12:00:55 -0000 1.3 *************** *** 14,18 **** import net.sourceforge.bprocessor.gui.attrview.AttributeView; import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.modellor.Modellor; --- 14,18 ---- import net.sourceforge.bprocessor.gui.attrview.AttributeView; import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.modellor.Modellor; *************** *** 26,30 **** /** The space */ ! protected Space space; /** The modellor */ --- 26,30 ---- /** The space */ ! protected Container space; /** The modellor */ *************** *** 36,40 **** * @param m the modellor */ ! public ModellorMenuAction(Space s, Modellor m) { super(m.getGeneralName()); this.space = s; --- 36,40 ---- * @param m the modellor */ ! public ModellorMenuAction(Container s, Modellor m) { super(m.getGeneralName()); this.space = s; |
From: Michael L. <he...@us...> - 2007-12-13 12:00:58
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20795/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java GUI.java Log Message: Major change wrt Space/Container Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** PopupMenu.java 12 Dec 2007 12:48:31 -0000 1.89 --- PopupMenu.java 13 Dec 2007 12:00:55 -0000 1.90 *************** *** 42,46 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; - import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.SurfaceAnalysis; --- 42,45 ---- *************** *** 193,199 **** private abstract static class ModellorAction extends AbstractAction { protected Modellor modellor; ! protected Space space; ! public ModellorAction(Modellor modellor, Space space) { super(modellor.getGeneralName()); this.modellor = modellor; --- 192,198 ---- private abstract static class ModellorAction extends AbstractAction { protected Modellor modellor; ! protected Container space; ! public ModellorAction(Modellor modellor, Container space) { super(modellor.getGeneralName()); this.modellor = modellor; *************** *** 215,220 **** AbstractAction action = new CollectionMenuAction(s, "Dissolve") { public void actionPerformed(ActionEvent event) { ! List<Space> spaces = new LinkedList(col); ! for (Space space : spaces) { Collection<Vertex> vertices = new LinkedList(space.getVertices()); Collection<Edge> edges = new LinkedList(space.getEdges()); --- 214,219 ---- AbstractAction action = new CollectionMenuAction(s, "Dissolve") { public void actionPerformed(ActionEvent event) { ! List<Container> spaces = new LinkedList(col); ! for (Container space : spaces) { Collection<Vertex> vertices = new LinkedList(space.getVertices()); Collection<Edge> edges = new LinkedList(space.getEdges()); *************** *** 255,259 **** Iterator iter = col.iterator(); while (iter.hasNext()) { ! Space space = (Space)iter.next(); Instance instance = new Instance("Instance of " + space.getName()); instance.setProto(space); --- 254,258 ---- Iterator iter = col.iterator(); while (iter.hasNext()) { ! Container space = (Container)iter.next(); Instance instance = new Instance("Instance of " + space.getName()); instance.setProto(space); *************** *** 268,272 **** if (s.size() == 1) { // Some options do only apply to one space ! Space sp = (Space)s.iterator().next(); AbstractAction edit = new SpaceMenuAction(sp, "Edit") { --- 267,271 ---- if (s.size() == 1) { // Some options do only apply to one space ! Container sp = (Container)s.iterator().next(); AbstractAction edit = new SpaceMenuAction(sp, "Edit") { *************** *** 312,316 **** AbstractAction action = new SpaceMenuAction(sp, "Normals") { public void actionPerformed(ActionEvent event) { ! Space union = new Container("Normals", Space.CONSTRUCTION, true); for (Surface surface : space.getSurfaces()) { Vertex normal = surface.normal(); --- 311,315 ---- 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(); *************** *** 319,323 **** CoordinateSystem system = CoordinateSystem.systemFor(origin, normal); ! Space pyramid = Command.Pyramid.pyramid(0.05, 0.05, 0.2); for (Vertex current : pyramid.getVertices()) { current.set(system.unTranslate(current)); --- 318,322 ---- CoordinateSystem system = CoordinateSystem.systemFor(origin, normal); ! Container pyramid = Command.Pyramid.pyramid(0.05, 0.05, 0.2); for (Vertex current : pyramid.getVertices()) { current.set(system.unTranslate(current)); *************** *** 520,524 **** HashMap map = new HashMap(); Mesh copy = mesh.copy(map); ! Space union = new Container("Union", Space.CONSTRUCTION, true); union.setUnion(true); for (Vertex current : copy.vertices()) { --- 519,523 ---- 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()) { *************** *** 531,535 **** union.add(current); } ! for (Space current : copy.elements()) { union.add(current); } --- 530,534 ---- union.add(current); } ! for (Container current : copy.elements()) { union.add(current); } *************** *** 755,759 **** } } ! if (type instanceof Space) { return PopupMenu.getSpaceMenu(new LinkedList<Geometric>(Selection.primary())); } else if (type instanceof Surface) { --- 754,758 ---- } } ! if (type instanceof Container) { return PopupMenu.getSpaceMenu(new LinkedList<Geometric>(Selection.primary())); } else if (type instanceof Surface) { *************** *** 777,781 **** AbstractAction planeanalysis = new AbstractAction("Plane Analysis") { public void actionPerformed(ActionEvent arg0) { ! Space space = Project.getInstance().getActiveSpace(); SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.clearPlanes(space); --- 776,780 ---- AbstractAction planeanalysis = new AbstractAction("Plane Analysis") { public void actionPerformed(ActionEvent arg0) { ! Container space = Project.getInstance().getActiveSpace(); SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.clearPlanes(space); *************** *** 793,797 **** AbstractAction clearplanes = new AbstractAction("Delete Planes") { public void actionPerformed(ActionEvent arg0) { ! Space space = Project.getInstance().getActiveSpace(); SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.clearPlanes(space); --- 792,796 ---- AbstractAction clearplanes = new AbstractAction("Delete Planes") { public void actionPerformed(ActionEvent arg0) { ! Container space = Project.getInstance().getActiveSpace(); SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.clearPlanes(space); *************** *** 803,807 **** AbstractAction surfaceanalysis = new AbstractAction("Surface Analysis") { public void actionPerformed(ActionEvent arg0) { ! Space space = Project.getInstance().getActiveSpace(); SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.surfaceAnalysis(space); --- 802,806 ---- AbstractAction surfaceanalysis = new AbstractAction("Surface Analysis") { public void actionPerformed(ActionEvent arg0) { ! Container space = Project.getInstance().getActiveSpace(); SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.surfaceAnalysis(space); *************** *** 813,817 **** AbstractAction clearsurfaces = new AbstractAction("Delete Surfaces") { public void actionPerformed(ActionEvent arg0) { ! Space space = Project.getInstance().getActiveSpace(); SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.clearSurfaces(space); --- 812,816 ---- AbstractAction clearsurfaces = new AbstractAction("Delete Surfaces") { public void actionPerformed(ActionEvent arg0) { ! Container space = Project.getInstance().getActiveSpace(); SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.clearSurfaces(space); Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** GUI.java 12 Dec 2007 10:48:19 -0000 1.87 --- GUI.java 13 Dec 2007 12:00:55 -0000 1.88 *************** *** 36,40 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; --- 36,40 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 115,119 **** /** closed spaces */ ! private Set<Space> closedSpaces = new HashSet<Space>(); /** The browsing tree */ --- 115,119 ---- /** closed spaces */ ! private Set<Container> closedSpaces = new HashSet<Container>(); /** The browsing tree */ *************** *** 270,275 **** create.removeAll(); int lvl = Project.getInstance().getActiveSpace().getLevel(); ! if (lvl < Space.PART_LEVEL) { ! String append = Space.levelToString(lvl + 1); JMenuItem createFunctionalSpace = new JMenuItem("Functional " + append); --- 270,275 ---- create.removeAll(); int lvl = Project.getInstance().getActiveSpace().getLevel(); ! if (lvl < Container.PART_LEVEL) { ! String append = Container.levelToString(lvl + 1); JMenuItem createFunctionalSpace = new JMenuItem("Functional " + append); *************** *** 294,298 **** public void actionPerformed(ActionEvent e) { System.out.println("actionate " + modellor); ! Space space = modellor.createSpace(); Project.getInstance().world().add(space); Project.getInstance().changed(Project.getInstance()); --- 294,298 ---- public void actionPerformed(ActionEvent e) { System.out.println("actionate " + modellor); ! Container space = modellor.createSpace(); Project.getInstance().world().add(space); Project.getInstance().changed(Project.getInstance()); *************** *** 317,321 **** JMenu jm = (JMenu)e.getSource(); jm.removeAll(); ! Space s = Project.getInstance().getActiveSpace(); int level = s.getLevel(); for (Modellor m : Modellor.getRegisteredModellors()) { --- 317,321 ---- JMenu jm = (JMenu)e.getSource(); jm.removeAll(); ! Container s = Project.getInstance().getActiveSpace(); int level = s.getLevel(); for (Modellor m : Modellor.getRegisteredModellors()) { *************** *** 404,408 **** while (iter.hasNext()) { Geometric g = iter.next(); ! if (g instanceof Space) { // nothing } else if (g instanceof Edge) { --- 404,408 ---- while (iter.hasNext()) { Geometric g = iter.next(); ! if (g instanceof Container) { // nothing } else if (g instanceof Edge) { *************** *** 752,756 **** * @return wherther or not the space is closed. */ ! public boolean isClosed(Space sp) { boolean closed = closedSpaces.contains(sp); return closed; --- 752,756 ---- * @return wherther or not the space is closed. */ ! public boolean isClosed(Container sp) { boolean closed = closedSpaces.contains(sp); return closed; |
From: Michael L. <he...@us...> - 2007-12-13 12:00:58
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20795/src/net/sourceforge/bprocessor/gui/attrview Modified Files: ClassificationTextAttribute.java LinkAttribute.java Log Message: Major change wrt Space/Container Index: ClassificationTextAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/ClassificationTextAttribute.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ClassificationTextAttribute.java 9 Aug 2007 16:07:48 -0000 1.10 --- ClassificationTextAttribute.java 13 Dec 2007 12:00:55 -0000 1.11 *************** *** 40,44 **** import net.sourceforge.bprocessor.model.Classification; import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Structure; --- 40,44 ---- import net.sourceforge.bprocessor.model.Classification; import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Structure; *************** *** 318,327 **** Vector cur = ((Structure) attribute.getValue()).getChildren(); if (attribute.getValue() instanceof Classification) { ! if (((Classification) attribute.getValue()).getType() == Space.CONSTRUCTION) { cur.addAll(Project.getInstance().getClassification("-99", ! Space.CONSTRUCTION).getChildren()); ! } else if (((Classification) attribute.getValue()).getType() == Space.FUNCTIONAL) { cur.addAll(Project.getInstance().getClassification("-99", ! Space.FUNCTIONAL).getChildren()); } else { log.warn(((Classification) attribute.getValue()).getType() + " is a unknown type"); --- 318,327 ---- Vector cur = ((Structure) attribute.getValue()).getChildren(); if (attribute.getValue() instanceof Classification) { ! if (((Classification) attribute.getValue()).getType() == Container.CONSTRUCTION) { cur.addAll(Project.getInstance().getClassification("-99", ! Container.CONSTRUCTION).getChildren()); ! } else if (((Classification) attribute.getValue()).getType() == Container.FUNCTIONAL) { cur.addAll(Project.getInstance().getClassification("-99", ! Container.FUNCTIONAL).getChildren()); } else { log.warn(((Classification) attribute.getValue()).getType() + " is a unknown type"); Index: LinkAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/LinkAttribute.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** LinkAttribute.java 14 Apr 2007 15:00:42 -0000 1.17 --- LinkAttribute.java 13 Dec 2007 12:00:55 -0000 1.18 *************** *** 37,41 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Space; /** --- 37,41 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Container; /** *************** *** 174,179 **** JLabel valueLabel; if (value instanceof Entity) { ! if (value instanceof Space) { ! s = ((Space)value).getDisplayName(); } else { s = ((Entity)value).getName(); --- 174,179 ---- JLabel valueLabel; if (value instanceof Entity) { ! if (value instanceof Container) { ! s = ((Container)value).getDisplayName(); } else { s = ((Entity)value).getName(); *************** *** 410,414 **** new Comparator() { public int compare(Object s1, Object s2) { ! return ((Space) s1).getName().compareToIgnoreCase(((Space) s2).getName()); } }; --- 410,414 ---- new Comparator() { public int compare(Object s1, Object s2) { ! return ((Container) s1).getName().compareToIgnoreCase(((Container) s2).getName()); } }; *************** *** 417,421 **** new Comparator() { public int compare(Object s1, Object s2) { ! return ((Space) s1).getId().compareTo(((Space) s2).getId()); } }; --- 417,421 ---- new Comparator() { public int compare(Object s1, Object s2) { ! return ((Container) s1).getId().compareTo(((Container) s2).getId()); } }; *************** *** 427,431 **** Iterator it = sort.iterator(); while (it.hasNext()) { ! Space current = (Space) it.next(); String name = current.getName() + "-" + current.getId().toString(); if (name.startsWith(string) && !name.equalsIgnoreCase(string)) { --- 427,431 ---- Iterator it = sort.iterator(); while (it.hasNext()) { ! Container current = (Container) it.next(); String name = current.getName() + "-" + current.getId().toString(); if (name.startsWith(string) && !name.equalsIgnoreCase(string)) { |
From: Michael L. <he...@us...> - 2007-12-13 12:00:56
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20795/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Major change wrt Space/Container Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.133 retrieving revision 1.134 diff -C2 -d -r1.133 -r1.134 *** GenericTreeView.java 12 Dec 2007 14:12:19 -0000 1.133 --- GenericTreeView.java 13 Dec 2007 12:00:55 -0000 1.134 *************** *** 38,41 **** --- 38,42 ---- import org.apache.log4j.Logger; + import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Camera; *************** *** 54,58 **** import net.sourceforge.bprocessor.model.Relation; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; --- 55,59 ---- import net.sourceforge.bprocessor.model.Relation; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 634,638 **** makeInstanceContent((Instance) space); } else if (space.isContainer()) { ! makeContainerContent(space); } else { Set surfaces = space.getEnvelope(); --- 635,639 ---- makeInstanceContent((Instance) space); } else if (space.isContainer()) { ! makeContainerContent((Container) space); } else { Set surfaces = space.getEnvelope(); *************** *** 645,651 **** * @param space the space */ ! private void makeContainerContent(Space space) { add(new EnvelopeContainer("Envelope", space)); ! String lvlstr = Space.levelToString(space.getLevel() + 1); add(new ElementContainer(lvlstr + "s", space.getElements())); if (Project.doDisplayGeometry()) { --- 646,652 ---- * @param space the space */ ! private void makeContainerContent(Container space) { add(new EnvelopeContainer("Envelope", space)); ! String lvlstr = Container.levelToString(space.getLevel() + 1); add(new ElementContainer(lvlstr + "s", space.getElements())); if (Project.doDisplayGeometry()) { *************** *** 679,684 **** */ public void update(Object o) { ! if (o instanceof Space) { ! Space s = (Space)o; if (s.isInstance()) { Instance instance = (Instance) s; --- 680,685 ---- */ public void update(Object o) { ! if (o instanceof Container) { ! Space s = (Container)o; if (s.isInstance()) { Instance instance = (Instance) s; *************** *** 693,697 **** } } else if (s.isContainer()) { ! Space space = (Space)userObject; if (space.isContainer()) { int inx = 0; --- 694,698 ---- } } else if (s.isContainer()) { ! Container space = (Container)userObject; if (space.isContainer()) { int inx = 0; *************** *** 719,723 **** } else { removeAllChildren(); ! makeContainerContent(s); model.nodeStructureChanged(this); } --- 720,724 ---- } else { removeAllChildren(); ! makeContainerContent((Container) s); model.nodeStructureChanged(this); } *************** *** 742,752 **** public String toString() { String nid = ((Space)userObject).getDisplayName(); - if (TAG) { - if (GUI.getInstance().isClosed(((Space)userObject))) { - nid += " (C)"; - } else { - nid += " (O)"; - } - } return nid; } --- 743,746 ---- *************** *** 801,805 **** */ public class EnvelopeNode extends EntityNode { ! private Space space; /** --- 795,799 ---- */ public class EnvelopeNode extends EntityNode { ! private Container space; /** *************** *** 808,812 **** * @param space Space */ ! public EnvelopeNode(Surface surface, Space space) { super(surface); this.space = space; --- 802,806 ---- * @param space Space */ ! public EnvelopeNode(Surface surface, Container space) { super(surface); this.space = space; *************** *** 818,822 **** public String toString() { Surface surface = (Surface) userObject; ! Space other; if (surface.getBackDomain() == space) { other = surface.getFrontDomain(); --- 812,816 ---- public String toString() { Surface surface = (Surface) userObject; ! Container other; if (surface.getBackDomain() == space) { other = surface.getFrontDomain(); *************** *** 973,977 **** */ public class EnvelopeContainer extends ContainerNode { ! private Space space; /** * Constructor for SurfaceContainer --- 967,971 ---- */ public class EnvelopeContainer extends ContainerNode { ! private Container space; /** * Constructor for SurfaceContainer *************** *** 979,983 **** * @param space Space */ ! public EnvelopeContainer(String name, Space space) { super(name); this.space = space; --- 973,977 ---- * @param space Space */ ! public EnvelopeContainer(String name, Container space) { super(name); this.space = space; *************** *** 1015,1019 **** /** {@inheritDoc} */ public EntityNode nodeFor(Object entity) { ! return new SpaceNode((Space) entity); } --- 1009,1013 ---- /** {@inheritDoc} */ public EntityNode nodeFor(Object entity) { ! return new SpaceNode((Container) entity); } *************** *** 1036,1040 **** * @param space The space */ ! public GeometryNode(String name, Space space) { super(name); add(new SurfaceContainer("Surfaces", space.getSurfaces(), true)); --- 1030,1034 ---- * @param space The space */ ! public GeometryNode(String name, Container space) { super(name); add(new SurfaceContainer("Surfaces", space.getSurfaces(), true)); *************** *** 1047,1051 **** */ public void update(Object o) { ! Space space = (Space)o; updateChild(0, space.getSurfaces()); updateChild(1, space.getEdges()); --- 1041,1045 ---- */ public void update(Object o) { ! Container space = (Container)o; updateChild(0, space.getSurfaces()); updateChild(1, space.getEdges()); *************** *** 1246,1253 **** public void actionPerformed(ActionEvent e) { Project proj = Project.getInstance(); ! Space world = proj.getActiveSpace(); for (Object o : col) { Component lo = (Component)o; ! Space space = lo.getSpace(); Instance instance = new Instance(space.getName() + " instance "); proj.addCalalogObject(lo); --- 1240,1247 ---- public void actionPerformed(ActionEvent e) { Project proj = Project.getInstance(); ! Container world = proj.getActiveSpace(); for (Object o : col) { Component lo = (Component)o; ! Container space = lo.getSpace(); Instance instance = new Instance(space.getName() + " instance "); proj.addCalalogObject(lo); |
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20756/src/net/sourceforge/bprocessor/gl/tool Modified Files: PasteActionListener.java ExtrusionTool.java SpaceTool.java EdgeMoveTool.java FinalMoveTool.java AbstractPencil.java ExtendTool.java AbstractTool.java ShiftActionListener.java SelectStrategy.java CopyActionListener.java DomainPopupListener.java AltMoveTool.java ClickBox.java CreateSpaceActionListener.java Log Message: Major change wrt Space/Container Index: CreateSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CreateSpaceActionListener.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** CreateSpaceActionListener.java 28 Nov 2007 10:39:21 -0000 1.23 --- CreateSpaceActionListener.java 13 Dec 2007 12:00:49 -0000 1.24 *************** *** 14,18 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Surface; ! import net.sourceforge.bprocessor.model.Space; /** --- 14,18 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Surface; ! import net.sourceforge.bprocessor.model.Container; /** *************** *** 46,51 **** */ public void actionPerformed(ActionEvent event) { ! Space owner = surface.getOwner(); ! Space space; if (functional) { space = owner.createFunctionalSpace(""); --- 46,51 ---- */ public void actionPerformed(ActionEvent event) { ! Container owner = surface.getOwner(); ! Container space; if (functional) { space = owner.createFunctionalSpace(""); Index: EdgeMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/EdgeMoveTool.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** EdgeMoveTool.java 11 Dec 2007 14:49:11 -0000 1.7 --- EdgeMoveTool.java 13 Dec 2007 12:00:49 -0000 1.8 *************** *** 30,34 **** import net.sourceforge.bprocessor.model.Relation; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; --- 30,34 ---- import net.sourceforge.bprocessor.model.Relation; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 133,137 **** coordMap = new HashMap<Surface, CoordinateSystem>(); swiwel = new HashMap<Surface, Line>(); ! Space space = edge.getOwner(); // find relations Collection<CoordinateSystem> systems = space.getCoordinateSystems(); --- 133,137 ---- coordMap = new HashMap<Surface, CoordinateSystem>(); swiwel = new HashMap<Surface, Line>(); ! Container space = edge.getOwner(); // find relations Collection<CoordinateSystem> systems = space.getCoordinateSystems(); Index: PasteActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PasteActionListener.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PasteActionListener.java 4 Jan 2006 14:29:50 -0000 1.4 --- PasteActionListener.java 13 Dec 2007 12:00:49 -0000 1.5 *************** *** 10,14 **** import java.awt.event.ActionListener; import net.sourceforge.bprocessor.gl.view.View; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; --- 10,14 ---- import java.awt.event.ActionListener; import net.sourceforge.bprocessor.gl.view.View; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; *************** *** 46,51 **** */ public void actionPerformed(ActionEvent e) { ! Space facing = CopyActionListener.getFacing(); ! Space nonFacing = CopyActionListener.getNonFacing(); if (view.facingFront(surface)) { surface.setFrontDomain(facing); --- 46,51 ---- */ public void actionPerformed(ActionEvent e) { ! Container facing = CopyActionListener.getFacing(); ! Container nonFacing = CopyActionListener.getNonFacing(); if (view.facingFront(surface)) { surface.setFrontDomain(facing); Index: DomainPopupListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/DomainPopupListener.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DomainPopupListener.java 21 Nov 2007 09:21:17 -0000 1.8 --- DomainPopupListener.java 13 Dec 2007 12:00:49 -0000 1.9 *************** *** 12,16 **** import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; --- 12,16 ---- import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; *************** *** 21,25 **** public class DomainPopupListener implements ActionListener { /** The domain */ ! private Space domain; /** The Surface */ --- 21,25 ---- public class DomainPopupListener implements ActionListener { /** The domain */ ! private Container domain; /** The Surface */ *************** *** 36,40 **** * @param front werther or not this popup for the front of the back of the surface */ ! public DomainPopupListener(Space domain, Surface surface, boolean front) { this.domain = domain; this.surface = surface; --- 36,40 ---- * @param front werther or not this popup for the front of the back of the surface */ ! public DomainPopupListener(Container domain, Surface surface, boolean front) { this.domain = domain; this.surface = surface; *************** *** 48,52 **** public void actionPerformed(ActionEvent arg0) { if (front) { ! Space oldFront = surface.getFrontDomain(); surface.assignFront(domain, Editor.isMulti()); if (oldFront != null) { --- 48,52 ---- public void actionPerformed(ActionEvent arg0) { if (front) { ! Container oldFront = surface.getFrontDomain(); surface.assignFront(domain, Editor.isMulti()); if (oldFront != null) { *************** *** 54,58 **** } } else { ! Space oldBack = surface.getBackDomain(); surface.assignBack(domain, Editor.isMulti()); if (oldBack != null) { --- 54,58 ---- } } else { ! Container oldBack = surface.getBackDomain(); surface.assignBack(domain, Editor.isMulti()); if (oldBack != null) { Index: CopyActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CopyActionListener.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CopyActionListener.java 11 Dec 2005 17:50:58 -0000 1.3 --- CopyActionListener.java 13 Dec 2007 12:00:49 -0000 1.4 *************** *** 11,15 **** import net.sourceforge.bprocessor.gl.view.View; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; --- 11,15 ---- import net.sourceforge.bprocessor.gl.view.View; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; *************** *** 27,35 **** * The copied domain facing the camera */ ! private static Space facing = null; /** * The copied domain not facing the camera */ ! private static Space nonFacing = null; /** * The surface this listener shifts spaces on --- 27,35 ---- * The copied domain facing the camera */ ! private static Container facing = null; /** * The copied domain not facing the camera */ ! private static Container nonFacing = null; /** * The surface this listener shifts spaces on *************** *** 66,70 **** * @return the domain */ ! public static Space getFacing() { return facing; } --- 66,70 ---- * @return the domain */ ! public static Container getFacing() { return facing; } *************** *** 73,77 **** * @return the domain */ ! public static Space getNonFacing() { return nonFacing; } --- 73,77 ---- * @return the domain */ ! public static Container getNonFacing() { return nonFacing; } Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** ExtrusionTool.java 11 Dec 2007 14:49:11 -0000 1.74 --- ExtrusionTool.java 13 Dec 2007 12:00:49 -0000 1.75 *************** *** 31,35 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; --- 31,35 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 88,92 **** * @param extrusion Collection of surfaces */ ! protected static void insert(Space space, Collection<Surface> extrusion) { Collection<Edge> edges = Surface.edges(extrusion); Collection<Vertex> vertices = Edge.vertices(edges); --- 88,92 ---- * @param extrusion Collection of surfaces */ ! protected static void insert(Container space, Collection<Surface> extrusion) { Collection<Edge> edges = Surface.edges(extrusion); Collection<Vertex> vertices = Edge.vertices(edges); *************** *** 103,107 **** */ private void extrudeOnto(Plane plane, boolean all, boolean finish) { ! Space space = Project.getInstance().getActiveSpace(); if (extrusion != null) { space.removeProtected(extrusion); --- 103,107 ---- */ private void extrudeOnto(Plane plane, boolean all, boolean finish) { ! Container space = Project.getInstance().getActiveSpace(); if (extrusion != null) { space.removeProtected(extrusion); *************** *** 142,146 **** */ private void extrudeEdgesOnto(Plane plane, boolean finish) { ! Space space = Project.getInstance().getActiveSpace(); if (extrusion != null) { space.removeProtected(extrusion); --- 142,146 ---- */ private void extrudeEdgesOnto(Plane plane, boolean finish) { ! Container space = Project.getInstance().getActiveSpace(); if (extrusion != null) { space.removeProtected(extrusion); Index: ClickBox.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ClickBox.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ClickBox.java 25 Jan 2007 12:14:30 -0000 1.1 --- ClickBox.java 13 Dec 2007 12:00:49 -0000 1.2 *************** *** 7,11 **** package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.model.Space; /** --- 7,11 ---- package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.model.Container; /** *************** *** 14,23 **** */ public class ClickBox { ! private Space space; /** * @param space Space */ ! public ClickBox(Space space) { this.space = space; } --- 14,23 ---- */ public class ClickBox { ! private Container space; /** * @param space Space */ ! public ClickBox(Container space) { this.space = space; } *************** *** 26,30 **** * @return space */ ! public Space space() { return space; } --- 26,30 ---- * @return space */ ! public Container space() { return space; } Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.144 retrieving revision 1.145 diff -C2 -d -r1.144 -r1.145 *** AbstractTool.java 12 Dec 2007 15:07:01 -0000 1.144 --- AbstractTool.java 13 Dec 2007 12:00:49 -0000 1.145 *************** *** 9,13 **** import net.sourceforge.bprocessor.model.AxisRotate; import net.sourceforge.bprocessor.model.Camera; - import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; --- 9,12 ---- *************** *** 18,22 **** import net.sourceforge.bprocessor.model.Scale; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Transform; --- 17,21 ---- import net.sourceforge.bprocessor.model.Scale; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Transform; *************** *** 781,785 **** public void evaluate(Environment env, Stack<Object> stack) { Surface surface = (Surface) env.get(0); ! Space space = (Space) env.get(1); surface.setFrontDomain(space); } --- 780,784 ---- public void evaluate(Environment env, Stack<Object> stack) { Surface surface = (Surface) env.get(0); ! Container space = (Container) env.get(1); surface.setFrontDomain(space); } *************** *** 788,792 **** public void evaluate(Environment env, Stack<Object> stack) { Surface surface = (Surface) env.get(0); ! Space space = (Space) env.get(1); surface.setBackDomain(space); } --- 787,791 ---- public void evaluate(Environment env, Stack<Object> stack) { Surface surface = (Surface) env.get(0); ! Container space = (Container) env.get(1); surface.setBackDomain(space); } *************** *** 795,799 **** public void evaluate(Environment env, Stack<Object> stack) { String name = (String) env.get(0); ! Space result = new Container(name, Space.CONSTRUCTION, true); stack.push(result); } --- 794,798 ---- 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); } Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** SpaceTool.java 10 Dec 2007 12:08:21 -0000 1.100 --- SpaceTool.java 13 Dec 2007 12:00:49 -0000 1.101 *************** *** 37,41 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; --- 37,41 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 154,158 **** Surface surface = null; ! Space space = null; { --- 154,158 ---- Surface surface = null; ! Container space = null; { *************** *** 182,186 **** JMenuItem voidItem = new JMenuItem("Void"); ! Space sp = Project.getInstance().getActiveSpace(); ActionListener voidListener = new DomainPopupListener(sp.getEmpty(), --- 182,186 ---- JMenuItem voidItem = new JMenuItem("Void"); ! Container sp = Project.getInstance().getActiveSpace(); ActionListener voidListener = new DomainPopupListener(sp.getEmpty(), *************** *** 191,208 **** Collection domains = null; String category = null; ! Space owner = space.getOwner(); ! if (space.getLevel() == Space.PROJECT_LEVEL) { domains = Project.getInstance().getSpaces(); category = "Project"; ! } else if (space.getLevel() == Space.SPACE_LEVEL) { domains = owner.getElements(); category = "Space"; ! } else if (space.getLevel() == Space.ELEMENT_LEVEL) { domains = owner.getElements(); category = "Element"; ! } else if (space.getLevel() == Space.PART_LEVEL) { domains = owner.getElements(); category = "Part"; --- 191,208 ---- Collection domains = null; String category = null; ! Container owner = space.getOwner(); ! if (space.getLevel() == Container.PROJECT_LEVEL) { domains = Project.getInstance().getSpaces(); category = "Project"; ! } else if (space.getLevel() == Container.SPACE_LEVEL) { domains = owner.getElements(); category = "Space"; ! } else if (space.getLevel() == Container.ELEMENT_LEVEL) { domains = owner.getElements(); category = "Element"; ! } else if (space.getLevel() == Container.PART_LEVEL) { domains = owner.getElements(); category = "Part"; *************** *** 259,263 **** Iterator domIt = domains.iterator(); while (domIt.hasNext()) { ! Space domain = (Space)domIt.next(); JMenuItem domainItem = new JMenuItem(domain.getDisplayName()); ActionListener ml = new DomainPopupListener(domain, --- 259,263 ---- Iterator domIt = domains.iterator(); while (domIt.hasNext()) { ! Container domain = (Container)domIt.next(); JMenuItem domainItem = new JMenuItem(domain.getDisplayName()); ActionListener ml = new DomainPopupListener(domain, *************** *** 296,304 **** Stack stack = evaluateString(value); if (stack != null) { ! Space space = Project.getInstance().getActiveSpace(); Collection<Vertex> vertices = new LinkedList<Vertex>(); Collection<Edge> edges = new LinkedList<Edge>(); Collection<Surface> surfaces = new LinkedList<Surface>(); ! Collection<Space> spaces = new LinkedList<Space>(); while (!stack.empty()) { --- 296,304 ---- Stack stack = evaluateString(value); if (stack != null) { ! Container space = Project.getInstance().getActiveSpace(); Collection<Vertex> vertices = new LinkedList<Vertex>(); Collection<Edge> edges = new LinkedList<Edge>(); Collection<Surface> surfaces = new LinkedList<Surface>(); ! Collection<Container> spaces = new LinkedList<Container>(); while (!stack.empty()) { *************** *** 310,315 **** } else if (result instanceof Surface) { surfaces.add((Surface)result); ! } else if (result instanceof Space) { ! Space s = (Space) result; spaces.add(s); space.add(s); --- 310,315 ---- } else if (result instanceof Surface) { surfaces.add((Surface)result); ! } else if (result instanceof Container) { ! Container s = (Container) result; spaces.add(s); space.add(s); Index: ExtendTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtendTool.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ExtendTool.java 7 Dec 2007 12:48:31 -0000 1.2 --- ExtendTool.java 13 Dec 2007 12:00:49 -0000 1.3 *************** *** 27,31 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; --- 27,31 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 220,224 **** private void finishTool() { ! Space owner = Project.getInstance().getActiveSpace(); owner.removeProtected(extrusion); if (pressedSurface != null && --- 220,224 ---- private void finishTool() { ! Container owner = Project.getInstance().getActiveSpace(); owner.removeProtected(extrusion); if (pressedSurface != null && Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** FinalMoveTool.java 12 Dec 2007 14:38:47 -0000 1.42 --- FinalMoveTool.java 13 Dec 2007 12:00:49 -0000 1.43 *************** *** 32,36 **** import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; ! import net.sourceforge.bprocessor.model.Space; /** --- 32,36 ---- import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; ! import net.sourceforge.bprocessor.model.Container; /** *************** *** 40,44 **** private Collection<Geometric> geometrics; ! private Space owner; private Collection<Geometric> affected; --- 40,44 ---- private Collection<Geometric> geometrics; ! private Container owner; private Collection<Geometric> affected; Index: ShiftActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ShiftActionListener.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ShiftActionListener.java 4 Jan 2006 14:29:50 -0000 1.4 --- ShiftActionListener.java 13 Dec 2007 12:00:49 -0000 1.5 *************** *** 10,14 **** import java.awt.event.ActionListener; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; --- 10,14 ---- import java.awt.event.ActionListener; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; *************** *** 42,47 **** */ public void actionPerformed(ActionEvent e) { ! Space back = surface.getBackDomain(); ! Space front = surface.getFrontDomain(); surface.setFrontDomain(back); --- 42,47 ---- */ public void actionPerformed(ActionEvent e) { ! Container back = surface.getBackDomain(); ! Container front = surface.getFrontDomain(); surface.setFrontDomain(back); Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** AbstractPencil.java 11 Dec 2007 14:49:11 -0000 1.101 --- AbstractPencil.java 13 Dec 2007 12:00:49 -0000 1.102 *************** *** 37,41 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; --- 37,41 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 237,241 **** if (intersection != null) { ! Space space = Project.getInstance().getActiveSpace(); Vertex v = intersection.vertex(); if (intersection.type() == Intersection.VERTEX) { --- 237,241 ---- if (intersection != null) { ! Container space = Project.getInstance().getActiveSpace(); Vertex v = intersection.vertex(); if (intersection.type() == Intersection.VERTEX) { Index: SelectStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectStrategy.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** SelectStrategy.java 7 Dec 2007 14:38:53 -0000 1.23 --- SelectStrategy.java 13 Dec 2007 12:00:49 -0000 1.24 *************** *** 25,29 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; --- 25,29 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 186,190 **** if (extended.isEmpty()) { //Move out one space/union level if possible ! Space sp = Project.getInstance().getActiveSpace(); if (sp.getOwner() != null) { sp.getOwner().edit(); --- 186,190 ---- if (extended.isEmpty()) { //Move out one space/union level if possible ! Container sp = Project.getInstance().getActiveSpace(); if (sp.getOwner() != null) { sp.getOwner().edit(); *************** *** 198,203 **** Surface surface = (Surface) current; extended.addAll(surface.getEdges()); ! } else if (target instanceof Space) { ! Space space = (Space) target; extended.clear(); space.edit(); --- 198,203 ---- Surface surface = (Surface) current; extended.addAll(surface.getEdges()); ! } else if (target instanceof Container) { ! Container space = (Container) target; extended.clear(); space.edit(); Index: AltMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AltMoveTool.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** AltMoveTool.java 11 Dec 2007 14:49:11 -0000 1.16 --- AltMoveTool.java 13 Dec 2007 12:00:49 -0000 1.17 *************** *** 26,30 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; --- 26,30 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 111,115 **** if (target instanceof Surface) { surface = (Surface) target; ! Space space = surface.getOwner(); system = CoordinateSystem.systemOf(surface); --- 111,115 ---- if (target instanceof Surface) { surface = (Surface) target; ! Container space = surface.getOwner(); system = CoordinateSystem.systemOf(surface); |
From: Michael L. <he...@us...> - 2007-12-13 12:00:50
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20756/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java Log Message: Major change wrt Space/Container Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** Display.java 12 Dec 2007 14:38:47 -0000 1.67 --- Display.java 13 Dec 2007 12:00:50 -0000 1.68 *************** *** 28,31 **** --- 28,32 ---- import net.sourceforge.bprocessor.gl.model.GlObject; + import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.ClippingPlane; *************** *** 40,44 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; --- 41,45 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 482,486 **** } ! private static float[] colorOf(Space space) { if (space.isVoid()) { return misty; --- 483,487 ---- } ! private static float[] colorOf(Container space) { if (space.isVoid()) { return misty; *************** *** 503,507 **** gl.glCullFace(GL.GL_BACK); for (Surface current : surfaces) { ! Space front = current.getFrontDomain(); Vertex n = current.normal(); gl.glNormal3d(n.getX(), n.getY(), n.getZ()); --- 504,508 ---- gl.glCullFace(GL.GL_BACK); for (Surface current : surfaces) { ! Container front = current.getFrontDomain(); Vertex n = current.normal(); gl.glNormal3d(n.getX(), n.getY(), n.getZ()); *************** *** 514,518 **** } for (Surface current : surfaces) { ! Space back = current.getBackDomain(); Vertex n = current.normal(); gl.glNormal3d(-n.getX(), -n.getY(), -n.getZ()); --- 515,519 ---- } for (Surface current : surfaces) { ! Container back = current.getBackDomain(); Vertex n = current.normal(); gl.glNormal3d(-n.getX(), -n.getY(), -n.getZ()); *************** *** 800,809 **** } ! private static boolean hidden(Space space) { Collection<Geometric> hidden = camera.getHiddenGeometrics(); return hidden.contains(space); } ! private static boolean transparent(Space space) { if (hidden(space)) { return true; --- 801,810 ---- } ! private static boolean hidden(Container space) { Collection<Geometric> hidden = camera.getHiddenGeometrics(); return hidden.contains(space); } ! private static boolean transparent(Container space) { if (hidden(space)) { return true; *************** *** 823,832 **** private static boolean transparent(Surface surface) { ! Space front = surface.getFrontDomain(); ! Space back = surface.getBackDomain(); return transparent(front) && transparent(back); } ! private static boolean active(Space space) { if (space == null) { return false; --- 824,833 ---- private static boolean transparent(Surface surface) { ! Container front = surface.getFrontDomain(); ! Container back = surface.getBackDomain(); return transparent(front) && transparent(back); } ! private static boolean active(Container space) { if (space == null) { return false; *************** *** 844,848 **** drawInstance((Instance) space, inside); } else { ! drawSpace(space, inside); } } --- 845,849 ---- drawInstance((Instance) space, inside); } else { ! drawSpace((Container) space, inside); } } *************** *** 855,859 **** translateToCoordinatesystem(space); if (USEDL && inside) { ! Space work = space.getProto(); Integer index = displayLists.get(work); if (index != null) { --- 856,860 ---- translateToCoordinatesystem(space); if (USEDL && inside) { ! Container work = space.getProto(); Integer index = displayLists.get(work); if (index != null) { *************** *** 900,904 **** } ! private static void drawSpace(Space space, boolean inside) { Set<Geometric> hidden = new HashSet(); hidden.addAll(camera.getHiddenGeometrics()); --- 901,905 ---- } ! private static void drawSpace(Container space, boolean inside) { Set<Geometric> hidden = new HashSet(); hidden.addAll(camera.getHiddenGeometrics()); *************** *** 1021,1025 **** } } ! Space work = space; while (work != null) { for (Constructor current : work.getConstructors()) { --- 1022,1026 ---- } } ! Container work = space; while (work != null) { for (Constructor current : work.getConstructors()) { *************** *** 1028,1032 **** } } ! work = (Space)work.parent(); } } --- 1029,1033 ---- } } ! work = (Container)work.parent(); } } *************** *** 1140,1144 **** * @param space The last space in the line of translations */ ! private static void translateToCoordinatesystem(Space space) { List<CoordinateSystem> translation = new LinkedList<CoordinateSystem>(); --- 1141,1145 ---- * @param space The last space in the line of translations */ ! private static void translateToCoordinatesystem(Instance space) { List<CoordinateSystem> translation = new LinkedList<CoordinateSystem>(); *************** *** 1191,1195 **** if (space.isInstance()) { gl.glPushMatrix(); ! translateToCoordinatesystem(space); } Collection<Surface> envelope = new LinkedList(space.getEnvelope()); --- 1192,1196 ---- if (space.isInstance()) { gl.glPushMatrix(); ! translateToCoordinatesystem((Instance) space); } Collection<Surface> envelope = new LinkedList(space.getEnvelope()); *************** *** 1290,1295 **** Display.camera = camera; Display.active = Project.getInstance().world(); ! if (geometric instanceof Space) { ! Display.draw((Space)geometric, true); } else if (geometric instanceof Surface) { Display.draw((Surface)geometric, true); --- 1291,1296 ---- Display.camera = camera; Display.active = Project.getInstance().world(); ! if (geometric instanceof Container) { ! Display.draw((Container)geometric, true); } else if (geometric instanceof Surface) { Display.draw((Surface)geometric, true); *************** *** 1314,1318 **** camera = project.getCurrentCamera(); active = project.getActiveSpace(); ! Space world = project.world(); draw(world, world == active); --- 1315,1319 ---- camera = project.getCurrentCamera(); active = project.getActiveSpace(); ! Container world = project.world(); draw(world, world == active); *************** *** 1383,1387 **** if (active.isInstance()) { gl.glPushMatrix(); ! translateToCoordinatesystem(active); } --- 1384,1388 ---- if (active.isInstance()) { gl.glPushMatrix(); ! translateToCoordinatesystem((Instance) active); } Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.271 retrieving revision 1.272 diff -C2 -d -r1.271 -r1.272 *** View.java 13 Dec 2007 08:21:40 -0000 1.271 --- View.java 13 Dec 2007 12:00:49 -0000 1.272 *************** *** 22,25 **** --- 22,26 ---- import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Geometric; + import net.sourceforge.bprocessor.model.Instance; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Camera; *************** *** 27,31 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.Surface; --- 28,32 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.Surface; *************** *** 846,853 **** } ! private void drawPath(LinkedList<Space> path, boolean selection) { LinkedList<Label> labels = new LinkedList<Label>(); boolean first = true; ! for (Space space : path) { if (!first) { labels.add(new Label(">>")); --- 847,854 ---- } ! private void drawPath(LinkedList<Container> path, boolean selection) { LinkedList<Label> labels = new LinkedList<Label>(); boolean first = true; ! for (Container space : path) { if (!first) { labels.add(new Label(">>")); *************** *** 886,892 **** */ private void drawSpacePath(boolean selection) { ! Space active = Project.getInstance().getActiveSpace(); ! Space world = Project.getInstance().world(); ! LinkedList<Space> path = new LinkedList<Space>(); path.add(active); while (active != world) { --- 887,893 ---- */ private void drawSpacePath(boolean selection) { ! Container active = Project.getInstance().getActiveSpace(); ! Container world = Project.getInstance().world(); ! LinkedList<Container> path = new LinkedList<Container>(); path.add(active); while (active != world) { *************** *** 977,982 **** //fix for making label selection work in ortho mode front.setZ(1); ! Space frontDomain = surface.getFrontDomain(); ! Space backDomain = surface.getBackDomain(); String frontName; String backName; --- 978,983 ---- //fix for making label selection work in ortho mode front.setZ(1); ! Container frontDomain = surface.getFrontDomain(); ! Container backDomain = surface.getBackDomain(); String frontName; String backName; *************** *** 1291,1295 **** if (names > 1) { for (int namesIndex = 1; namesIndex < names; namesIndex++) { ! Space instance = (Space)getObject(selectBuffer.get(bufferOffset + namesIndex)); if (unWantedEntities.contains(instance)) { currentPath = null; --- 1292,1296 ---- if (names > 1) { for (int namesIndex = 1; namesIndex < names; namesIndex++) { ! Instance instance = (Instance)getObject(selectBuffer.get(bufferOffset + namesIndex)); if (unWantedEntities.contains(instance)) { currentPath = null; *************** *** 1598,1602 **** if (object instanceof Geometric) { Geometric current = (Geometric) object; ! Space active = Project.getInstance().getActiveSpace(); while (current != null && current.getOwner() != active) { current = current.getOwner(); --- 1599,1603 ---- if (object instanceof Geometric) { Geometric current = (Geometric) object; ! Container active = Project.getInstance().getActiveSpace(); while (current != null && current.getOwner() != active) { current = current.getOwner(); *************** *** 2013,2018 **** */ public void update(Object entity) { ! if (entity instanceof Space) { ! for (Surface s : ((Space)entity).getSurfaces()) { if (DISP) { Integer which = displayLists.remove(s); --- 2014,2019 ---- */ public void update(Object entity) { ! if (entity instanceof Container) { ! for (Surface s : ((Container)entity).getSurfaces()) { if (DISP) { Integer which = displayLists.remove(s); *************** *** 2032,2036 **** if (DISP) { Geometric g = (Geometric)entity; ! Space sp = g.getOwner(); for (Surface s : sp.getSurfaces()) { Integer which = displayLists.remove(s); --- 2033,2037 ---- if (DISP) { Geometric g = (Geometric)entity; ! Container sp = g.getOwner(); for (Surface s : sp.getSurfaces()) { Integer which = displayLists.remove(s); |
From: Michael L. <he...@us...> - 2007-12-13 12:00:50
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20756/src/net/sourceforge/bprocessor/gl/model Modified Files: SpaceBox.java Log Message: Major change wrt Space/Container Index: SpaceBox.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model/SpaceBox.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SpaceBox.java 30 Jan 2007 10:44:04 -0000 1.2 --- SpaceBox.java 13 Dec 2007 12:00:49 -0000 1.3 *************** *** 9,13 **** import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Space; /** --- 9,13 ---- import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Container; /** *************** *** 15,19 **** */ public class SpaceBox extends Label { ! private Space space; /** --- 15,19 ---- */ public class SpaceBox extends Label { ! private Container space; /** *************** *** 21,25 **** * @param space Space */ ! public SpaceBox(Space space) { super(space.getDisplayName()); this.space = space; --- 21,25 ---- * @param space Space */ ! public SpaceBox(Container space) { super(space.getDisplayName()); this.space = space; *************** *** 30,34 **** * @return the space. */ ! public Space space() { return space; } --- 30,34 ---- * @return the space. */ ! public Container space() { return space; } |
From: Michael L. <he...@us...> - 2007-12-13 12:00:41
|
Update of /cvsroot/bprocessor/test/src/net/sourceforge/bprocessor/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20736/src/net/sourceforge/bprocessor/test Modified Files: NormalsBenchmark.java Log Message: Major change wrt Space/Container Index: NormalsBenchmark.java =================================================================== RCS file: /cvsroot/bprocessor/test/src/net/sourceforge/bprocessor/test/NormalsBenchmark.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NormalsBenchmark.java 27 Sep 2007 10:47:47 -0000 1.2 --- NormalsBenchmark.java 13 Dec 2007 12:00:38 -0000 1.3 *************** *** 18,22 **** import net.sourceforge.bprocessor.model.Persistence; import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; --- 18,22 ---- import net.sourceforge.bprocessor.model.Persistence; import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 54,59 **** private static class Empty extends Benchmark { ! private Space space; ! public Empty(Space space) { this.space = space; } --- 54,59 ---- private static class Empty extends Benchmark { ! private Container space; ! public Empty(Container space) { this.space = space; } *************** *** 70,75 **** private static class Count extends Benchmark { ! private Space space; ! public Count(Space space) { this.space = space; } --- 70,75 ---- private static class Count extends Benchmark { ! private Container space; ! public Count(Container space) { this.space = space; } *************** *** 86,93 **** private static class Compute extends Benchmark { ! private Space space; private Surface[] array; ! public Compute(Space space) { this.space = space; Collection surfaces = space.getSurfaces(); --- 86,93 ---- private static class Compute extends Benchmark { ! private Container space; private Surface[] array; ! public Compute(Container space) { this.space = space; Collection surfaces = space.getSurfaces(); *************** *** 105,113 **** private static class Direction extends Benchmark { ! private Space space; private Surface[] array; private CoordinateSystem system; ! public Direction(Space space) { this.space = space; Collection surfaces = space.getSurfaces(); --- 105,113 ---- private static class Direction extends Benchmark { ! private Container space; private Surface[] array; private CoordinateSystem system; ! public Direction(Container space) { this.space = space; Collection surfaces = space.getSurfaces(); *************** *** 127,132 **** private static class ToArray extends Benchmark { ! private Space space; ! public ToArray(Space space) { this.space = space; } --- 127,132 ---- private static class ToArray extends Benchmark { ! private Container space; ! public ToArray(Container space) { this.space = space; } *************** *** 138,144 **** private static class LLToArray extends Benchmark { ! private Space space; private LinkedList list; ! public LLToArray(Space space) { this.space = space; Collection surfaces = space.getSurfaces(); --- 138,144 ---- private static class LLToArray extends Benchmark { ! private Container space; private LinkedList list; ! public LLToArray(Container space) { this.space = space; Collection surfaces = space.getSurfaces(); *************** *** 154,160 **** private static class Normals extends Benchmark { ! private Space space; ! public Normals(Space space) { this.space = space; } --- 154,160 ---- private static class Normals extends Benchmark { ! private Container space; ! public Normals(Container space) { this.space = space; } |
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20690/src/net/sourceforge/bprocessor/model Modified Files: Instance.java Geometry.java EnergyCalc.java Project.java CoordinateSystem.java Persistence.java Edge.java Classification.java SpaceAnalysis.java Surface.java Component.java Camera.java Space.java Geometric.java ClassificationFileReader.java Mesh.java Command.java ClippingPlane.java SurfaceAnalysis.java Log Message: Major change wrt Space/Container Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** CoordinateSystem.java 11 Dec 2007 15:14:13 -0000 1.70 --- CoordinateSystem.java 13 Dec 2007 12:00:31 -0000 1.71 *************** *** 125,129 **** */ public static CoordinateSystem systemOf(Geometric geometric) { ! Space space = geometric.getOwner(); List<CoordinateSystem> result = new LinkedList(); Collection<CoordinateSystem> systems = space.getCoordinateSystems(); --- 125,129 ---- */ public static CoordinateSystem systemOf(Geometric geometric) { ! Container space = geometric.getOwner(); List<CoordinateSystem> result = new LinkedList(); Collection<CoordinateSystem> systems = space.getCoordinateSystems(); *************** *** 941,945 **** for (Relation relation : relations) { Geometric geometric = relation.geometric(); ! Space space = geometric.getOwner(); Collection<Vertex> vertices = geometric.collect(); Map<Vertex, Vertex> map = space.directionMap(vertices); --- 941,945 ---- for (Relation relation : relations) { Geometric geometric = relation.geometric(); ! Container space = geometric.getOwner(); Collection<Vertex> vertices = geometric.collect(); Map<Vertex, Vertex> map = space.directionMap(vertices); Index: Component.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Component.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Component.java 19 Nov 2007 17:50:21 -0000 1.4 --- Component.java 13 Dec 2007 12:00:31 -0000 1.5 *************** *** 16,20 **** public class Component extends Entity implements Parametric { private File file; ! private Space space = null; private byte useableLevels = 0; private boolean isLocked = false; --- 16,20 ---- public class Component extends Entity implements Parametric { private File file; ! private Container space = null; private byte useableLevels = 0; private boolean isLocked = false; *************** *** 29,33 **** * @param s the space (union) this lib obj encapsulate */ ! public Component(byte usableLvls, File f, Space s) { file = f; useableLevels = usableLvls; --- 29,33 ---- * @param s the space (union) this lib obj encapsulate */ ! public Component(byte usableLvls, File f, Container s) { file = f; useableLevels = usableLvls; *************** *** 40,44 **** * @param union Union */ ! public Component(Space union) { this.space = union; name = union.getName(); --- 40,44 ---- * @param union Union */ ! public Component(Container union) { this.space = union; name = union.getName(); *************** *** 79,83 **** * @return The Space */ ! public Space getSpace() { return space; } --- 79,83 ---- * @return The Space */ ! public Container getSpace() { return space; } *************** *** 87,91 **** * @param s the space */ ! void setSpace(Space s) { space = s; name = s.getName(); --- 87,91 ---- * @param s the space */ ! void setSpace(Container s) { space = s; name = s.getName(); *************** *** 119,126 **** List<Attribute> att = new LinkedList<Attribute>(); att.add(new Attribute("name", getName())); ! att.add(new Attribute("Project", worksAtLevel(Space.PROJECT_LEVEL))); ! att.add(new Attribute("Space", worksAtLevel(Space.SPACE_LEVEL))); ! att.add(new Attribute("Element", worksAtLevel(Space.ELEMENT_LEVEL))); ! att.add(new Attribute("Part", worksAtLevel(Space.PART_LEVEL))); att.add(new Attribute("geometry", getSpace())); att.add(new Attribute("Locked", isLocked())); --- 119,126 ---- List<Attribute> att = new LinkedList<Attribute>(); att.add(new Attribute("name", getName())); ! att.add(new Attribute("Project", worksAtLevel(Container.PROJECT_LEVEL))); ! att.add(new Attribute("Space", worksAtLevel(Container.SPACE_LEVEL))); ! att.add(new Attribute("Element", worksAtLevel(Container.ELEMENT_LEVEL))); ! att.add(new Attribute("Part", worksAtLevel(Container.PART_LEVEL))); att.add(new Attribute("geometry", getSpace())); att.add(new Attribute("Locked", isLocked())); *************** *** 137,141 **** private boolean worksAtLevel(int spaceLevel) { ! int lvl = 1 >> (spaceLevel - Space.PROJECT_LEVEL); if ((getUseLevel() & lvl) == lvl) { return true; --- 137,141 ---- private boolean worksAtLevel(int spaceLevel) { ! int lvl = 1 >> (spaceLevel - Container.PROJECT_LEVEL); if ((getUseLevel() & lvl) == lvl) { return true; Index: SpaceAnalysis.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SpaceAnalysis.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SpaceAnalysis.java 11 Dec 2007 14:49:02 -0000 1.9 --- SpaceAnalysis.java 13 Dec 2007 12:00:31 -0000 1.10 *************** *** 70,74 **** */ public void propagate(Surface surface, int side) { ! Space space = surface.getOwner(); edgemap = new HashMap(); for (Edge current : space.getEdges()) { --- 70,74 ---- */ public void propagate(Surface surface, int side) { ! Container space = surface.getOwner(); edgemap = new HashMap(); for (Edge current : space.getEdges()) { Index: Instance.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Instance.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Instance.java 12 Dec 2007 14:38:43 -0000 1.3 --- Instance.java 13 Dec 2007 12:00:30 -0000 1.4 *************** *** 20,24 **** * a container. */ ! private Space proto; /** A anchor for instances */ --- 20,24 ---- * a container. */ ! private Container proto; /** A anchor for instances */ *************** *** 30,34 **** */ public Instance(String name) { ! super(name, Space.CONSTRUCTION, false); } --- 30,34 ---- */ public Instance(String name) { ! super(name, Container.CONSTRUCTION, false); } *************** *** 44,48 **** * @return proto */ ! public Space getProto() { return proto; } --- 44,48 ---- * @return proto */ ! public Container getProto() { return proto; } *************** *** 52,56 **** * @param space Space */ ! public void setProto(Space space) { this.proto = space; if (proto != null) { --- 52,56 ---- * @param space Space */ ! public void setProto(Container space) { this.proto = space; if (proto != null) { Index: ClassificationFileReader.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClassificationFileReader.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ClassificationFileReader.java 9 Aug 2007 16:07:53 -0000 1.4 --- ClassificationFileReader.java 13 Dec 2007 12:00:31 -0000 1.5 *************** *** 137,146 **** new InputStreamReader( new FileInputStream(locationPrefix + "construction2.txt"), "ISO-8859-1")); ! clas = new Classification("-1", "Constructional", null, Space.CONSTRUCTION); } else { bf = new BufferedReader( new InputStreamReader( new FileInputStream(locationPrefix + "functionals.txt"), "ISO-8859-1")); ! clas = new Classification("-1", "Functional", null, Space.FUNCTIONAL); } current = bf.readLine(); --- 137,146 ---- new InputStreamReader( new FileInputStream(locationPrefix + "construction2.txt"), "ISO-8859-1")); ! clas = new Classification("-1", "Constructional", null, Container.CONSTRUCTION); } else { bf = new BufferedReader( new InputStreamReader( new FileInputStream(locationPrefix + "functionals.txt"), "ISO-8859-1")); ! clas = new Classification("-1", "Functional", null, Container.FUNCTIONAL); } current = bf.readLine(); Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.208 retrieving revision 1.209 diff -C2 -d -r1.208 -r1.209 *** Surface.java 11 Dec 2007 14:49:02 -0000 1.208 --- Surface.java 13 Dec 2007 12:00:31 -0000 1.209 *************** *** 47,53 **** private Set<Surface> holes; ! private Space frontDomain; ! private Space backDomain; private Material frontMaterial; --- 47,53 ---- private Set<Surface> holes; ! private Container frontDomain; ! private Container backDomain; private Material frontMaterial; *************** *** 346,355 **** exterior.removeHole(this); } ! Space back = getBackDomain(); if (back != null) { back.removeSurface(this); setBackDomain(null); } ! Space front = getFrontDomain(); if (front != null) { front.removeSurface(this); --- 346,355 ---- exterior.removeHole(this); } ! Container back = getBackDomain(); if (back != null) { back.removeSurface(this); setBackDomain(null); } ! Container front = getFrontDomain(); if (front != null) { front.removeSurface(this); *************** *** 399,404 **** } } ! Space holeBack = this.getBackDomain(); ! Space holeFront = this.getFrontDomain(); this.setFrontDomain(holeBack); this.setBackDomain(holeFront); --- 399,404 ---- } } ! Container holeBack = this.getBackDomain(); ! Container holeFront = this.getFrontDomain(); this.setFrontDomain(holeBack); this.setBackDomain(holeFront); *************** *** 547,551 **** * @return The copy */ ! public Surface copy(Space space) { HashMap map = new HashMap(); Surface surface = (Surface) copy(map); --- 547,551 ---- * @return The copy */ ! public Surface copy(Container space) { HashMap map = new HashMap(); Surface surface = (Surface) copy(map); *************** *** 583,587 **** * @return copy */ ! public Surface copyall(Space space) { Surface copy = copy(space); Iterator iter = getHoles().iterator(); --- 583,587 ---- * @return copy */ ! public Surface copyall(Container space) { Surface copy = copy(space); Iterator iter = getHoles().iterator(); *************** *** 742,746 **** */ public Surface extrude(double delta, Set<Surface> sides) { ! Space owner = getOwner(); Surface top = extrusion(delta, sides); Collection<Surface> creation = new LinkedList(sides); --- 742,746 ---- */ public Surface extrude(double delta, Set<Surface> sides) { ! Container owner = getOwner(); Surface top = extrusion(delta, sides); Collection<Surface> creation = new LinkedList(sides); *************** *** 1322,1326 **** * @return the backdomain */ ! public Space getBackDomain() { if (backDomain == null && getOwner() != null) { setBackDomain(getOwner().getEmpty()); --- 1322,1326 ---- * @return the backdomain */ ! public Container getBackDomain() { if (backDomain == null && getOwner() != null) { setBackDomain(getOwner().getEmpty()); *************** *** 1333,1337 **** * @param back the domain */ ! public void setBackDomain(Space back) { if (backDomain != back) { if (backDomain != null && --- 1333,1337 ---- * @param back the domain */ ! public void setBackDomain(Container back) { if (backDomain != back) { if (backDomain != null && *************** *** 1352,1356 **** * to nearby surfaces */ ! public void assignBack(Space back, boolean propagate) { setBackDomain(back); if (propagate) { --- 1352,1356 ---- * to nearby surfaces */ ! public void assignBack(Container back, boolean propagate) { setBackDomain(back); if (propagate) { *************** *** 1364,1368 **** * @return the frontdomain */ ! public Space getFrontDomain() { if (frontDomain == null && getOwner() != null) { setFrontDomain(getOwner().getEmpty()); --- 1364,1368 ---- * @return the frontdomain */ ! public Container getFrontDomain() { if (frontDomain == null && getOwner() != null) { setFrontDomain(getOwner().getEmpty()); *************** *** 1378,1382 **** * to nearby surfaces */ ! public void assignFront(Space front, boolean propagate) { setFrontDomain(front); if (propagate) { --- 1378,1382 ---- * to nearby surfaces */ ! public void assignFront(Container front, boolean propagate) { setFrontDomain(front); if (propagate) { *************** *** 1390,1394 **** * @param front the frontdomain */ ! public void setFrontDomain(Space front) { if (frontDomain != front) { if (frontDomain != null) { --- 1390,1394 ---- * @param front the frontdomain */ ! public void setFrontDomain(Container front) { if (frontDomain != front) { if (frontDomain != null) { *************** *** 1409,1413 **** * @param space the space to remove. */ ! public void removeDomain(Space space) { if (space == frontDomain) { setFrontDomain(null); --- 1409,1413 ---- * @param space the space to remove. */ ! public void removeDomain(Container space) { if (space == frontDomain) { setFrontDomain(null); *************** *** 1808,1812 **** Iterator it = Project.getInstance().getSpaces().iterator(); while (it.hasNext()) { ! Space current = (Space) it.next(); String nid = current.getName() + "-" + current.getId().toString(); if (nid.equals(a.getValue())) { --- 1808,1812 ---- Iterator it = Project.getInstance().getSpaces().iterator(); while (it.hasNext()) { ! Container current = (Container) it.next(); String nid = current.getName() + "-" + current.getId().toString(); if (nid.equals(a.getValue())) { *************** *** 1817,1821 **** Iterator it = Project.getInstance().getSpaces().iterator(); while (it.hasNext()) { ! Space current = (Space) it.next(); String nid = current.getName() + "-" + current.getId().toString(); if (nid.equals(a.getValue())) { --- 1817,1821 ---- Iterator it = Project.getInstance().getSpaces().iterator(); while (it.hasNext()) { ! Container current = (Container) it.next(); String nid = current.getName() + "-" + current.getId().toString(); if (nid.equals(a.getValue())) { *************** *** 1919,1932 **** String res = ""; switch (getOwner().getLevel() + 1) { ! case Space.PROJECT_LEVEL: res = "Project Surface"; break; ! case Space.SPACE_LEVEL: res = "Space Surface"; break; ! case Space.ELEMENT_LEVEL: res = "Element Surface"; break; ! case Space.PART_LEVEL: res = "Part Surface"; break; --- 1919,1932 ---- String res = ""; switch (getOwner().getLevel() + 1) { ! case Container.PROJECT_LEVEL: res = "Project Surface"; break; ! case Container.SPACE_LEVEL: res = "Space Surface"; break; ! case Container.ELEMENT_LEVEL: res = "Element Surface"; break; ! case Container.PART_LEVEL: res = "Part Surface"; break; *************** *** 1994,1999 **** */ public static void mergeSpaceAssign(Surface sur1, Surface sur2, Surface onto) { ! Space front = onto.frontDomain; ! Space back = onto.backDomain; Vertex n1 = sur1.normal(); Vertex n2 = sur2.normal(); --- 1994,1999 ---- */ public static void mergeSpaceAssign(Surface sur1, Surface sur2, Surface onto) { ! Container front = onto.frontDomain; ! Container back = onto.backDomain; Vertex n1 = sur1.normal(); Vertex n2 = sur2.normal(); *************** *** 2060,2064 **** * @return true when succes otherwise false */ ! public boolean setOppositeSpace(Space s1, Space s2) { if (getFrontDomain() == s1 && getBackDomain() != s1) { setBackDomain(s2); --- 2060,2064 ---- * @return true when succes otherwise false */ ! public boolean setOppositeSpace(Container s1, Container s2) { if (getFrontDomain() == s1 && getBackDomain() != s1) { setBackDomain(s2); Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.223 retrieving revision 1.224 diff -C2 -d -r1.223 -r1.224 *** Space.java 12 Dec 2007 16:11:49 -0000 1.223 --- Space.java 13 Dec 2007 12:00:31 -0000 1.224 *************** *** 45,65 **** /** union flag */ ! private boolean isUnion; /** net flag */ ! private boolean isNet; /** The name */ ! private String name; /** The Discription */ ! private Description description; /** The envelope (a set of surfaces) */ private Set<Surface> envelope; /** type of space */ ! private int type; /** If the constructionspace is transparent */ ! private boolean transparent; /** --- 45,65 ---- /** union flag */ ! protected boolean isUnion; /** net flag */ ! protected boolean isNet; /** The name */ ! protected String name; /** The Discription */ ! protected Description description; /** The envelope (a set of surfaces) */ private Set<Surface> envelope; /** type of space */ ! protected int type; /** If the constructionspace is transparent */ ! protected boolean transparent; /** *************** *** 69,76 **** * hierarchy */ ! private boolean container; /** The classification */ ! private Classification classification; /** The classification type*/ --- 69,76 ---- * hierarchy */ ! protected boolean container; /** The classification */ ! protected Classification classification; /** The classification type*/ *************** *** 78,85 **** /** The empty space in this space (also called void) */ ! protected Space empty; /** The elements (a list of spaces) */ ! private HashMap<Long, Space> elements; /** The next element id */ --- 78,85 ---- /** The empty space in this space (also called void) */ ! protected Container empty; /** The elements (a list of spaces) */ ! protected HashMap<Long, Space> elements; /** The next element id */ *************** *** 198,203 **** * @return The space */ ! public Space createConstructionSpace(String name) { ! return new Container(name, Space.CONSTRUCTION, true); } --- 198,203 ---- * @return The space */ ! public Container createConstructionSpace(String name) { ! return new Container(name, Container.CONSTRUCTION, true); } *************** *** 207,212 **** * @return The space */ ! public Space createFunctionalSpace(String name) { ! return new Container(name, Space.FUNCTIONAL, true); } --- 207,212 ---- * @return The space */ ! public Container createFunctionalSpace(String name) { ! return new Container(name, Container.FUNCTIONAL, true); } *************** *** 217,222 **** * @return The space */ ! public Space createUnion(String name) { ! Space s = createConstructionSpace(name); s.add(new CoordinateSystem(new Vertex(0, 0, 0))); s.setUnion(true); --- 217,222 ---- * @return The space */ ! public Container createUnion(String name) { ! Container s = createConstructionSpace(name); s.add(new CoordinateSystem(new Vertex(0, 0, 0))); s.setUnion(true); *************** *** 229,234 **** * @return space */ ! public static Space createNet(String name) { ! Space net = new Container(name, Space.FUNCTIONAL, true); net.setNet(true); return net; --- 229,234 ---- * @return space */ ! public static Container createNet(String name) { ! Container net = new Container(name, Container.FUNCTIONAL, true); net.setNet(true); return net; *************** *** 297,301 **** * @param element Space */ ! public void setEmpty(Space element) { empty = element; } --- 297,301 ---- * @param element Space */ ! public void setEmpty(Container element) { empty = element; } *************** *** 305,309 **** * @return Empty */ ! public Space getEmpty() { return empty; } --- 305,309 ---- * @return Empty */ ! public Container getEmpty() { return empty; } *************** *** 371,375 **** } constructors.put(id, c); ! c.setOwner(this); } else { throw new Error("adding constructor to non-container " + this); --- 371,375 ---- } constructors.put(id, c); ! c.setOwner((Container)this); } else { throw new Error("adding constructor to non-container " + this); *************** *** 457,461 **** } vertices.put(id, vertex); ! vertex.setOwner(this); } else { throw new Error("adding vertex to non-container " + this); --- 457,461 ---- } vertices.put(id, vertex); ! vertex.setOwner((Container) this); } else { throw new Error("adding vertex to non-container " + this); *************** *** 481,485 **** */ public Vertex insert(Vertex vertex) { ! Space space = this; if (vertex.getOwner() != null) { if (vertex.getOwner() == space) { --- 481,485 ---- */ public Vertex insert(Vertex vertex) { ! Container space = (Container) this; if (vertex.getOwner() != null) { if (vertex.getOwner() == space) { *************** *** 543,547 **** } edges.put(id, edge); ! edge.setOwner(this); } else { throw new Error("adding edge to non-container " + this); --- 543,547 ---- } edges.put(id, edge); ! edge.setOwner((Container) this); } else { throw new Error("adding edge to non-container " + this); *************** *** 670,674 **** } surfaces.put(id, surface); ! surface.setOwner(this); if (surface.getFrontDomain() == null) { surface.setFrontDomain(empty); --- 670,674 ---- } surfaces.put(id, surface); ! surface.setOwner((Container) this); if (surface.getFrontDomain() == null) { surface.setFrontDomain(empty); *************** *** 722,727 **** Vertex n2 = surface.normal(); double dot = n1.dot(n2); ! Space back; ! Space front; if (dot < 0) { front = surface.getBackDomain(); --- 722,727 ---- Vertex n2 = surface.normal(); double dot = n1.dot(n2); ! Container back; ! Container front; if (dot < 0) { front = surface.getBackDomain(); *************** *** 1003,1007 **** } elements.put(id, element); ! element.setOwner(this); } else { throw new Error("adding element to non-container " + this); --- 1003,1007 ---- } elements.put(id, element); ! element.setOwner((Container) this); } else { throw new Error("adding element to non-container " + this); *************** *** 1013,1017 **** * @param element The space to remove as element */ ! public void remove(Space element) { if (container) { Set surfs = element.getEnvelope(); --- 1013,1017 ---- * @param element The space to remove as element */ ! public void remove(Container element) { if (container) { Set surfs = element.getEnvelope(); *************** *** 1021,1026 **** while (iter.hasNext()) { Surface current = (Surface)iter.next(); ! Space back = current.getBackDomain(); ! Space front = current.getFrontDomain(); if (back == element) { current.setBackDomain(empty); --- 1021,1026 ---- while (iter.hasNext()) { Surface current = (Surface)iter.next(); ! Container back = current.getBackDomain(); ! Container front = current.getFrontDomain(); if (back == element) { current.setBackDomain(empty); *************** *** 1032,1036 **** } if (element != null) { ! Space superSpace = findElement(element); if (superSpace != null) { superSpace.elements.remove(element.getId()); --- 1032,1036 ---- } if (element != null) { ! Container superSpace = findElement(element); if (superSpace != null) { superSpace.elements.remove(element.getId()); *************** *** 1051,1063 **** * is returned. */ ! private Space findElement(Space element) { if (elements != null) { if (elements.get(element.getId()) == element) { ! return this; } else { Iterator it = elements.values().iterator(); while (it.hasNext()) { ! Space space = (Space)it.next(); ! Space result = space.findElement(element); if (result != null) { return result; --- 1051,1063 ---- * is returned. */ ! protected Container findElement(Container element) { if (elements != null) { if (elements.get(element.getId()) == element) { ! return (Container) this; } else { Iterator it = elements.values().iterator(); while (it.hasNext()) { ! Container space = (Container)it.next(); ! Container result = space.findElement(element); if (result != null) { return result; *************** *** 1095,1099 **** */ public boolean isConstructionSpace() { ! return (type == Space.CONSTRUCTION); } --- 1095,1099 ---- */ public boolean isConstructionSpace() { ! return (type == Container.CONSTRUCTION); } *************** *** 1103,1107 **** */ public boolean isFunctionalSpace() { ! return (type == Space.FUNCTIONAL); } --- 1103,1107 ---- */ public boolean isFunctionalSpace() { ! return (type == Container.FUNCTIONAL); } *************** *** 1226,1230 **** } if (getOwner() != null && getOwner().getModellor() != null) { ! Parametric parameters = getOwner().getModellor().get(this); if (parameters != null) { res.add(new Attribute(parameters.getGeneralName(), parameters)); --- 1226,1230 ---- } if (getOwner() != null && getOwner().getModellor() != null) { ! Parametric parameters = getOwner().getModellor().get((Container) this); if (parameters != null) { res.add(new Attribute(parameters.getGeneralName(), parameters)); *************** *** 1252,1256 **** } int lvl = getLevel(); ! return res.concat(Space.levelToString(lvl)); } --- 1252,1256 ---- } int lvl = getLevel(); ! return res.concat(Container.levelToString(lvl)); } *************** *** 1379,1383 **** Iterator iter = getElements().iterator(); while (iter.hasNext()) { ! Space element = (Space) iter.next(); element.collectSurfaces(surfaces); } --- 1379,1383 ---- Iterator iter = getElements().iterator(); while (iter.hasNext()) { ! Container element = (Container) iter.next(); element.collectSurfaces(surfaces); } *************** *** 1391,1395 **** List<Surface> deletion = new LinkedList<Surface>(); for (Surface current : getEnvelope()) { ! Space other; if (current.getFrontDomain() == this) { other = current.getBackDomain(); --- 1391,1395 ---- List<Surface> deletion = new LinkedList<Surface>(); for (Surface current : getEnvelope()) { ! Container other; if (current.getFrontDomain() == this) { other = current.getBackDomain(); *************** *** 1404,1408 **** current.erase(); } ! getOwner().remove(this); } --- 1404,1408 ---- current.erase(); } ! getOwner().remove((Container) this); } *************** *** 1411,1416 **** * @return new space */ ! public Space shallowCopy() { ! Space copy = new Container(); copy.classification = classification; copy.container = container; --- 1411,1416 ---- * @return new space */ ! public Container shallowCopy() { ! Container copy = new Container(); copy.classification = classification; copy.container = container; *************** *** 1484,1488 **** Surface bottom = new Surface(edges); getOwner().add(bottom); ! bottom.setFrontDomain(this); bottom.extrude(zmax - zmin, new HashSet()); } --- 1484,1488 ---- Surface bottom = new Surface(edges); getOwner().add(bottom); ! bottom.setFrontDomain((Container) this); bottom.extrude(zmax - zmin, new HashSet()); } *************** *** 1609,1617 **** if (surface.getOwner() == this) { if (surface.protect()) { ! Space back = surface.getBackDomain(); if (back != null) { back.removeSurface(surface); } ! Space front = surface.getFrontDomain(); if (front != null) { front.removeSurface(surface); --- 1609,1617 ---- if (surface.getOwner() == this) { if (surface.protect()) { ! Container back = surface.getBackDomain(); if (back != null) { back.removeSurface(surface); } ! Container front = surface.getFrontDomain(); if (front != null) { front.removeSurface(surface); *************** *** 1764,1768 **** */ public void edit() { ! Project.getInstance().setActiveSpace(this); Selection.primary().clear(); Project.getInstance().changed(Project.getInstance()); --- 1764,1768 ---- */ public void edit() { ! Project.getInstance().setActiveSpace((Container) this); Selection.primary().clear(); Project.getInstance().changed(Project.getInstance()); *************** *** 1915,1919 **** SurfaceAnalysis analysis = new SurfaceAnalysis(); surfaces.clear(); ! surfaces.addAll(analysis.surfaceAnalysis(this, edges)); for (Surface current : surfaces) { --- 1915,1919 ---- SurfaceAnalysis analysis = new SurfaceAnalysis(); surfaces.clear(); ! surfaces.addAll(analysis.surfaceAnalysis((Container) this, edges)); for (Surface current : surfaces) { Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** Geometry.java 11 Dec 2007 15:14:13 -0000 1.68 --- Geometry.java 13 Dec 2007 12:00:30 -0000 1.69 *************** *** 55,59 **** * @return The collection of edges */ ! public static Collection<Edge> getActiveEdges(Space s) { if (s.getElements().size() == 1) { Collection<Edge> e = new ArrayList<Edge>(); --- 55,59 ---- * @return The collection of edges */ ! public static Collection<Edge> getActiveEdges(Container s) { if (s.getElements().size() == 1) { Collection<Edge> e = new ArrayList<Edge>(); *************** *** 67,71 **** for (Space cur : s.getElements()) { if (cur != s.getEmpty()) { ! Collection<Edge> c = getActiveEdges(cur); edges.addAll(c); } --- 67,71 ---- for (Space cur : s.getElements()) { if (cur != s.getEmpty()) { ! Collection<Edge> c = getActiveEdges((Container) cur); edges.addAll(c); } *************** *** 82,86 **** * @return The collection of surfaces */ ! public static Collection getActiveSurfaces(Space s) { if (s.getElements().size() == 1) { //If void is the only space add all surfaces in the space and the envelope --- 82,86 ---- * @return The collection of surfaces */ ! public static Collection getActiveSurfaces(Container s) { if (s.getElements().size() == 1) { //If void is the only space add all surfaces in the space and the envelope *************** *** 94,98 **** Iterator iter = s.getElements().iterator(); while (iter.hasNext()) { ! Space cur = (Space)iter.next(); if (cur != s.getEmpty()) { surfaces.addAll(getActiveSurfaces(cur)); --- 94,98 ---- Iterator iter = s.getElements().iterator(); while (iter.hasNext()) { ! Container cur = (Container)iter.next(); if (cur != s.getEmpty()) { surfaces.addAll(getActiveSurfaces(cur)); *************** *** 421,425 **** */ public static Constructor insertConstructor(Constructor c) { ! Space space = Project.getInstance().getActiveSpace(); return space.insert(c); } --- 421,425 ---- */ public static Constructor insertConstructor(Constructor c) { ! Container space = Project.getInstance().getActiveSpace(); return space.insert(c); } *************** *** 432,436 **** * @return list of created surfaces */ ! public static List<Surface> insertEdges(Space space, List<Edge> edges) { List<Surface> result = new LinkedList(); --- 432,436 ---- * @return list of created surfaces */ ! public static List<Surface> insertEdges(Container space, List<Edge> edges) { List<Surface> result = new LinkedList(); *************** *** 448,452 **** */ public static List<Surface> insertEdges(List<Edge> edges) { ! Space space = Project.getInstance().getActiveSpace(); return insertEdges(space, edges); } --- 448,452 ---- */ public static List<Surface> insertEdges(List<Edge> edges) { ! Container space = Project.getInstance().getActiveSpace(); return insertEdges(space, edges); } *************** *** 648,655 **** Set<Surface> redundant = new HashSet<Surface>(); for (Surface s : surfaces) { ! Space front = s.getFrontDomain(); if (front != null && front == s.getBackDomain()) { ! Space owner = front.getOwner(); if (owner != null && front != owner.empty) { --- 648,655 ---- Set<Surface> redundant = new HashSet<Surface>(); for (Surface s : surfaces) { ! Container front = s.getFrontDomain(); if (front != null && front == s.getBackDomain()) { ! Container owner = front.getOwner(); if (owner != null && front != owner.empty) { *************** *** 710,717 **** Plane p = s1.plane(); if (p.contains(s2)) { ! Space front = s1.getFrontDomain(); ! Space back = s1.getBackDomain(); ! Space nextFront = s2.getFrontDomain(); ! Space nextBack = s2.getBackDomain(); if (n1.dot(n2) > 0) { if (nextFront == front && nextBack == back) { --- 710,717 ---- Plane p = s1.plane(); if (p.contains(s2)) { ! Container front = s1.getFrontDomain(); ! Container back = s1.getBackDomain(); ! Container nextFront = s2.getFrontDomain(); ! Container nextBack = s2.getBackDomain(); if (n1.dot(n2) > 0) { if (nextFront == front && nextBack == back) { *************** *** 894,898 **** int size = s.getEdges().size(); s.replace(extendable, extendedEdge); ! Space owner = s.getOwner(); if (owner != null) { owner.add(extendedEdge); --- 894,898 ---- int size = s.getEdges().size(); s.replace(extendable, extendedEdge); ! Container owner = s.getOwner(); if (owner != null) { owner.add(extendedEdge); *************** *** 960,964 **** * @param sp2 second space */ ! public static void assignSame(Surface s1, Surface s2, Space sp1, Space sp2) { if (s1.getFrontDomain() == sp1) { Vertex n1 = s1.normal(); --- 960,964 ---- * @param sp2 second space */ ! public static void assignSame(Surface s1, Surface s2, Container sp1, Container sp2) { if (s1.getFrontDomain() == sp1) { Vertex n1 = s1.normal(); Index: Geometric.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometric.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Geometric.java 10 Oct 2007 08:32:00 -0000 1.20 --- Geometric.java 13 Dec 2007 12:00:31 -0000 1.21 *************** *** 19,23 **** public abstract class Geometric extends Entity { /** The space containing this geometric entity */ ! private Space owner; /** protected */ --- 19,23 ---- public abstract class Geometric extends Entity { /** The space containing this geometric entity */ ! private Container owner; /** protected */ *************** *** 88,97 **** } ! Set<Space> spaces = new HashSet(); for (Surface current : env) { spaces.add(current.getFrontDomain()); spaces.add(current.getBackDomain()); } ! for (Space current : spaces) { if (current != current.getOwner().empty) { if (env.containsAll(current.getEnvelope())) { --- 88,97 ---- } ! Set<Container> spaces = new HashSet(); for (Surface current : env) { spaces.add(current.getFrontDomain()); spaces.add(current.getBackDomain()); } ! for (Container current : spaces) { if (current != current.getOwner().empty) { if (env.containsAll(current.getEnvelope())) { *************** *** 107,111 **** * @return The space */ ! public Space getOwner() { return owner; } --- 107,111 ---- * @return The space */ ! public Container getOwner() { return owner; } *************** *** 115,119 **** * @param space The space */ ! public void setOwner(Space space) { this.owner = space; } --- 115,119 ---- * @param space The space */ ! public void setOwner(Container space) { this.owner = space; } Index: Classification.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Classification.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Classification.java 18 Oct 2007 12:30:18 -0000 1.22 --- Classification.java 13 Dec 2007 12:00:31 -0000 1.23 *************** *** 96,100 **** Classification par = getParent(); if (par != null) { ! if (cur != null && cur.getOwner().getLevel() != Space.PROJECT_LEVEL) { current = cur.getOwner(); Classification currentClas = current.getClassification(); --- 96,100 ---- Classification par = getParent(); if (par != null) { ! if (cur != null && cur.getOwner().getLevel() != Container.PROJECT_LEVEL) { current = cur.getOwner(); Classification currentClas = current.getClassification(); Index: Mesh.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Mesh.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Mesh.java 8 Nov 2007 08:26:55 -0000 1.25 --- Mesh.java 13 Dec 2007 12:00:32 -0000 1.26 *************** *** 21,25 **** private Collection<Edge> edges; private Collection<Surface> surfaces; ! private Collection<Space> elements; /** --- 21,25 ---- private Collection<Edge> edges; private Collection<Surface> surfaces; ! private Collection<Container> elements; /** *************** *** 52,56 **** * @param vertices Collection of vertices */ ! public Mesh(Collection<Space> elements, Collection<Surface> surfaces, Collection<Edge> edges, --- 52,56 ---- * @param vertices Collection of vertices */ ! public Mesh(Collection<Container> elements, Collection<Surface> surfaces, Collection<Edge> edges, *************** *** 70,77 **** Collection<Edge> edges = new HashSet<Edge>(); Collection<Surface> surfaces = new HashSet<Surface>(); ! Collection<Space> elements = new HashSet<Space>(); for (Geometric current : geometrics) { ! if (current instanceof Space) { ! elements.add((Space) current); } else if (current instanceof Surface) { surfaces.add((Surface) current); --- 70,77 ---- Collection<Edge> edges = new HashSet<Edge>(); Collection<Surface> surfaces = new HashSet<Surface>(); ! Collection<Container> elements = new HashSet<Container>(); for (Geometric current : geometrics) { ! if (current instanceof Container) { ! elements.add((Container) current); } else if (current instanceof Surface) { surfaces.add((Surface) current); *************** *** 118,122 **** * @return elements */ ! public Collection<Space> elements() { return elements; } --- 118,122 ---- * @return elements */ ! public Collection<Container> elements() { return elements; } *************** *** 282,287 **** public Mesh copy(Map map) { Mesh copy = copyGeometry(map); ! for (Space current : elements) { ! Space shallow = current.shallowCopy(); map.put(current, shallow); copy.elements().add(shallow); --- 282,287 ---- public Mesh copy(Map map) { Mesh copy = copyGeometry(map); ! for (Container current : elements) { ! Container shallow = current.shallowCopy(); map.put(current, shallow); copy.elements().add(shallow); *************** *** 290,298 **** Surface surface = (Surface) map.get(current); if (current.getBackDomain() != null) { ! Space back = (Space) map.get(current.getBackDomain()); surface.setBackDomain(back); } if (current.getFrontDomain() != null) { ! Space front = (Space) map.get(current.getFrontDomain()); surface.setFrontDomain(front); } --- 290,298 ---- Surface surface = (Surface) map.get(current); if (current.getBackDomain() != null) { ! Container back = (Container) map.get(current.getBackDomain()); surface.setBackDomain(back); } if (current.getFrontDomain() != null) { ! Container front = (Container) map.get(current.getFrontDomain()); surface.setFrontDomain(front); } Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClippingPlane.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** ClippingPlane.java 11 Dec 2007 14:49:02 -0000 1.25 --- ClippingPlane.java 13 Dec 2007 12:00:32 -0000 1.26 *************** *** 191,195 **** public Collection<Vertex> findIntersections() { toModel.clear(); ! Space space = Project.getInstance().getActiveSpace(); Collection edges = Geometry.getActiveEdges(space); silluet.clear(); --- 191,195 ---- public Collection<Vertex> findIntersections() { toModel.clear(); ! Container space = Project.getInstance().getActiveSpace(); Collection edges = Geometry.getActiveEdges(space); silluet.clear(); Index: SurfaceAnalysis.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SurfaceAnalysis.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** SurfaceAnalysis.java 9 Dec 2007 11:04:01 -0000 1.13 --- SurfaceAnalysis.java 13 Dec 2007 12:00:32 -0000 1.14 *************** *** 61,65 **** * @param space Space */ ! public void clearPlanes(Space space) { Collection<CoordinateSystem> planes = space.getCoordinateSystems(); for (CoordinateSystem current : planes) { --- 61,65 ---- * @param space Space */ ! public void clearPlanes(Container space) { Collection<CoordinateSystem> planes = space.getCoordinateSystems(); for (CoordinateSystem current : planes) { *************** *** 74,78 **** * @return collection of CoordinateSystem */ ! public Collection<CoordinateSystem> planeAnalysis(Space space) { return planeAnalysis(space, space.getEdges()); } --- 74,78 ---- * @return collection of CoordinateSystem */ ! public Collection<CoordinateSystem> planeAnalysis(Container space) { return planeAnalysis(space, space.getEdges()); } *************** *** 83,87 **** * @return Collection of CoordinateSystem */ ! public Collection<CoordinateSystem> planeAnalysis(Space space, Collection<Edge> start) { Collection<CoordinateSystem> systems = new LinkedList(); Collection<Edge> edges = space.getEdges(); --- 83,87 ---- * @return Collection of CoordinateSystem */ ! public Collection<CoordinateSystem> planeAnalysis(Container space, Collection<Edge> start) { Collection<CoordinateSystem> systems = new LinkedList(); Collection<Edge> edges = space.getEdges(); *************** *** 147,151 **** * @param space Space */ ! public void clearSurfaces(Space space) { Collection<Surface> surfaces = new LinkedList(space.getSurfaces()); for (Surface current : surfaces) { --- 147,151 ---- * @param space Space */ ! public void clearSurfaces(Container space) { Collection<Surface> surfaces = new LinkedList(space.getSurfaces()); for (Surface current : surfaces) { *************** *** 161,165 **** * @return collection of surfaces */ ! public Collection<Surface> surfaceAnalysis(Space space, Collection<Edge> start) { Collection<CoordinateSystem> systems = planeAnalysis(space, start); Collection<Surface> added = new LinkedList(); --- 161,165 ---- * @return collection of surfaces */ ! public Collection<Surface> surfaceAnalysis(Container space, Collection<Edge> start) { Collection<CoordinateSystem> systems = planeAnalysis(space, start); Collection<Surface> added = new LinkedList(); *************** *** 174,178 **** * @param space Space */ ! public void surfaceAnalysis(Space space) { Collection<CoordinateSystem> systems = space.getCoordinateSystems(); for (CoordinateSystem current : systems) { --- 174,178 ---- * @param space Space */ ! public void surfaceAnalysis(Container space) { Collection<CoordinateSystem> systems = space.getCoordinateSystems(); for (CoordinateSystem current : systems) { *************** *** 189,193 **** * @return collection of Surfaces */ ! public Collection<Surface> surfaceAnalysis(Space space, CoordinateSystem system, Collection<Edge> start) { Plane plane = system.plane(); --- 189,193 ---- * @return collection of Surfaces */ ! public Collection<Surface> surfaceAnalysis(Container space, CoordinateSystem system, Collection<Edge> start) { Plane plane = system.plane(); *************** *** 299,305 **** private void assign(Surface surface, Collection<Surface> surfaces) { ! Space back = null; Material backmaterial = null; ! Space front = null; Material frontmaterial = null; Vertex n1 = surface.normal(); --- 299,305 ---- private void assign(Surface surface, Collection<Surface> surfaces) { ! Container back = null; Material backmaterial = null; ! Container front = null; Material frontmaterial = null; Vertex n1 = surface.normal(); Index: EnergyCalc.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/EnergyCalc.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** EnergyCalc.java 11 Dec 2007 14:49:01 -0000 1.14 --- EnergyCalc.java 13 Dec 2007 12:00:30 -0000 1.15 *************** *** 28,32 **** HashSet<Surface> functionalAssigned = new HashSet<Surface>(); for (Space space : Project.getInstance().world().getElements()) { ! if (space.getType() == Space.FUNCTIONAL) { functionalAssigned.addAll(space.getEnvelope()); } --- 28,32 ---- HashSet<Surface> functionalAssigned = new HashSet<Surface>(); for (Space space : Project.getInstance().world().getElements()) { ! if (space.getType() == Container.FUNCTIONAL) { functionalAssigned.addAll(space.getEnvelope()); } *************** *** 64,68 **** */ //TODO implement handling of elemented spaces (make calc recursive) ! private static double calcloss(Space classification, Surface current) { double loss = 0; if (isrelevant(classification, current)) { --- 64,68 ---- */ //TODO implement handling of elemented spaces (make calc recursive) ! private static double calcloss(Container classification, Surface current) { double loss = 0; if (isrelevant(classification, current)) { *************** *** 90,94 **** * @return true if the surface is relevant */ ! private static boolean isrelevant(Space classification, Surface current) { boolean relevant = false; Vertex normal = current.normal(); --- 90,94 ---- * @return true if the surface is relevant */ ! private static boolean isrelevant(Container classification, Surface current) { boolean relevant = false; Vertex normal = current.normal(); *************** *** 99,103 **** double distance = 0; Surface closest = null; ! Space spa = null; //Find closest surface that have a functional space as either front or back domain --- 99,103 ---- double distance = 0; Surface closest = null; ! Container spa = null; //Find closest surface that have a functional space as either front or back domain *************** *** 154,158 **** while (it.hasNext()) { Surface current = (Surface) it.next(); ! Space spa = null; if (current.normal().getZ() >= 0.99) { spa = current.getFrontDomain(); --- 154,158 ---- while (it.hasNext()) { Surface current = (Surface) it.next(); ! Container spa = null; if (current.normal().getZ() >= 0.99) { spa = current.getFrontDomain(); Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** Persistence.java 12 Dec 2007 14:38:43 -0000 1.69 --- Persistence.java 13 Dec 2007 12:00:31 -0000 1.70 *************** *** 125,129 **** Collection xmls = new LinkedList(); ! Space world = internalizeContainer(null, (SpaceType) document.getSpace().iterator().next(), mapper, xmls); --- 125,129 ---- Collection xmls = new LinkedList(); ! Container world = internalizeContainer(null, (SpaceType) document.getSpace().iterator().next(), mapper, xmls); *************** *** 134,138 **** p.setActiveCoordinateSystem( (CoordinateSystem) get(document.getCs(), mapper)); ! p.setActiveSpace((Space) get(document.getActive(), mapper)); p.setName(document.getName()); p.changed(p); --- 134,138 ---- p.setActiveCoordinateSystem( (CoordinateSystem) get(document.getCs(), mapper)); ! p.setActiveSpace((Container) get(document.getActive(), mapper)); p.setName(document.getName()); p.changed(p); *************** *** 233,237 **** Classification classification = null; if (!string.equalsIgnoreCase("unassigned")) { ! if (type == Space.CONSTRUCTION) { if (string.startsWith("-")) { classification = Project.getInstance().getClassification(string, 0); --- 233,237 ---- Classification classification = null; if (!string.equalsIgnoreCase("unassigned")) { ! if (type == Container.CONSTRUCTION) { if (string.startsWith("-")) { classification = Project.getInstance().getClassification(string, 0); *************** *** 255,259 **** ! private static Space internalizeElement(Space owner, net.sourceforge.bprocessor.model.xml.Space xml, Map mapper, Collection xmls) { --- 255,259 ---- ! private static Space internalizeElement(Container owner, net.sourceforge.bprocessor.model.xml.Space xml, Map mapper, Collection xmls) { *************** *** 266,270 **** } ! private static Space internalizeInstance(Space owner, SpaceType xml, Map mapper, Collection xmls) { String name = xml.getName(); --- 266,270 ---- } ! private static Instance internalizeInstance(Container owner, SpaceType xml, Map mapper, Collection xmls) { String name = xml.getName(); *************** *** 302,306 **** * @return The Space */ ! private static Container internalizeContainer(Space owner, SpaceType xml, Map mapper, Collection xmls) { --- 302,306 ---- * @return The Space */ ! private static Container internalizeContainer(Container owner, SpaceType xml, Map mapper, Collection xmls) { *************** *** 346,350 **** } if (empty != 0) { ! space.setEmpty((Space) mapper.get(new Long(empty))); } { --- 346,350 ---- } if (empty != 0) { ! space.setEmpty((Container) mapper.get(new Long(empty))); } { *************** *** 412,416 **** private static ClassificationType internalizeClassificationType(String string, int type) { ! if (type == Space.CONSTRUCTION) { ClassificationType classType = Project.getInstance().findClassificationType(string, 0); return classType; --- 412,416 ---- private static ClassificationType internalizeClassificationType(String string, int type) { ! if (type == Container.CONSTRUCTION) { ClassificationType classType = Project.getInstance().findClassificationType(string, 0); return classType; *************** *** 586,590 **** * @return The Surface */ ! private static Surface internalizeSurface(Space owner, SurfaceType xml, Map mapper, Collection xmls) { Surface surface = new Surface(); --- 586,590 ---- * @return The Surface */ ! private static Surface internalizeSurface(Container owner, SurfaceType xml, Map mapper, Collection xmls) { Surface surface = new Surface(); *************** *** 603,607 **** * @return The Edge */ ! private static Edge internalizeEdge(Space owner, EdgeType xml, Map mapper, Collection xmls) { Edge edge = new Edge(); edge.setId(new Long(xml.getProgid())); --- 603,607 ---- * @return The Edge */ ! private static Edge internalizeEdge(Container owner, EdgeType xml, Map mapper, Collection xmls) { Edge edge = new Edge(); edge.setId(new Long(xml.getProgid())); *************** *** 621,625 **** * @return The Vertex */ ! private static Vertex internalizeVertex(Space owner, VertexType xml, Map mapper, Collection xmls) { Vertex vertex = new Vertex(); --- 621,625 ---- * @return The Vertex */ ! private static Vertex internalizeVertex(Container owner, VertexType xml, Map mapper, Collection xmls) { Vertex vertex = new Vertex(); *************** *** 772,776 **** */ private static void internalizeReferences(Instance object, SpaceType xml, Map map) { ! object.setProto((Space) get(xml.getProtoref(), map)); } --- 772,776 ---- */ private static void internalizeReferences(Instance object, SpaceType xml, Map map) { ! object.setProto((Container) get(xml.getProtoref(), map)); } *************** *** 785,790 **** object.setEdges(asList(xml.getEdgeref(), map)); object.setHoles(asSet(xml.getHole(), map)); ! object.setBackDomain((Space) get(xml.getBack(), map)); ! object.setFrontDomain((Space) get(xml.getFront(), map)); object.setBackMaterial((Material) get(xml.getBackMaterial(), map)); object.setFrontMaterial((Material) get(xml.getFrontMaterial(), map)); --- 785,790 ---- object.setEdges(asList(xml.getEdgeref(), map)); object.setHoles(asSet(xml.getHole(), map)); ! object.setBackDomain((Container) get(xml.getBack(), map)); ! object.setFrontDomain((Container) get(xml.getFront(), map)); object.setBackMaterial((Material) get(xml.getBackMaterial(), map)); object.setFrontMaterial((Material) get(xml.getFrontMaterial(), map)); *************** *** 1590,1596 **** } Classification construction = internalizeClassification( ! (XMLClassificationType)xml.getXMLClassification().get(0), typeMap, Space.CONSTRUCTION); Classification functional = internalizeClassification( ! (XMLClassificationType)xml.getXMLClassification().get(1), typeMap, Space.FUNCTIONAL); input.close(); return new Object[]{construction, functional, types}; --- 1590,1596 ---- } Classification construction = internalizeClassification( ! (XMLClassificationType)xml.getXMLClassification().get(0), typeMap, Container.CONSTRUCTION); Classification functional = internalizeClassification( ! (XMLClassificationType)xml.getXMLClassification().get(1), typeMap, Container.FUNCTIONAL); input.close(); return new Object[]{construction, functional, types}; Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** Edge.java 13 Dec 2007 08:21:34 -0000 1.104 --- Edge.java 13 Dec 2007 12:00:31 -0000 1.105 *************** *** 222,226 **** public void delete() { if (getOwner() != null) { ! Space owner = getOwner(); Set<Surface> surfaces = getSurfaces(); --- 222,226 ---- public void delete() { if (getOwner() != null) { ! Container owner = getOwner(); Set<Surface> surfaces = getSurfaces(); *************** *** 240,245 **** Surface s2 = it.next(); if (s1.plane().contains(s2)) { ! List<Edge> edges1 = Space.edgeFirst(s1, this); ! List<Edge> edges2 = Space.edgeFirst(s2, this); edges1.remove(this); edges2.remove(this); --- 240,245 ---- Surface s2 = it.next(); if (s1.plane().contains(s2)) { ! List<Edge> edges1 = Container.edgeFirst(s1, this); ! List<Edge> edges2 = Container.edgeFirst(s2, this); edges1.remove(this); edges2.remove(this); Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.150 retrieving revision ... [truncated message content] |
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20690/src/net/sourceforge/bprocessor/model/modellor Modified Files: ModelBathModellor2.java WallPartingModellor.java InnerWallModellor.java TileModellor.java Modellor.java Log Message: Major change wrt Space/Container Index: TileModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/TileModellor.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** TileModellor.java 13 Dec 2007 08:21:34 -0000 1.26 --- TileModellor.java 13 Dec 2007 12:00:33 -0000 1.27 *************** *** 27,31 **** 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; --- 27,30 ---- *************** *** 58,69 **** private CoordinateSystem startPoint; ! private Space space; /** tile thickness in mm */ private int tileThickness = 8; ! private Space net; ! private Space outline; private Set<Surface> ignoredSurfaces = new HashSet<Surface>(); --- 57,68 ---- private CoordinateSystem startPoint; ! private Container space; /** tile thickness in mm */ private int tileThickness = 8; ! private Container net; ! private Container outline; private Set<Surface> ignoredSurfaces = new HashSet<Surface>(); *************** *** 79,83 **** * @param s The space */ ! public TileModellor(Space s) { if (s == null) { return; --- 78,82 ---- * @param s The space */ ! public TileModellor(Container s) { if (s == null) { return; *************** *** 103,107 **** */ @Override ! public Modellor newInstance(Space s) { return new TileModellor(s); } --- 102,106 ---- */ @Override ! public Modellor newInstance(Container s) { return new TileModellor(s); } *************** *** 113,119 **** if (ext != null && ext.getOwner().getLevel() < space.getLevel()) { // exterior were on a higher level look at the spaces of it ! if ((ext.getFrontDomain().getType() == Space.FUNCTIONAL && ext.getFrontDomain().isContainer()) || ! (ext.getBackDomain().getType() == Space.FUNCTIONAL && ext.getBackDomain().isContainer())) { //the surface is assigned to a --- 112,118 ---- if (ext != null && ext.getOwner().getLevel() < space.getLevel()) { // exterior were on a higher level look at the spaces of it ! if ((ext.getFrontDomain().getType() == Container.FUNCTIONAL && ext.getFrontDomain().isContainer()) || ! (ext.getBackDomain().getType() == Container.FUNCTIONAL && ext.getBackDomain().isContainer())) { //the surface is assigned to a *************** *** 122,127 **** } else { //look for a surface with a funktional space assign that is vertical ! if (res == null && (s.getFrontDomain().getType() == Space.FUNCTIONAL || ! s.getBackDomain().getType() == Space.FUNCTIONAL) && Math.abs(s.normal().getZ()) < 0.0001) { res = s; --- 121,126 ---- } else { //look for a surface with a funktional space assign that is vertical ! if (res == null && (s.getFrontDomain().getType() == Container.FUNCTIONAL || ! s.getBackDomain().getType() == Container.FUNCTIONAL) && Math.abs(s.normal().getZ()) < 0.0001) { res = s; *************** *** 178,182 **** outer.addHole(newS); space.addAll(newS); ! Space sp = new Container("Tile", Space.CONSTRUCTION, true); if (sign == -1) { newS.setBackDomain(sp); --- 177,181 ---- outer.addHole(newS); space.addAll(newS); ! Container sp = new Container("Tile", Container.CONSTRUCTION, true); if (sign == -1) { newS.setBackDomain(sp); *************** *** 190,194 **** } ! Space joint = new Container("Tile", Space.CONSTRUCTION, true); if (sign == -1) { outer.setBackDomain(joint); --- 189,193 ---- } ! Container joint = new Container("Tile", Container.CONSTRUCTION, true); if (sign == -1) { outer.setBackDomain(joint); *************** *** 210,214 **** private void updateOutline() { if (outline == null) { ! outline = Space.createNet("Tile-outline"); } outline.clear(); --- 209,213 ---- private void updateOutline() { if (outline == null) { ! outline = Container.createNet("Tile-outline"); } outline.clear(); *************** *** 239,243 **** private void updateNet(CoordinateSystem cs) { if (net == null) { ! net = Space.createNet("strip"); } net.clear(); --- 238,242 ---- private void updateNet(CoordinateSystem cs) { if (net == null) { ! net = Container.createNet("strip"); } net.clear(); *************** *** 509,513 **** Object o = m.get("Space"); if (o != null) { ! space = (Space)o; } o = m.get("Surface"); --- 508,512 ---- Object o = m.get("Space"); if (o != null) { ! space = (Container)o; } o = m.get("Surface"); *************** *** 555,559 **** @Override public int getUseableLevel() { ! return Space.SPACE_LEVEL; } --- 554,558 ---- @Override public int getUseableLevel() { ! return Container.SPACE_LEVEL; } Index: WallPartingModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/WallPartingModellor.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** WallPartingModellor.java 12 Dec 2007 12:48:22 -0000 1.7 --- WallPartingModellor.java 13 Dec 2007 12:00:33 -0000 1.8 *************** *** 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; --- 20,23 ---- *************** *** 31,36 **** public class WallPartingModellor extends Modellor { ! private Space space; ! private Space net; private double minZ; private double maxZ; --- 30,35 ---- public class WallPartingModellor extends Modellor { ! private Container space; ! private Container net; private double minZ; private double maxZ; *************** *** 42,46 **** * @param net the net outlining the walls (can be auto calculated by sending null object) */ ! public WallPartingModellor(Space walls, Space net) { this.space = walls; if (net != null) { --- 41,45 ---- * @param net the net outlining the walls (can be auto calculated by sending null object) */ ! public WallPartingModellor(Container walls, Container net) { this.space = walls; if (net != null) { *************** *** 51,57 **** } ! private Space calcNet() { //find bottom surface and copy outer contour from it into a new net ! Space tmpNet = Space.createNet("Contour"); space.getSurfaces().iterator().next().copy(tmpNet); return tmpNet; --- 50,56 ---- } ! private Container calcNet() { //find bottom surface and copy outer contour from it into a new net ! Container tmpNet = Container.createNet("Contour"); space.getSurfaces().iterator().next().copy(tmpNet); return tmpNet; *************** *** 163,167 **** Edge between2 = new Edge(inner.getTo(), outerCopy.getTo()); Surface s = new Surface(inner, between1, outerCopy, between2); ! Space concrete = new Container("Concrete", Space.CONSTRUCTION, true); space.add(concrete); if (s.normal().getZ() == 1.0) { --- 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) { *************** *** 182,186 **** between2 = new Edge(inner2.getTo(), tileCopy.getTo()); s = new Surface(inner2, between1, tileCopy, between2); ! Space tile = new Container("Tile", Space.CONSTRUCTION, true); space.add(tile); 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) { *************** *** 279,283 **** @Override public int getUseableLevel() { ! return Space.ELEMENT_LEVEL; } --- 278,282 ---- @Override public int getUseableLevel() { ! return Container.ELEMENT_LEVEL; } *************** *** 286,290 **** */ @Override ! public Modellor newInstance(Space s) { return new WallPartingModellor(s, null); } --- 285,289 ---- */ @Override ! public Modellor newInstance(Container s) { return new WallPartingModellor(s, null); } Index: InnerWallModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/InnerWallModellor.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** InnerWallModellor.java 12 Dec 2007 12:48:22 -0000 1.15 --- InnerWallModellor.java 13 Dec 2007 12:00:33 -0000 1.16 *************** *** 23,29 **** import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; - import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; import org.apache.log4j.Logger; --- 23,29 ---- import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; + import net.sourceforge.bprocessor.model.Space; import org.apache.log4j.Logger; *************** *** 62,66 **** /** The space of this modellor */ ! private Space space; /** A surface in the space to start the modellor */ --- 62,66 ---- /** The space of this modellor */ ! private Container space; /** A surface in the space to start the modellor */ *************** *** 82,86 **** /** The net of the modellor */ ! private Space net; /** --- 82,86 ---- /** The net of the modellor */ ! private Container net; /** *************** *** 96,100 **** * @param s the space of the modellor */ ! public InnerWallModellor(Space s) { this.space = s; } --- 96,100 ---- * @param s the space of the modellor */ ! public InnerWallModellor(Container s) { this.space = s; } *************** *** 120,124 **** */ public int getUseableLevel() { ! return Space.SPACE_LEVEL; } --- 120,124 ---- */ public int getUseableLevel() { ! return Container.SPACE_LEVEL; } *************** *** 127,131 **** */ @Override ! public Modellor newInstance(Space s) { InnerWallModellor mod = new InnerWallModellor(s); Project.getInstance().addObserver(mod); --- 127,131 ---- */ @Override ! public Modellor newInstance(Container s) { InnerWallModellor mod = new InnerWallModellor(s); Project.getInstance().addObserver(mod); *************** *** 161,165 **** for (Space current : space.getElements()) { if (current.isNet()) { ! net = current; break; } --- 161,165 ---- for (Space current : space.getElements()) { if (current.isNet()) { ! net = (Container) current; break; } *************** *** 185,189 **** * @param net a net to build the framework from */ ! private void buildFramework(Space net) { Map<Edge, Edge> edge2Run = getRuns(net.getEdges()); Set<Edge> runs = new HashSet<Edge>(edge2Run.values()); --- 185,189 ---- * @param net a net to build the framework from */ ! private void buildFramework(Container net) { Map<Edge, Edge> edge2Run = getRuns(net.getEdges()); Set<Edge> runs = new HashSet<Edge>(edge2Run.values()); *************** *** 217,221 **** Surface base = joistBase(); space.add(base); ! Space joist = new Container("joist", Space.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 = new Container("joist", Container.CONSTRUCTION, true); Classification c = Project.getInstance().getClassification("-1.-205.01.01", 0); joist.setClassificationType(c.getPossibleTypes().getChildren().get(0)); *************** *** 258,262 **** } ! private void buildWoodSheets(Space net) { List<Edge> outline = netOutline(net); if (!outline.isEmpty()) { --- 258,262 ---- } ! private void buildWoodSheets(Container net) { List<Edge> outline = netOutline(net); if (!outline.isEmpty()) { *************** *** 269,275 **** Surface sheet1 = new Surface(outlineCopy1); Surface sheet2 = new Surface(outlineCopy2); ! Space sheetSpace1 = new Container("sheet1", Space.CONSTRUCTION, true); sheetSpace1.setClassification(woodSheet()); ! Space sheetSpace2 = new Container("sheet2", Space.CONSTRUCTION, true); sheetSpace2.setClassification(woodSheet()); Vertex j = cs.getJ().copy(); --- 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(); *************** *** 349,355 **** * @return a net for building the framework */ ! private Space buildNet() { if (space != null && !space.getEnvelope().isEmpty()) { ! Space net = Space.createNet("net"); space.add(net); surface = findSurface(); --- 349,355 ---- * @return a net for building the framework */ ! private Container buildNet() { if (space != null && !space.getEnvelope().isEmpty()) { ! Container net = Container.createNet("net"); space.add(net); surface = findSurface(); *************** *** 417,422 **** for (Surface s : envelope) { //support for other innerwalls ! Space front = s.getFrontDomain(); ! Space back = s.getBackDomain(); Classification frontClass = front.getClassification(); Classification backClass = back.getClassification(); --- 417,422 ---- for (Surface s : envelope) { //support for other innerwalls ! Container front = s.getFrontDomain(); ! Container back = s.getBackDomain(); Classification frontClass = front.getClassification(); Classification backClass = back.getClassification(); *************** *** 488,493 **** for (Surface s : envelope) { for (Surface h : s.getHoles()) { ! Space front = h.getFrontDomain(); ! Space back = h.getBackDomain(); Classification frontClass = front.getClassification(); Classification backClass = back.getClassification(); --- 488,493 ---- for (Surface s : envelope) { for (Surface h : s.getHoles()) { ! Container front = h.getFrontDomain(); ! Container back = h.getBackDomain(); Classification frontClass = front.getClassification(); Classification backClass = back.getClassification(); *************** *** 564,569 **** Surface surface = space.getEnvelope().iterator().next(); for (Surface s : space.getEnvelope()) { ! Space front = s.getFrontDomain(); ! Space back = s.getBackDomain(); Classification frontClass = front.getClassification(); Classification backClass = back.getClassification(); --- 564,569 ---- Surface surface = space.getEnvelope().iterator().next(); for (Surface s : space.getEnvelope()) { ! Container front = s.getFrontDomain(); ! Container back = s.getBackDomain(); Classification frontClass = front.getClassification(); Classification backClass = back.getClassification(); *************** *** 593,597 **** * @return the space */ ! public Space getSpace() { return space; } --- 593,597 ---- * @return the space */ ! public Container getSpace() { return space; } *************** *** 600,604 **** * @param space the space */ ! public void setSpace(Space space) { this.space = space; } --- 600,604 ---- * @param space the space */ ! public void setSpace(Container space) { this.space = space; } *************** *** 624,628 **** * @return true if all geometry in the net is in the plane, false otherwise */ ! private boolean getPlaneCheck(Space net, Plane p) { for (Edge e : net.getEdges()) { if (!p.contains(e)) { --- 624,628 ---- * @return true if all geometry in the net is in the plane, false otherwise */ ! private boolean getPlaneCheck(Container net, Plane p) { for (Edge e : net.getEdges()) { if (!p.contains(e)) { *************** *** 688,692 **** * @return a list of connected edges making up the net outline */ ! private List<Edge> netOutline(Space net) { /*Find outer edges*/ Set<Edge> outer = new HashSet<Edge>(); --- 688,692 ---- * @return a list of connected edges making up the net outline */ ! private List<Edge> netOutline(Container net) { /*Find outer edges*/ Set<Edge> outer = new HashSet<Edge>(); *************** *** 741,745 **** * @return the net of this modellor */ ! public Space getNet() { return net; } --- 741,745 ---- * @return the net of this modellor */ ! public Container getNet() { return net; } Index: ModelBathModellor2.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/ModelBathModellor2.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ModelBathModellor2.java 12 Dec 2007 12:48:23 -0000 1.14 --- ModelBathModellor2.java 13 Dec 2007 12:00:33 -0000 1.15 *************** *** 38,50 **** private static Logger log = Logger.getLogger(ModelBathModellor2.class); ! private Space space; ! private Space floor; ! private Space walls; ! private Space ceiling; ! private Space bath; private double length; --- 38,50 ---- private static Logger log = Logger.getLogger(ModelBathModellor2.class); ! private Container space; ! private Container floor; ! private Container walls; ! private Container ceiling; ! private Container bath; private double length; *************** *** 62,66 **** private CoordinateSystem coord; ! private Space net; private double doorHeight = 2.2; --- 62,66 ---- private CoordinateSystem coord; ! private Container net; private double doorHeight = 2.2; *************** *** 70,74 **** private double windowHeight = 0.5; ! private Collection<Space> doorAndWindows = new ArrayList<Space>(); private Collection<Modellor> insideModellors = new LinkedList<Modellor>(); --- 70,74 ---- private double windowHeight = 0.5; ! private Collection<Container> doorAndWindows = new ArrayList<Container>(); private Collection<Modellor> insideModellors = new LinkedList<Modellor>(); *************** *** 85,89 **** * @param s the Space to realize the modellor in */ ! public ModelBathModellor2(Space s) { this(); space = s; --- 85,89 ---- * @param s the Space to realize the modellor in */ ! public ModelBathModellor2(Container s) { this(); space = s; *************** *** 119,123 **** Surface s = new Surface(edges); ! net = Space.createNet("Boundary"); net.add(v1); net.add(v2); --- 119,123 ---- Surface s = new Surface(edges); ! net = Container.createNet("Boundary"); net.add(v1); net.add(v2); *************** *** 157,167 **** */ private void generateBath() { ! floor = new Container("Floor", Space.CONSTRUCTION, true); space.add(floor); ! bath = new Container("Bath cabin", Space.FUNCTIONAL, true); space.add(bath); ! walls = new Container("Walls", Space.CONSTRUCTION, true); space.add(walls); ! ceiling = new Container("Ceiling", Space.CONSTRUCTION, true); space.add(ceiling); makeFloor(); --- 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(); *************** *** 177,184 **** private void addTileModellors() { for (Space elem : walls.getElements()) { ! if (elem.getType() == Space.CONSTRUCTION && elem.isContainer() && elem.getName().equals("Tile")) { ! TileModellor tm = new TileModellor(elem); insideModellors .add(tm); elem.setModellor(tm); --- 177,184 ---- private void addTileModellors() { for (Space elem : walls.getElements()) { ! if (elem.getType() == Container.CONSTRUCTION && elem.isContainer() && elem.getName().equals("Tile")) { ! TileModellor tm = new TileModellor((Container) elem); insideModellors .add(tm); elem.setModellor(tm); *************** *** 292,296 **** Edge between2 = new Edge(inner.getTo(), outerCopy.getTo()); Surface s = new Surface(inner, between1, outerCopy, between2); ! Space concrete = new Container("Concrete", Space.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 = new Container("Concrete", Container.CONSTRUCTION, true); 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); ! Space tile = new Container("Tile", Space.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 = new Container("Tile", Container.CONSTRUCTION, true); walls.add(tile); if (s.normal().getZ() == 1.0) { *************** *** 364,368 **** } // copy doors and windows in ! for (Space spc : doorAndWindows) { double maxDist = 0; Surface inner = null; --- 364,368 ---- } // copy doors and windows in ! for (Container spc : doorAndWindows) { double maxDist = 0; Surface inner = null; *************** *** 396,400 **** if (s.getCurrentValue().equals("Door")) { // make a door ! Space doorSpc = new Container("Door", Space.CONSTRUCTION, true); doorAndWindows.add(doorSpc); space.add(doorSpc); --- 396,400 ---- if (s.getCurrentValue().equals("Door")) { // make a door ! Container doorSpc = new Container("Door", Container.CONSTRUCTION, true); doorAndWindows.add(doorSpc); space.add(doorSpc); *************** *** 439,443 **** } else if (s.getCurrentValue().equals("Window")) { //make a window ! Space winSpc = new Container("Window", Space.CONSTRUCTION, true); doorAndWindows.add(winSpc); space.add(winSpc); --- 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); *************** *** 672,678 **** /** {@inheritDoc} */ @Override ! public Modellor newInstance(Space s) { ! if (s.getLevel() == Space.PROJECT_LEVEL) { ! Space bath = new Container("Bath-union", Space.CONSTRUCTION, true); bath.setUnion(true); s.add(bath); --- 672,678 ---- /** {@inheritDoc} */ @Override ! 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); *************** *** 777,782 **** @Override public void setSubContent(Map<String, Object> m) { ! space = (Space)m.get("Space"); ! net = (Space)m.get("Net"); wallThickness = (Double)m.get("wallThickness"); floorThickness = (Double)m.get("floorThickness"); --- 777,782 ---- @Override public void setSubContent(Map<String, Object> m) { ! space = (Container)m.get("Space"); ! net = (Container)m.get("Net"); wallThickness = (Double)m.get("wallThickness"); floorThickness = (Double)m.get("floorThickness"); *************** *** 809,813 **** @Override public int getUseableLevel() { ! return Space.PROJECT_LEVEL; } } --- 809,813 ---- @Override public int getUseableLevel() { ! return Container.PROJECT_LEVEL; } } Index: Modellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/Modellor.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Modellor.java 19 Jun 2007 13:42:28 -0000 1.14 --- Modellor.java 13 Dec 2007 12:00:33 -0000 1.15 *************** *** 18,22 **** import net.sourceforge.bprocessor.model.Observer; import net.sourceforge.bprocessor.model.Parametric; ! import net.sourceforge.bprocessor.model.Space; --- 18,22 ---- import net.sourceforge.bprocessor.model.Observer; import net.sourceforge.bprocessor.model.Parametric; ! import net.sourceforge.bprocessor.model.Container; *************** *** 131,135 **** * @return The created modellor object for the given space */ ! public abstract Modellor newInstance(Space space); --- 131,135 ---- * @return The created modellor object for the given space */ ! public abstract Modellor newInstance(Container space); *************** *** 138,142 **** * @return Space */ ! public Space createSpace() { return null; } --- 138,142 ---- * @return Space */ ! public Container createSpace() { return null; } *************** *** 147,151 **** * @return Parametric */ ! public Parametric get(Space element) { return (Parametric) parameters.get(element); } --- 147,151 ---- * @return Parametric */ ! public Parametric get(Container element) { return (Parametric) parameters.get(element); } *************** *** 156,160 **** * @param parametric Parametric */ ! public void set(Space element, Parametric parametric) { parameters.put(element, parametric); } --- 156,160 ---- * @param parametric Parametric */ ! public void set(Container element, Parametric parametric) { parameters.put(element, parametric); } |
From: Michael L. <he...@us...> - 2007-12-13 12:00:17
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20650/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java FacadeModellor.java Log Message: Major change wrt Space/Container Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** NetFacadeModellor.java 12 Dec 2007 12:48:18 -0000 1.44 --- NetFacadeModellor.java 13 Dec 2007 12:00:15 -0000 1.45 *************** *** 19,23 **** import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Classification; - import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; --- 19,22 ---- *************** *** 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.Vertex; --- 27,31 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selector; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 65,75 **** /** The space of the facade */ ! private Space space; /** The frame space */ ! private Space frame; /** The net for this facade */ ! private Space net; /** The framewidth of the facade */ --- 64,74 ---- /** The space of the facade */ ! private Container space; /** The frame space */ ! private Container frame; /** The net for this facade */ ! private Container net; /** The framewidth of the facade */ *************** *** 113,123 **** */ public void setSubContent(Map<String, Object> m) { ! space = (Space)m.get("space"); ! net = (Space)m.get("net"); depth = ((Double)m.get("depth")).doubleValue(); frameWidth = ((Double)m.get("frameWidth")).doubleValue(); front = (Surface)m.get("front"); single = ((Boolean)m.get("single")).booleanValue(); ! frame = (Space)m.get("frame"); Project.getInstance().addObserver(this); } --- 112,122 ---- */ public void setSubContent(Map<String, Object> m) { ! space = (Container)m.get("space"); ! net = (Container)m.get("net"); depth = ((Double)m.get("depth")).doubleValue(); frameWidth = ((Double)m.get("frameWidth")).doubleValue(); front = (Surface)m.get("front"); single = ((Boolean)m.get("single")).booleanValue(); ! frame = (Container)m.get("frame"); Project.getInstance().addObserver(this); } *************** *** 128,132 **** * @return a new modellor */ ! public Modellor newInstance(Space s) { NetFacadeModellor mod = new NetFacadeModellor(); mod.setSpace(s); --- 127,131 ---- * @return a new modellor */ ! public Modellor newInstance(Container s) { NetFacadeModellor mod = new NetFacadeModellor(); mod.setSpace(s); *************** *** 134,138 **** s.setModellor(mod); frame = new Container("Frame", ! Space.CONSTRUCTION, true); Classification frameClass = Project.getInstance().getClassification(FRAME, 0); --- 133,137 ---- s.setModellor(mod); frame = new Container("Frame", ! Container.CONSTRUCTION, true); Classification frameClass = Project.getInstance().getClassification(FRAME, 0); *************** *** 150,154 **** * @return a suitable surface from the s' envelope */ ! private Surface findFront(Space s) { Surface frontCandidate = null; if (!s.getEnvelope().isEmpty()) { --- 149,153 ---- * @return a suitable surface from the s' envelope */ ! private Surface findFront(Container s) { Surface frontCandidate = null; if (!s.getEnvelope().isEmpty()) { *************** *** 228,232 **** Attribute a = attributes.get("Net"); if (a != null) { ! setNet((Space)a.getValue()); } a = attributes.get("Framewidth"); --- 227,231 ---- Attribute a = attributes.get("Net"); if (a != null) { ! setNet((Container)a.getValue()); } a = attributes.get("Framewidth"); *************** *** 270,274 **** *@return the space */ ! public Space getSpace() { return space; } --- 269,273 ---- *@return the space */ ! public Container getSpace() { return space; } *************** *** 278,282 **** * @param space the space */ ! public void setSpace(Space space) { this.space = space; } --- 277,281 ---- * @param space the space */ ! public void setSpace(Container space) { this.space = space; } *************** *** 286,290 **** * @return the net of this modellor */ ! public Space getNet() { return this.net; } --- 285,289 ---- * @return the net of this modellor */ ! public Container getNet() { return this.net; } *************** *** 294,298 **** * @param net the net */ ! public void setNet(Space net) { if (net.isNet()) { if (this.net != null) { --- 293,297 ---- * @param net the net */ ! public void setNet(Container net) { if (net.isNet()) { if (this.net != null) { *************** *** 345,349 **** * @param n the net */ ! private void prepareNet(Space n) { Collection<Edge> edges = n.getEdges(); for (Edge e : edges) { --- 344,348 ---- * @param n the net */ ! private void prepareNet(Container n) { Collection<Edge> edges = n.getEdges(); for (Edge e : edges) { *************** *** 389,396 **** * @param net the net */ ! private void createDoubleFacade(Space net) { if (frame == null) { frame = new Container("Frame", ! Space.CONSTRUCTION, true); Classification frameClass = Project.getInstance().getClassification(FRAME, 0); --- 388,395 ---- * @param net the net */ ! private void createDoubleFacade(Container net) { if (frame == null) { frame = new Container("Frame", ! Container.CONSTRUCTION, true); Classification frameClass = Project.getInstance().getClassification(FRAME, 0); *************** *** 438,445 **** * @param net the net */ ! private void createSingleFacade(Space net) { if (frame == null) { frame = new Container("Frame", ! Space.CONSTRUCTION, true); space.add(frame); --- 437,444 ---- * @param net the net */ ! private void createSingleFacade(Container net) { if (frame == null) { frame = new Container("Frame", ! Container.CONSTRUCTION, true); space.add(frame); *************** *** 475,480 **** Surface hole = new Surface(Edge.placeOffset(field.getEdges(), field, offsetMap)); hole = space.insert(hole); ! Space holeSpace = new Container("Facade Hole", ! Space.FUNCTIONAL, true); space.add(holeSpace); --- 474,479 ---- 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); *************** *** 498,502 **** * @param holeSpace the space of the hole in the facade */ ! private void detailField(Map envF, Surface hole, Space holeSpace) { double frameSize = 0.0; String type = ""; --- 497,501 ---- * @param holeSpace the space of the hole in the facade */ ! private void detailField(Map envF, Surface hole, Container holeSpace) { double frameSize = 0.0; String type = ""; *************** *** 520,530 **** Surface in = new Surface(Edge.placeOffset(hole.getEdges(), hole, offmap1)); Surface out = new Surface(Edge.placeOffset(hole.getEdges(), hole, offmap2)); ! Space f = new Container(type + " Frame", ! Space.CONSTRUCTION, true); Classification frameClass = Project.getInstance().getClassification(FRAME, 0); f.setClassification(frameClass); ! Space g = new Container("Glass", ! Space.CONSTRUCTION, true); Classification glassClass = Project.getInstance().getClassification(GLASS, 0); --- 519,529 ---- 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); *************** *** 565,569 **** * @return a list of connected edges making up the net outline */ ! private List<Edge> netOutline(Space net) { /*Find outer edges*/ Set<Edge> outer = new HashSet<Edge>(); --- 564,568 ---- * @return a list of connected edges making up the net outline */ ! private List<Edge> netOutline(Container net) { /*Find outer edges*/ Set<Edge> outer = new HashSet<Edge>(); *************** *** 617,622 **** * @return a new net */ ! private Space createNet(Surface front) { ! Space n = Space.createNet("Facade net"); if (front != null) { front.copy(n); --- 616,621 ---- * @return a new net */ ! private Container createNet(Surface front) { ! Container n = Container.createNet("Facade net"); if (front != null) { front.copy(n); *************** *** 697,703 **** * @param sp2 second space */ ! private void assignOpposite(Surface s1, Surface s2, Space sp1, Space sp2) { ! Space back = s2.getBackDomain(); ! Space front = s2.getFrontDomain(); Geometry.assignSame(s1, s2, sp1, sp2); if (s2.getBackDomain() == sp2) { --- 696,702 ---- * @param sp2 second space */ ! private void assignOpposite(Surface s1, Surface s2, Container sp1, Container sp2) { ! Container back = s2.getBackDomain(); ! Container front = s2.getFrontDomain(); Geometry.assignSame(s1, s2, sp1, sp2); if (s2.getBackDomain() == sp2) { *************** *** 750,759 **** @Override public int getUseableLevel() { ! return Space.SPACE_LEVEL; } private Set<Surface> generateFrame2(Surface cut, Surface contourSurf, ! Space frameSpace, Vertex out) { Set<Surface> generatedSurfaces = new HashSet<Surface>(); --- 749,758 ---- @Override public int getUseableLevel() { ! return Container.SPACE_LEVEL; } private Set<Surface> generateFrame2(Surface cut, Surface contourSurf, ! Container frameSpace, Vertex out) { Set<Surface> generatedSurfaces = new HashSet<Surface>(); Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** FacadeModellor.java 12 Dec 2007 12:48:18 -0000 1.39 --- FacadeModellor.java 13 Dec 2007 12:00:15 -0000 1.40 *************** *** 19,23 **** import net.sourceforge.bprocessor.model.modellor.Modellor; import net.sourceforge.bprocessor.model.Container; - import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Surface; --- 19,22 ---- *************** *** 63,67 **** /** The space this modellor is connected to */ ! private Space space; /** The front surface of the facade */ --- 62,66 ---- /** The space this modellor is connected to */ ! private Container space; /** The front surface of the facade */ *************** *** 115,119 **** * @param s the space */ ! public FacadeModellor(Space s) { this(s, null); } --- 114,118 ---- * @param s the space */ ! public FacadeModellor(Container s) { this(s, null); } *************** *** 123,127 **** * @param front Front */ ! public FacadeModellor(Space s, Surface front) { if (front == null) { front = null; --- 122,126 ---- * @param front Front */ ! public FacadeModellor(Container s, Surface front) { if (front == null) { front = null; *************** *** 154,158 **** * @return The created modellor object for the given space */ ! public Modellor newInstance(Space s) { return new FacadeModellor(s); } --- 153,157 ---- * @return The created modellor object for the given space */ ! public Modellor newInstance(Container s) { return new FacadeModellor(s); } *************** *** 366,370 **** if (front != null && depth > 0) { ! Space frame = new Container("Frame", Space.CONSTRUCTION, true); space.add(frame); Surface eFront = front.copy(space); --- 365,369 ---- if (front != null && depth > 0) { ! Container frame = new Container("Frame", Container.CONSTRUCTION, true); space.add(frame); Surface eFront = front.copy(space); *************** *** 691,695 **** Surface s = (Surface)it.next(); Set sides = new HashSet(); ! Space w = new Container("Window", Space.CONSTRUCTION, true); double u = s.normal().dot(front.normal()); if ((u > 0 && front.getBackDomain() == 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) || *************** *** 808,812 **** type = ((Integer)m.get("type")).intValue(); name = (String)m.get("name"); ! space = (Space)m.get("Space"); } --- 807,811 ---- type = ((Integer)m.get("type")).intValue(); name = (String)m.get("name"); ! space = (Container)m.get("Space"); } *************** *** 854,858 **** @Override public int getUseableLevel() { ! return Space.SPACE_LEVEL; } } --- 853,857 ---- @Override public int getUseableLevel() { ! return Container.SPACE_LEVEL; } } |
From: Michael L. <he...@us...> - 2007-12-13 09:34:50
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28863/src/net/sourceforge/bprocessor/model Modified Files: Command.java Log Message: removed unused code Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** Command.java 13 Dec 2007 08:21:34 -0000 1.57 --- Command.java 13 Dec 2007 09:34:46 -0000 1.58 *************** *** 1884,1972 **** } - private Space createGrid(Surface surface, double dx, double dy) { - Space net = Space.createNet("Grid Net"); - HashMap map = new HashMap(); - - List<Edge> contour = new LinkedList(); - for (Edge current : surface.getEdges()) { - contour.add((Edge) current.copy(map)); - } - - Vertex vertex = surface.getFirstVertex(); - Vertex normal = surface.normal(); - CoordinateSystem system = CoordinateSystem.systemFor(vertex, normal); - - List<Vertex> vertices = Offset.vertices(contour); - system.translateIt(vertices); - - BoundingBox box = new BoundingBox(vertices); - double xmin = box.xmin().getX(); - double xmax = box.xmax().getX(); - double ymin = box.ymin().getY(); - double ymax = box.ymax().getY(); - - double width = xmax - xmin; - double height = ymax - ymin; - - int n = round(width / dx); - int m = round(height / dy); - - - - Vertex[][] grid = new Vertex[n][m]; - { - double x = xmin; - for (int i = 0; i < n; i++) { - x = x + dx; - double y = ymin; - for (int j = 0; j < m; j++) { - y = y + dy; - grid[i][j] = new Vertex(x, y, 0); - } - } - } - - List<Edge> verticals = new LinkedList(); - { - for (int i = 0; i < n; i++) { - for (int j = 0; j < m - 1; j++) { - Vertex from = grid[i][j]; - Vertex to = grid[i][j + 1]; - verticals.add(new Edge(from, to)); - } - } - } - - List<Edge> horizontals = new LinkedList(); - { - for (int j = 0; j < m; j++) { - for (int i = 0; i < n - 1; i++) { - Vertex from = grid[i][j]; - Vertex to = grid[i + 1][j]; - horizontals.add(new Edge(from, to)); - } - } - } - - List<Edge> all = new LinkedList(); - - all.addAll(verticals); - all.addAll(horizontals); - - { - for (int i = 0; i < n; i++) { - for (int j = 0; j < m; j++) { - Vertex current = grid[i][j]; - Vertex global = system.unTranslate(current); - current.set(global); - } - } - } - - Shape.addEdgesTo(net, all); - - return net; - } - /** {@inheritDoc} */ @Override --- 1884,1887 ---- |
From: Michael L. <he...@us...> - 2007-12-13 08:21:38
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv365/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java Command.java Log Message: final grid algorithm Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** Edge.java 11 Dec 2007 14:49:02 -0000 1.103 --- Edge.java 13 Dec 2007 08:21:34 -0000 1.104 *************** *** 386,390 **** * @return The shortes Edge connecting this Edge and the other */ ! public Edge intersection(Edge other) { if (this.getLength() < 0.0000001) { if (other.getLength() < 0.0000001) { --- 386,390 ---- * @return The shortes Edge connecting this Edge and the other */ ! public Edge shortestEdge(Edge other) { if (this.getLength() < 0.0000001) { if (other.getLength() < 0.0000001) { *************** *** 456,459 **** --- 456,481 ---- /** + * + * @param edge Edge + * @return vertex + */ + public Vertex intersection(Edge edge) { + Edge shortest = shortestEdge(edge); + if (shortest != null) { + if (shortest.getLength() < 0.0000001) { + Vertex vertex = shortest.getFrom(); + if (from.equalEps(vertex)) { + return from; + } else if (to.equalEps(vertex)) { + return to; + } else { + return vertex; + } + } + } + return null; + } + + /** * Finds the intersection between a Vertex and this * edge. The intersection is defined as the vertex Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** Vertex.java 11 Dec 2007 14:49:02 -0000 1.74 --- Vertex.java 13 Dec 2007 08:21:34 -0000 1.75 *************** *** 9,12 **** --- 9,14 ---- import java.util.ArrayList; import java.util.Collection; + import java.util.Collections; + import java.util.Comparator; import java.util.HashSet; import java.util.Iterator; *************** *** 514,517 **** --- 516,561 ---- } + + /** + * + * @param vertices list of vertices + */ + public static void sortByX(List<Vertex> vertices) { + final Comparator<Vertex> comparator = new Comparator<Vertex>() { + public int compare(Vertex v1, Vertex v2) { + if (v1.x == v2.x) { + return 0; + } else if (v1.x < v2.x) { + return -1; + } else { + return 1; + } + } + }; + Collections.sort(vertices, comparator); + } + + + /** + * + * @param vertices list of vertices + */ + public static void sortByY(List<Vertex> vertices) { + final Comparator<Vertex> comparator = new Comparator<Vertex>() { + public int compare(Vertex v1, Vertex v2) { + if (v1.y == v2.y) { + return 0; + } else if (v1.y < v2.y) { + return -1; + } else { + return 1; + } + } + }; + Collections.sort(vertices, comparator); + } + + + /** * Center Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** Command.java 12 Dec 2007 16:11:49 -0000 1.56 --- Command.java 13 Dec 2007 08:21:34 -0000 1.57 *************** *** 10,15 **** import java.util.ArrayList; import java.util.Collection; - import java.util.Collections; - import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; --- 10,13 ---- *************** *** 763,767 **** * @param surfaces surface */ ! public static void addTo(Space owner, Collection<Surface> surfaces) { Collection<Edge> edges = Surface.edges(surfaces); Collection<Vertex> vertices = Edge.vertices(edges); --- 761,765 ---- * @param surfaces surface */ ! public static void addSurfacesTo(Space owner, Collection<Surface> surfaces) { Collection<Edge> edges = Surface.edges(surfaces); Collection<Vertex> vertices = Edge.vertices(edges); *************** *** 782,785 **** --- 780,800 ---- /** + * Add edges and their vertices, then perform surface-analysis + * @param owner Space + * @param edges edges + */ + public static void addEdgesTo(Space owner, Collection<Edge> edges) { + Collection<Vertex> points = Edge.vertices(edges); + for (Vertex current : points) { + owner.add(current); + } + for (Edge current : edges) { + owner.add(current); + } + SurfaceAnalysis analysis = new SurfaceAnalysis(); + analysis.surfaceAnalysis(owner, edges); + } + + /** * Pyramid */ *************** *** 823,827 **** Space union = new Container("Pyramid", Space.CONSTRUCTION, true); ! addTo(union, list(s0, side0, side1, side2, side3)); return union; --- 838,842 ---- Space union = new Container("Pyramid", Space.CONSTRUCTION, true); ! addSurfacesTo(union, list(s0, side0, side1, side2, side3)); return union; *************** *** 911,915 **** ! addTo(union, surfaces); for (Vertex current : union.getVertices()) { --- 926,930 ---- ! addSurfacesTo(union, surfaces); for (Vertex current : union.getVertices()) { *************** *** 1369,1373 **** } ! Shape.addTo(union, inserted); { --- 1384,1388 ---- } ! Shape.addSurfacesTo(union, inserted); { *************** *** 1499,1503 **** Space union = new Container("Layer", Space.CONSTRUCTION, true); for (Prism current : prisms) { ! Shape.addTo(union, current.surfaces()); } net.getOwner().add(union); --- 1514,1518 ---- Space union = new Container("Layer", Space.CONSTRUCTION, true); for (Prism current : prisms) { ! Shape.addSurfacesTo(union, current.surfaces()); } net.getOwner().add(union); *************** *** 1615,1620 **** } ! private Space createVertical(Surface surface, double dx) { ! Space net = Space.createNet("Vertical Net"); HashMap map = new HashMap(); --- 1630,1708 ---- } ! private void fill(List<Vertex> vertices, List<Edge> edges) { ! Iterator<Vertex> iter = vertices.iterator(); ! Vertex from = iter.next(); ! while (iter.hasNext()) { ! Vertex to = iter.next(); ! edges.add(new Edge(from, to)); ! from = to; ! } ! } ! ! private void stipple(List<Edge> edges, ! List<Vertex> vertices) { ! Iterator<Vertex> iter = vertices.iterator(); ! for (int k = 0; k < (vertices.size() / 2); k++) { ! Vertex f = iter.next(); ! Vertex t = iter.next(); ! edges.add(new Edge(f, t)); ! } ! } ! ! private void fillx(List<Edge> edges, ! List<Vertex> vertices, ! Vertex[][] grid, ! int j, ! int n, ! double xmin, ! double dx) { ! Iterator<Vertex> iter = vertices.iterator(); ! for (int k = 0; k < (vertices.size() / 2); k++) { ! Vertex f = iter.next(); ! Vertex t = iter.next(); ! ! List<Vertex> points = new LinkedList(); ! points.add(f); ! double x = xmin; ! for (int i = 0; i < n; i++) { ! x += dx; ! if (f.x < x && x < t.x) { ! points.add(grid[i][j]); ! } ! } ! points.add(t); ! fill(points, edges); ! } ! } ! ! private void filly(List<Edge> edges, ! List<Vertex> vertices, ! Vertex[][] grid, ! int i, ! int m, ! double ymin, ! double dy) { ! Iterator<Vertex> iter = vertices.iterator(); ! for (int k = 0; k < (vertices.size() / 2); k++) { ! Vertex f = iter.next(); ! Vertex t = iter.next(); ! ! List<Vertex> points = new LinkedList(); ! points.add(f); ! double y = ymin; ! for (int j = 0; j < m; j++) { ! y += dy; ! if (f.y < y && y < t.y) { ! points.add(grid[i][j]); ! } ! } ! points.add(t); ! fill(points, edges); ! } ! } ! ! ! private Space create(Surface surface, double dx, double dy) { ! Space net = Space.createNet("Grid"); HashMap map = new HashMap(); *************** *** 1636,1639 **** --- 1724,1734 ---- system.translateIt(vertices); + HashMap<Edge, List<Vertex>> cuts = new HashMap(); + for (Edge current : contour) { + cuts.put(current, new LinkedList()); + } + + List<Edge> all = new LinkedList(); + BoundingBox box = new BoundingBox(vertices); double xmin = box.xmin().getX(); *************** *** 1643,1701 **** double width = xmax - xmin; ! int n = round(width / dx); ! List<Edge> verticals = new LinkedList(); ! for (int i = 0; i < n; i++) { ! double x = xmin + (i + 1) * dx; ! Vertex from = new Vertex(x, ymin, 0); ! Vertex to = new Vertex(x, ymax, 0); ! Edge edge = new Edge(from, to); ! List<Vertex> intersections = new LinkedList(); ! for (Edge current : contour) { ! double x0 = current.from.x; ! double x1 = current.to.x; ! if (x0 > x1) { ! double tmp = x1; ! x1 = x0; ! x0 = tmp; } ! if (x0 <= x && x < x1) { ! Edge intersect = current.intersection(edge); ! if (intersect != null) { ! if (intersect.getLength() < 0.0000001) { ! intersections.add(intersect.from); } } } ! } ! final Comparator<Vertex> comparator = new Comparator<Vertex>() { ! public int compare(Vertex v1, Vertex v2) { ! if (v1.y == v2.y) { ! return 0; ! } else if (v1.y < v2.y) { ! return -1; } else { ! return 1; } } ! }; ! ! if (intersections.size() > 0) { ! Collections.sort(intersections, comparator); ! Iterator<Vertex> iter = intersections.iterator(); ! for (int j = 0; j < (intersections.size() / 2); j++) { ! Vertex f = iter.next(); ! Vertex t = iter.next(); ! verticals.add(new Edge(f, t)); } } } ! system.unTranslateIt(Edge.vertices(verticals)); ! system.unTranslateIt(Edge.vertices(contour)); ! Geometry.insertEdges(net, contour); ! Geometry.insertEdges(net, verticals); return net; } --- 1738,1875 ---- double width = xmax - xmin; + double height = ymax - ymin; + int n; + int m; ! if (dx > 0) { ! n = round(width / dx); ! } else { ! n = 0; ! } ! if (dy > 0) { ! m = round(height / dy); ! } else { ! m = 0; ! } ! Vertex[][] grid = null; ! if (n > 0 && m > 0) { ! grid = new Vertex[n][m]; ! { ! double x = xmin; ! for (int i = 0; i < n; i++) { ! x = x + dx; ! double y = ymin; ! for (int j = 0; j < m; j++) { ! y = y + dy; ! grid[i][j] = new Vertex(x, y, 0); ! } } ! } ! } ! ! ! if (n > 0) { ! List<Edge> verticals = new LinkedList(); ! ! for (int i = 0; i < n; i++) { ! double x = xmin + (i + 1) * dx; ! Vertex from = new Vertex(x, ymin, 0); ! Vertex to = new Vertex(x, ymax, 0); ! Edge edge = new Edge(from, to); ! List<Vertex> intersections = new LinkedList(); ! for (Edge current : contour) { ! double x0 = current.from.x; ! double x1 = current.to.x; ! if (x0 > x1) { ! double tmp = x1; ! x1 = x0; ! x0 = tmp; ! } ! if (x0 <= x && x < x1) { ! Vertex intersect = current.intersection(edge); ! if (intersect != null) { ! intersections.add(intersect); ! if (!current.contains(intersect)) { ! cuts.get(current).add(intersect); ! } } } } ! ! if (intersections.size() > 0) { ! Vertex.sortByY(intersections); ! if (m > 0) { ! filly(verticals, intersections, grid, i, m, ymin, dy); } else { ! stipple(verticals, intersections); } } ! } ! all.addAll(verticals); ! } ! ! if (m > 0) { ! ! List<Edge> horizontals = new LinkedList(); ! ! for (int j = 0; j < m; j++) { ! double y = ymin + (j + 1) * dy; ! Vertex from = new Vertex(xmin, y, 0); ! Vertex to = new Vertex(xmax, y, 0); ! Edge edge = new Edge(from, to); ! List<Vertex> intersections = new LinkedList(); ! for (Edge current : contour) { ! double y0 = current.from.y; ! double y1 = current.to.y; ! if (y0 > y1) { ! double tmp = y1; ! y1 = y0; ! y0 = tmp; ! } ! if (y0 <= y && y < y1) { ! Vertex intersect = current.intersection(edge); ! if (intersect != null) { ! intersections.add(intersect); ! if (!current.contains(intersect)) { ! cuts.get(current).add(intersect); ! } ! } ! } ! } ! ! if (intersections.size() > 0) { ! Vertex.sortByX(intersections); ! if (n > 0) { ! fillx(horizontals, intersections, grid, j, n, xmin, dx); ! } else { ! stipple(horizontals, intersections); ! } } } + all.addAll(horizontals); } ! ! List<Edge> segments = new LinkedList(); ! for (Edge current : contour) { ! List<Vertex> points = cuts.get(current); ! points.add(current.from); ! points.add(current.to); ! if (Math.abs(current.from.x - current.to.x) > 0.0000001) { ! Vertex.sortByX(points); ! } else { ! Vertex.sortByY(points); ! } ! fill(points, segments); ! } ! ! ! all.addAll(segments); ! ! system.unTranslateIt(Edge.vertices(all)); ! ! Shape.addEdgesTo(net, all); return net; } *************** *** 1790,1805 **** } ! { ! ! Collection<Vertex> points = Edge.vertices(all); ! for (Vertex current : points) { ! net.add(current); ! } ! for (Edge current : all) { ! net.add(current); ! } ! SurfaceAnalysis analysis = new SurfaceAnalysis(); ! analysis.surfaceAnalysis(net, all); ! } return net; } --- 1964,1969 ---- } ! Shape.addEdgesTo(net, all); ! return net; } *************** *** 1812,1820 **** double ydistance = parameters.getDouble("y distance"); Space net; ! if (xdistance > 0.0000001 && ydistance > 0.00001) { ! net = createGrid(surface, xdistance, ydistance); ! } else { ! net = createVertical(surface, xdistance); ! } Space owner = surface.getOwner(); owner.add(net); --- 1976,1980 ---- double ydistance = parameters.getDouble("y distance"); Space net; ! net = create(surface, xdistance, ydistance); Space owner = surface.getOwner(); owner.add(net); |
From: Michael L. <he...@us...> - 2007-12-13 08:21:38
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv382/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: final grid algorithm Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.270 retrieving revision 1.271 diff -C2 -d -r1.270 -r1.271 *** View.java 12 Dec 2007 12:56:09 -0000 1.270 --- View.java 13 Dec 2007 08:21:40 -0000 1.271 *************** *** 1473,1477 **** Vertex cross = v1.cross(v2); if (!cross.isZero()) { ! Edge intersect = e1.intersection(e2); if (intersect != null) { if (intersect.getLength() < 0.0000001) { --- 1473,1477 ---- Vertex cross = v1.cross(v2); if (!cross.isZero()) { ! Edge intersect = e1.shortestEdge(e2); if (intersect != null) { if (intersect.getLength() < 0.0000001) { *************** *** 1507,1511 **** } { ! Edge intersect = current.intersection(ray); Vertex intersection = intersect.getFrom(); return new Intersection(intersection, Intersection.EDGE, current); --- 1507,1511 ---- } { ! Edge intersect = current.shortestEdge(ray); Vertex intersection = intersect.getFrom(); return new Intersection(intersection, Intersection.EDGE, current); |
From: Michael L. <he...@us...> - 2007-12-13 08:21:38
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv382/src/net/sourceforge/bprocessor/gl/tool Modified Files: RotationTool.java ArcTool.java Log Message: final grid algorithm Index: ArcTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ArcTool.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ArcTool.java 11 Dec 2007 14:49:11 -0000 1.24 --- ArcTool.java 13 Dec 2007 08:21:40 -0000 1.25 *************** *** 108,112 **** l2.setStrippled(true); ! Edge inter = l1.intersection(l2); if (inter != null) { Vertex center = inter.getFrom(); --- 108,112 ---- l2.setStrippled(true); ! Edge inter = l1.shortestEdge(l2); if (inter != null) { Vertex center = inter.getFrom(); Index: RotationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationTool.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** RotationTool.java 22 Nov 2007 10:12:46 -0000 1.33 --- RotationTool.java 13 Dec 2007 08:21:40 -0000 1.34 *************** *** 407,411 **** Line l = iter.next(); Edge tmp = new Edge(l.getPointAt(p1), l.getPointAt(p2)); ! Edge con = e.intersection(tmp); if (con.getLength() < 0.1) { if (tmp.coincides(con.getFrom())) { --- 407,411 ---- Line l = iter.next(); Edge tmp = new Edge(l.getPointAt(p1), l.getPointAt(p2)); ! Edge con = e.shortestEdge(tmp); if (con.getLength() < 0.1) { if (tmp.coincides(con.getFrom())) { |
From: Michael L. <he...@us...> - 2007-12-13 08:21:38
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv365/src/net/sourceforge/bprocessor/model/modellor Modified Files: TileModellor.java Log Message: final grid algorithm Index: TileModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/TileModellor.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** TileModellor.java 12 Dec 2007 12:48:22 -0000 1.25 --- TileModellor.java 13 Dec 2007 08:21:34 -0000 1.26 *************** *** 307,311 **** for (Edge e1 : vertEdges) { for (Edge e2 : horEdges) { ! Edge inter = e1.intersection(e2); if (inter != null && inter.getLength() < 0.00001 && --- 307,311 ---- for (Edge e1 : vertEdges) { for (Edge e2 : horEdges) { ! Edge inter = e1.shortestEdge(e2); if (inter != null && inter.getLength() < 0.00001 && *************** *** 366,370 **** continue; } ! Edge found = slider.intersection(inside); if (found != null) { if (found.getLength() < 0.0001 && --- 366,370 ---- continue; } ! Edge found = slider.shortestEdge(inside); if (found != null) { if (found.getLength() < 0.0001 && |
From: Michael L. <he...@us...> - 2007-12-12 22:18:35
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6791/src/net/sourceforge/bprocessor/model Modified Files: Command.java Space.java Log Message: more cleanup Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.222 retrieving revision 1.223 diff -C2 -d -r1.222 -r1.223 *** Space.java 12 Dec 2007 15:06:55 -0000 1.222 --- Space.java 12 Dec 2007 16:11:49 -0000 1.223 *************** *** 1443,1477 **** public void computeEnvelope() { Collection vertices = collectInterior(); ! double xmin = Double.MAX_VALUE; ! double xmax = Double.MIN_VALUE; ! double ymin = Double.MAX_VALUE; ! double ymax = Double.MIN_VALUE; ! double zmin = Double.MAX_VALUE; ! double zmax = Double.MIN_VALUE; ! Iterator iter = vertices.iterator(); ! while (iter.hasNext()) { ! Vertex current = (Vertex) iter.next(); ! double x = current.getX(); ! double y = current.getY(); ! double z = current.getZ(); ! if (x < xmin) { ! xmin = x; ! } ! if (x > xmax) { ! xmax = x; ! } ! if (y < ymin) { ! ymin = y; ! } ! if (y > ymax) { ! ymax = y; ! } ! if (z < zmin) { ! zmin = z; ! } ! if (z > zmax) { ! zmax = z; ! } ! } Vertex p4 = new Vertex(xmin, ymin, zmin); Vertex p3 = new Vertex (xmin, ymax, zmin); --- 1443,1455 ---- public void computeEnvelope() { Collection vertices = collectInterior(); ! Command.BoundingBox box = new Command.BoundingBox(vertices); ! ! double xmin = box.xmin().getX(); ! double xmax = box.xmax().getX(); ! double ymin = box.ymin().getY(); ! double ymax = box.ymax().getY(); ! double zmin = box.zmin().getZ(); ! double zmax = box.zmax().getZ(); ! Vertex p4 = new Vertex(xmin, ymin, zmin); Vertex p3 = new Vertex (xmin, ymax, zmin); Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** Command.java 12 Dec 2007 15:06:55 -0000 1.55 --- Command.java 12 Dec 2007 16:11:49 -0000 1.56 *************** *** 1636,1657 **** system.translateIt(vertices); ! double xmin = Double.MAX_VALUE; ! double xmax = Double.MIN_VALUE; ! double ymin = Double.MAX_VALUE; ! double ymax = Double.MIN_VALUE; ! for (Vertex current : vertices) { ! if (current.getX() < xmin) { ! xmin = current.getX(); ! } ! if (current.getX() > xmax) { ! xmax = current.getX(); ! } ! if (current.getY() < ymin) { ! ymin = current.getY(); ! } ! if (current.getY() > ymax) { ! ymax = current.getY(); ! } ! } double width = xmax - xmin; --- 1636,1644 ---- system.translateIt(vertices); ! BoundingBox box = new BoundingBox(vertices); ! double xmin = box.xmin().getX(); ! double xmax = box.xmax().getX(); ! double ymin = box.ymin().getY(); ! double ymax = box.ymax().getY(); double width = xmax - xmin; *************** *** 1737,1760 **** List<Vertex> vertices = Offset.vertices(contour); ! List<Vertex> locals = system.translate(vertices); ! double xmin = Double.MAX_VALUE; ! double xmax = Double.MIN_VALUE; ! double ymin = Double.MAX_VALUE; ! double ymax = Double.MIN_VALUE; ! for (Vertex current : locals) { ! if (current.getX() < xmin) { ! xmin = current.getX(); ! } ! if (current.getX() > xmax) { ! xmax = current.getX(); ! } ! if (current.getY() < ymin) { ! ymin = current.getY(); ! } ! if (current.getY() > ymax) { ! ymax = current.getY(); ! } ! } double width = xmax - xmin; --- 1724,1734 ---- List<Vertex> vertices = Offset.vertices(contour); ! system.translateIt(vertices); ! BoundingBox box = new BoundingBox(vertices); ! double xmin = box.xmin().getX(); ! double xmax = box.xmax().getX(); ! double ymin = box.ymin().getY(); ! double ymax = box.ymax().getY(); double width = xmax - xmin; |
From: Michael L. <he...@us...> - 2007-12-12 15:07:01
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11609/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java OrbitStrategy.java Removed Files: CatmullClarkActionListener.java CatmullClark.java Log Message: Cleanup Index: OrbitStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OrbitStrategy.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** OrbitStrategy.java 18 Nov 2007 21:30:17 -0000 1.5 --- OrbitStrategy.java 12 Dec 2007 15:07:01 -0000 1.6 *************** *** 8,12 **** import net.sourceforge.bprocessor.gl.Editor; - import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Project; --- 8,11 ---- *************** *** 64,78 **** */ public void dragged(MouseEvent e) { - View view = editor.getView(); Camera c = Project.getInstance().getCurrentCamera(); - double[] roll = c.getRoll(); if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == MouseEvent.BUTTON1_DOWN_MASK || e.getButton() == MouseEvent.BUTTON1) { double angleX = ((double)(e.getX() - x) / 360) * Math.PI; double angleY = ((double)(e.getY() - y) / 360) * Math.PI; - double turn = 1; - if (roll[2] < 0) { - turn = -1; - } if (e.isShiftDown()) { --- 63,71 ---- *************** *** 84,93 **** Camera.rotateVerticallyEye(c, angleY); } else { ! // rotate camera about point of view (or selection if any) ! double[] pivot = AbstractTool.selectionCenter(); Camera.rotateHorizontally(c, -angleX, pivot); Camera.rotateVertically(c, angleY, pivot); } - //Project.getInstance().changed(c); x = e.getX(); y = e.getY(); --- 77,85 ---- Camera.rotateVerticallyEye(c, angleY); } else { ! // rotate camera about point of view ! double[] pivot = c.getCenter(); Camera.rotateHorizontally(c, -angleX, pivot); Camera.rotateVertically(c, angleY, pivot); } x = e.getX(); y = e.getY(); --- CatmullClark.java DELETED --- --- CatmullClarkActionListener.java DELETED --- Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.143 retrieving revision 1.144 diff -C2 -d -r1.143 -r1.144 *** AbstractTool.java 12 Dec 2007 12:48:27 -0000 1.143 --- AbstractTool.java 12 Dec 2007 15:07:01 -0000 1.144 *************** *** 232,253 **** /** - * Calculate the center of the selection - * TODO calculate the average.. - * @return The center of the selection - */ - public static double[] selectionCenter() { - double[] center = Project.getInstance().getCurrentCamera().getCenter(); - Iterator it = Selection.primary().iterator(); - if (it.hasNext()) { - Object o = it.next(); - if (o instanceof Geometric) { - Vertex v = ((Geometric)o).center(); - center = new double[] {v.getX(), v.getY(), v.getZ()}; - } - } - return center; - } - - /** * Sets the tip in the tip-panel * @param tip the tip --- 232,235 ---- |
From: Michael L. <he...@us...> - 2007-12-12 15:06:52
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11598/src/net/sourceforge/bprocessor/model Modified Files: Command.java Space.java Log Message: Cleanup Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.221 retrieving revision 1.222 diff -C2 -d -r1.221 -r1.222 *** Space.java 12 Dec 2007 14:38:43 -0000 1.221 --- Space.java 12 Dec 2007 15:06:55 -0000 1.222 *************** *** 1107,1125 **** /** ! * Return the center of gravity ! * @return The center vertex */ @Override public Vertex center() { ! Vertex average = new Vertex(0, 0, 0); ! Set verts = collect(); ! if (!verts.isEmpty()) { ! Iterator it = verts.iterator(); ! while (it.hasNext()) { ! average = average.add((Vertex)it.next()); ! } ! average.scaleIt(1.0 / (double)verts.size()); ! } ! return average; } --- 1107,1115 ---- /** ! * {@inheritDoc} */ @Override public Vertex center() { ! return Vertex.center(collect()); } Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** Command.java 12 Dec 2007 12:48:23 -0000 1.54 --- Command.java 12 Dec 2007 15:06:55 -0000 1.55 *************** *** 474,497 **** return e1.to; } ! } ! ! /** ! * Compute the average of a collection of vertices ! * @param vertices collection of vertices ! * @return average ! */ ! public static Vertex average(Collection<Vertex> vertices) { ! double x = 0; ! double y = 0; ! double z = 0; ! for (Vertex current : vertices) { ! x += current.x; ! y += current.y; ! z += current.z; ! } ! int n = vertices.size(); ! return new Vertex(x / n, y / n, z / n); ! } ! private List<Surface> subdivide(List<Surface> faces) { --- 474,478 ---- return e1.to; } ! } private List<Surface> subdivide(List<Surface> faces) { *************** *** 565,569 **** vs.add(edge.otherVertex(edgepoint)); } ! edgepoint.set(average(vs)); } } --- 546,550 ---- vs.add(edge.otherVertex(edgepoint)); } ! edgepoint.set(Vertex.center(vs)); } } *************** *** 595,600 **** } ! Vertex a1 = average(vs); ! Vertex a2 = average(fs); double x = ((n - 2) * current.x) / n + a1.x / n + a2.x / n; double y = ((n - 2) * current.y) / n + a1.y / n + a2.y / n; --- 576,581 ---- } ! Vertex a1 = Vertex.center(vs); ! Vertex a2 = Vertex.center(fs); double x = ((n - 2) * current.x) / n + a1.x / n + a2.x / n; double y = ((n - 2) * current.y) / n + a1.y / n + a2.y / n; |