bprocessor-commit Mailing List for B-processor (Page 94)
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...> - 2006-10-20 17:04:54
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24202/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: The display name of a space again contains the ID Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** Space.java 19 Oct 2006 15:28:51 -0000 1.84 --- Space.java 20 Oct 2006 17:04:45 -0000 1.85 *************** *** 1417,1420 **** --- 1417,1428 ---- return res; } + + /** + * Display name + * @return display name + */ + public String getDisplayName() { + return name + " - " + id; + } /** |
From: Michael L. <he...@us...> - 2006-10-20 17:04:53
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24224/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: The display name of a space again contains the ID Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** GenericTreeView.java 16 Oct 2006 08:43:32 -0000 1.59 --- GenericTreeView.java 20 Oct 2006 17:04:50 -0000 1.60 *************** *** 559,566 **** */ public String toString() { ! Object object = this.getUserObject(); ! Entity entity = (Entity) object; ! String nid = entity.getName(); ! if (GUI.getInstance().isClosed((Space)object)) { nid += " (C)"; } else { --- 559,564 ---- */ public String toString() { ! String nid = current.getDisplayName(); ! if (GUI.getInstance().isClosed(current)) { nid += " (C)"; } else { |
From: Michael L. <he...@us...> - 2006-10-20 17:04:49
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24189/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: The display name of a space again contains the ID Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** SpaceTool.java 19 Oct 2006 09:56:14 -0000 1.57 --- SpaceTool.java 20 Oct 2006 17:04:40 -0000 1.58 *************** *** 570,574 **** Space domain = (Space)domIt.next(); if (domain instanceof Space) { ! JMenuItem domainItem = new JMenuItem(domain.getName()); ActionListener ml = new DomainPopupListener(domain, surface, --- 570,574 ---- Space domain = (Space)domIt.next(); if (domain instanceof Space) { ! JMenuItem domainItem = new JMenuItem(domain.getDisplayName()); ActionListener ml = new DomainPopupListener(domain, surface, |
From: Michael L. <he...@us...> - 2006-10-19 15:29:00
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2634/src/net/sourceforge/bprocessor/model Modified Files: Geometry.java Space.java Log Message: Improved geometry insertion Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** Space.java 19 Oct 2006 09:56:21 -0000 1.83 --- Space.java 19 Oct 2006 15:28:51 -0000 1.84 *************** *** 621,630 **** */ public Edge insert(Edge edge) { ! if (edge.getLength() == 0) { ! return null; } Vertex from = insert(edge.getFrom()); Vertex to = insert(edge.getTo()); edge.setFrom(from); edge.setTo(to); --- 621,634 ---- */ public Edge insert(Edge edge) { ! if (edge.getOwner() == this) { ! return edge; } Vertex from = insert(edge.getFrom()); Vertex to = insert(edge.getTo()); + if (from == to) { + return null; + } + edge.setFrom(from); edge.setTo(to); Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Geometry.java 19 Oct 2006 09:56:21 -0000 1.33 --- Geometry.java 19 Oct 2006 15:28:51 -0000 1.34 *************** *** 178,187 **** /** ! * Insert the list of edges in the model by splitting ! * surfaces etc. * @param edges The list of edges * @return a list of the surfaces created */ ! public static List insert(List edges) { List result = new LinkedList(); Edge first = (Edge) edges.get(0); --- 178,186 ---- /** ! * Find surfaces formed by a sequence of newly inserted edges * @param edges The list of edges * @return a list of the surfaces created */ ! public static List surfaceAnalysis(List edges) { List result = new LinkedList(); Edge first = (Edge) edges.get(0); *************** *** 762,779 **** Space space = Project.getInstance().getActiveSpace(); List result = new LinkedList(); ! if (!edges.isEmpty()) { ! Vertex v = Edge.commonVertex((Edge) edges.get(0), (Edge) edges.get(edges.size() - 1)); ! if (v != null && edges.size() > 2) { ! List actual = new LinkedList(); ! Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! Edge edge = space.insert(current); ! if (edge != null) { ! actual.add(edge); ! } } ! if (actual.size() > 2) { ! Surface surface = new Surface(actual); result.add(surface); space.add(surface); --- 761,781 ---- Space space = Project.getInstance().getActiveSpace(); List result = new LinkedList(); ! List actual = new LinkedList(); ! { ! Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! Edge edge = space.insert(current); ! if (edge != null) { ! actual.add(edge); } ! } ! } ! if (!actual.isEmpty()) { ! Vertex v = Edge.commonVertex((Edge) actual.get(0), (Edge) actual.get(actual.size() - 1)); ! if (v != null && actual.size() > 2) { ! Surface surface = new Surface(actual); ! Surface existing = space.findSurface(surface); ! if (existing == null) { result.add(surface); space.add(surface); *************** *** 781,794 **** } } else { ! List actual = new LinkedList(); ! Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! Edge edge = space.insert(current); ! if (edge != null) { ! actual.add(edge); ! } ! } ! result.addAll(insert(actual)); } } --- 783,787 ---- } } else { ! result.addAll(surfaceAnalysis(actual)); } } |
From: Michael L. <he...@us...> - 2006-10-19 15:28:56
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2625/src/net/sourceforge/bprocessor/gl/tool Modified Files: RectTool.java Log Message: Improved geometry insertion Index: RectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RectTool.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** RectTool.java 10 Oct 2006 15:03:26 -0000 1.17 --- RectTool.java 19 Oct 2006 15:28:46 -0000 1.18 *************** *** 40,43 **** --- 40,52 ---- where the rectangle was moved */ private Vertex lastCurrent; + + /** + * Info + * @param object Object + */ + public static void info(Object object) { + log.info(object); + } + /** * Constructor |
From: Michael L. <he...@us...> - 2006-10-19 09:56:23
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv552/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java Surface.java Geometry.java Space.java Log Message: Refactored geometry insertion Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** Edge.java 16 Oct 2006 15:14:51 -0000 1.62 --- Edge.java 19 Oct 2006 09:56:21 -0000 1.63 *************** *** 96,105 **** while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! if (current.coincides(vertex)) { ! result.add(current); } } return result; } /** --- 96,126 ---- while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! if (!current.protect()) { ! if (current.coincides(vertex)) { ! result.add(current); ! } } } return result; } + + /** + * Find edge that are equivalent to edge + * @param edges Collection of edges + * @param edge Edge + * @return equivalent edge + */ + public static Edge findEdge(Collection edges, Edge edge) { + Iterator iter = edges.iterator(); + while (iter.hasNext()) { + Edge current = (Edge) iter.next(); + if (!current.protect()) { + if (current.equivalent(edge)) { + return current; + } + } + } + return null; + } /** *************** *** 184,187 **** --- 205,223 ---- /** + * Return true if this edge is equivalent to the other edge + * @param other Edge + * @return True if equivalent + */ + public boolean equivalent(Edge other) { + if (other.getFrom() == from && other.getTo() == to) { + return true; + } + if (other.getFrom() == to && other.getTo() == from) { + return true; + } + return false; + } + + /** * Get the name * @return The name Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.115 retrieving revision 1.116 diff -C2 -d -r1.115 -r1.116 *** Surface.java 14 Oct 2006 23:41:03 -0000 1.115 --- Surface.java 19 Oct 2006 09:56:21 -0000 1.116 *************** *** 61,64 **** --- 61,83 ---- /** + * Find equivalent surface in collection of surfaces + * @param surfaces Collection of surfaces + * @param surface Surface + * @return equivalent surface + */ + public static Surface findSurface(Collection surfaces, Surface surface) { + Iterator iter = surfaces.iterator(); + while (iter.hasNext()) { + Surface current = (Surface) iter.next(); + if (!current.protect()) { + if (current.equivalent(surface)) { + return current; + } + } + } + return null; + } + + /** * Constructor for surface */ *************** *** 146,149 **** --- 165,178 ---- /** + * Test if this surface is equivalent to the other surface + * @param other Surface + * @return true if equivalent + */ + public boolean equivalent(Surface other) { + Set others = new HashSet(other.getEdges()); + return others.containsAll(edges); + } + + /** * Return an ordered list of vertices around this Surface. * @return An ordered list of vertices around this Surface Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** Space.java 16 Oct 2006 06:49:25 -0000 1.82 --- Space.java 19 Oct 2006 09:56:21 -0000 1.83 *************** *** 514,521 **** * Insert a vertex * @param vertex The vertex - * @param split Split edges * @return The vertex */ ! public Vertex insert(Vertex vertex, boolean split) { Space space = this; if (vertex.getOwner() != null) { --- 514,520 ---- * Insert a vertex * @param vertex The vertex * @return The vertex */ ! public Vertex insert(Vertex vertex) { Space space = this; if (vertex.getOwner() != null) { *************** *** 527,558 **** } ! Vertex actual = null; ! { ! Set vertices = ! space.findByLocation (vertex.getX(), vertex.getY(), vertex.getZ(), 0.0000001); ! if (!vertices.isEmpty()) { ! Iterator iter = vertices.iterator(); ! while (iter.hasNext()) { ! Vertex current = (Vertex) iter.next(); ! if (!current.protect()) { ! actual = current; ! } ! } ! } ! } if (actual == null) { actual = vertex; space.add(actual); ! if (split) { ! Set es = space.findEdge(actual); ! if (es.size() > 0) { ! Iterator iter = es.iterator(); ! while (iter.hasNext()) { ! Edge e = (Edge) iter.next(); ! if (!e.getStrippled() && !e.protect()) { ! e.split(actual); ! } ! } } } --- 526,540 ---- } ! Vertex actual = space.findVertex(vertex); if (actual == null) { actual = vertex; space.add(actual); ! Set es = space.findEdge(actual); ! if (es.size() > 0) { ! Iterator iter = es.iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! current.split(actual); } } *************** *** 636,674 **** * Insert a edge * @param edge The edge - * @param split Split edges * @return The edge */ ! public Edge insert(Edge edge, boolean split) { ! Space space = this; ! ! Edge actual = edge; if (edge.getLength() == 0) { return null; } ! Vertex from = space.insert(edge.getFrom(), split); ! Vertex to = space.insert(edge.getTo(), split); edge.setFrom(from); edge.setTo(to); ! { ! Collection edges = space.getEdges(); ! Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! if (!current.protect()) { ! if (current.getFrom() == edge.getFrom() && current.getTo() == edge.getTo()) { ! actual = current; ! break; ! } ! if (current.getFrom() == edge.getTo() && current.getTo() == edge.getFrom()) { ! actual = current; ! break; ! } ! } ! } ! } ! if (actual == edge) { ! space.add(edge); } - return actual; } --- 618,641 ---- * Insert a edge * @param edge The edge * @return The edge */ ! public Edge insert(Edge edge) { if (edge.getLength() == 0) { return null; } ! ! Vertex from = insert(edge.getFrom()); ! Vertex to = insert(edge.getTo()); edge.setFrom(from); edge.setTo(to); ! ! Edge existing = findEdge(edge); ! ! if (existing != null) { ! return existing; ! } else { ! add(edge); ! return edge; } } *************** *** 889,944 **** * Insert a surface * @param surface The surface - * @param split Allow splits * @return The surface */ ! public Surface insert(Surface surface, boolean split) { List edges = surface.getEdges(); - - Collection vertices = this.getVertices(); - { - Iterator iter = vertices.iterator(); - while (iter.hasNext()) { - Vertex current = (Vertex) iter.next(); - Collection es = Edge.findEdge(edges, current); - Iterator esit = es.iterator(); - while (esit.hasNext()) { - Edge edge = (Edge) esit.next(); - System.out.println("split " + edge + " by " + current); - Collection rep = edge.split(current); - Iterator i = rep.iterator(); - Edge e1 = (Edge) i.next(); - Edge e2 = (Edge) i.next(); - System.out.println("replace " + edge + " with " + e1 + " and " + e2); - surface.replace(edge, e1, e2); - } - } - } edges = surface.getEdges(); ! List actual = new LinkedList(); { Iterator iter = edges.iterator(); while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! actual.add(insert(current, split)); } } ! Surface shadow = surface; ! { ! Collection surfaces = getSurfaces(); ! Iterator iter = surfaces.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! Set others = new HashSet(current.getEdges()); ! if (others.containsAll(actual)) { ! shadow = current; ! } ! } ! } ! if (shadow == surface) { ! surface.setEdges(actual); add(surface); Geometry.holeAnalysis(surface); } else { ! Vertex n1 = shadow.normal(); Vertex n2 = surface.normal(); double dot = n1.dot(n2); --- 856,882 ---- * Insert a surface * @param surface The surface * @return The surface */ ! public Surface insert(Surface surface) { List edges = surface.getEdges(); edges = surface.getEdges(); ! List lst = new LinkedList(); { Iterator iter = edges.iterator(); while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! lst.add(insert(current)); } } ! surface.setEdges(lst); ! ! Surface existing = findSurface(surface); ! ! if (existing == null) { add(surface); Geometry.holeAnalysis(surface); + existing = surface; } else { ! Vertex n1 = existing.normal(); Vertex n2 = surface.normal(); double dot = n1.dot(n2); *************** *** 953,965 **** } if (front != null) { ! shadow.setFrontDomain(front); } if (back != null) { ! shadow.setBackDomain(back); } surface.setFrontDomain(null); surface.setBackDomain(null); } ! return shadow; } --- 891,903 ---- } if (front != null) { ! existing.setFrontDomain(front); } if (back != null) { ! existing.setBackDomain(back); } surface.setFrontDomain(null); surface.setBackDomain(null); } ! return existing; } *************** *** 1121,1124 **** --- 1059,1092 ---- /** + * Find vertex that coincides with the vertex + * @param vertex Vertex + * @return vertex that concides + */ + public Vertex findVertex(Vertex vertex) { + Collection vertices = getVertices(); + return Vertex.findVertex(vertices, vertex); + } + + /** + * Find surface that coincides with the given surface + * @param surface Surface + * @return equivalent surface + */ + public Surface findSurface(Surface surface) { + Collection surfaces = getSurfaces(); + return Surface.findSurface(surfaces, surface); + } + + /** + * Find equivalent edge + * @param edge Edge + * @return equivalent edge + */ + public Edge findEdge(Edge edge) { + Collection edges = getEdges(); + return Edge.findEdge(edges, edge); + } + + /** * Get the modellor * @return The modellor Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** Vertex.java 5 Oct 2006 11:27:04 -0000 1.47 --- Vertex.java 19 Oct 2006 09:56:21 -0000 1.48 *************** *** 41,44 **** --- 41,63 ---- /** + * Find vertex that coincides with the vertex + * @param vertices Collection + * @param vertex Vertex + * @return set of vertices + */ + public static Vertex findVertex(Collection vertices, Vertex vertex) { + Iterator iter = vertices.iterator(); + while (iter.hasNext()) { + Vertex current = (Vertex) iter.next(); + if (!current.protect()) { + if (current.coincides(vertex)) { + return current; + } + } + } + return null; + } + + /** * Constructor for persistence layer */ Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Geometry.java 9 Oct 2006 14:03:15 -0000 1.32 --- Geometry.java 19 Oct 2006 09:56:21 -0000 1.33 *************** *** 769,773 **** while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! Edge edge = space.insert(current, false); if (edge != null) { actual.add(edge); --- 769,773 ---- while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! Edge edge = space.insert(current); if (edge != null) { actual.add(edge); *************** *** 785,789 **** while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! Edge edge = space.insert(current, true); if (edge != null) { actual.add(edge); --- 785,789 ---- while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! Edge edge = space.insert(current); if (edge != null) { actual.add(edge); |
From: Michael L. <he...@us...> - 2006-10-19 09:56:23
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv537/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: Refactored geometry insertion Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** SpaceTool.java 17 Oct 2006 09:11:15 -0000 1.56 --- SpaceTool.java 19 Oct 2006 09:56:14 -0000 1.57 *************** *** 698,701 **** --- 698,708 ---- } }); + globals.put("back", new Builtin() { + public void evaluate(Environment env, Stack stack) { + Surface surface = (Surface) env.get(0); + Space space = (Space) env.get(1); + surface.setBackDomain(space); + } + }); globals.put("space", new Builtin() { public void evaluate(Environment env, Stack stack) { *************** *** 785,795 **** Object result = stack.pop(); if (result instanceof Vertex) { ! result = space.insert((Vertex)result, true); Selection.primary().add(result); } else if (result instanceof Edge) { ! result = space.insert((Edge)result, true); Selection.primary().add(result); } else if (result instanceof Surface) { ! result = space.insert((Surface) result, true); Selection.primary().add(result); } else if (result instanceof Space) { --- 792,802 ---- Object result = stack.pop(); if (result instanceof Vertex) { ! result = space.insert((Vertex)result); Selection.primary().add(result); } else if (result instanceof Edge) { ! result = space.insert((Edge)result); Selection.primary().add(result); } else if (result instanceof Surface) { ! result = space.insert((Surface) result); Selection.primary().add(result); } else if (result instanceof Space) { |
From: Nordholt <nor...@us...> - 2006-10-17 12:20:02
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22368/src/net/sourceforge/bprocessor/model Modified Files: Line.java Point.java CoordinateSystem.java Log Message: Changing general names to include a "B-" prefix Index: Point.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Point.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Point.java 29 Sep 2006 14:57:24 -0000 1.11 --- Point.java 17 Oct 2006 12:20:00 -0000 1.12 *************** *** 77,81 **** */ public String getGeneralName() { ! return "Point"; } --- 77,81 ---- */ public String getGeneralName() { ! return "B-Point"; } Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** CoordinateSystem.java 29 Sep 2006 14:57:24 -0000 1.28 --- CoordinateSystem.java 17 Oct 2006 12:20:00 -0000 1.29 *************** *** 393,399 **** public String getGeneralName() { if (onlyPlane()) { ! return "Plane"; } else { ! return "Coordinatesystem"; } } --- 393,399 ---- public String getGeneralName() { if (onlyPlane()) { ! return "B-Plane"; } else { ! return "B-System"; } } Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Line.java 29 Sep 2006 14:57:24 -0000 1.26 --- Line.java 17 Oct 2006 12:20:00 -0000 1.27 *************** *** 181,185 **** */ public String getGeneralName() { ! return "Line"; } --- 181,185 ---- */ public String getGeneralName() { ! return "B-Line"; } |
From: Michael L. <he...@us...> - 2006-10-17 09:28:49
|
Update of /cvsroot/bprocessor/build/doc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19970/doc Modified Files: Changelog Log Message: Changelog updated Index: Changelog =================================================================== RCS file: /cvsroot/bprocessor/build/doc/Changelog,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Changelog 5 Apr 2006 14:13:59 -0000 1.9 --- Changelog 17 Oct 2006 09:28:47 -0000 1.10 *************** *** 2,6 **** ========== ! 2006/3/5: Release M5 --- 2,12 ---- ========== ! 2006/10/17: Release M7 ! - Scripting language implemented ! - Experimental version of parametric objects implemented: ! - Facade ! - Window ! - Initial work on Unions and Instantiation/Transformations of Unions ! 2006/3/5: Release M5 |
From: Michael L. <he...@us...> - 2006-10-17 09:26:12
|
Update of /cvsroot/bprocessor/build In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19137 Modified Files: build.xml Log Message: Version number changed to M7 Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/build/build.xml,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** build.xml 12 Sep 2006 09:25:51 -0000 1.23 --- build.xml 17 Oct 2006 09:26:07 -0000 1.24 *************** *** 3,7 **** <target name="init"> <property name="project" value="bprocessor"/> ! <property name="version" value="M6-b"/> <property name="script.dir" value="${basedir}/bin"/> --- 3,7 ---- <target name="init"> <property name="project" value="bprocessor"/> ! <property name="version" value="M7"/> <property name="script.dir" value="${basedir}/bin"/> |
From: Michael L. <he...@us...> - 2006-10-17 09:19:38
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13177/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Added checkpoint after script-evaluation Fixed bug in facade-modellor Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** Project.java 16 Oct 2006 12:19:32 -0000 1.84 --- Project.java 17 Oct 2006 09:11:07 -0000 1.85 *************** *** 585,588 **** --- 585,589 ---- currentState = (Bmodel) undoStack.pop(); setState(currentState); + Selection.primary().clear(); } } *************** *** 598,601 **** --- 599,603 ---- currentState = (Bmodel) redoStack.pop(); setState(currentState); + Selection.primary().clear(); } } |
From: Michael L. <he...@us...> - 2006-10-17 09:11:24
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13371/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: Added checkpoint after script-evaluation Fixed bug in facade-modellor Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** SpaceTool.java 14 Oct 2006 23:37:33 -0000 1.55 --- SpaceTool.java 17 Oct 2006 09:11:15 -0000 1.56 *************** *** 800,803 **** --- 800,804 ---- } } + Project.getInstance().checkpoint(); typing = false; } catch (Exception error) { *************** *** 815,819 **** */ public void key(KeyEvent event) { ! if (!event.isAltDown() && !event.isControlDown()) { String value; if (typing) { --- 816,820 ---- */ public void key(KeyEvent event) { ! if (!event.isControlDown() && !event.isMetaDown()) { String value; if (typing) { |
From: Michael L. <he...@us...> - 2006-10-17 09:11:23
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13350/src/net/sourceforge/bprocessor/facade/modellor Modified Files: FacadeModellor.java Log Message: Added checkpoint after script-evaluation Fixed bug in facade-modellor Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** FacadeModellor.java 16 Oct 2006 08:44:25 -0000 1.24 --- FacadeModellor.java 17 Oct 2006 09:11:11 -0000 1.25 *************** *** 109,116 **** /** The horizontal post-segments */ ! private Line[][] horSegs; /** The vertical post-segments */ ! private Line[][] vertSegs; /** Mapping from a segment to a boolean --- 109,116 ---- /** The horizontal post-segments */ ! private Line[][] horSegs = new Line[0][0]; /** The vertical post-segments */ ! private Line[][] vertSegs = new Line[0][0]; /** Mapping from a segment to a boolean *************** *** 496,501 **** */ private void removeSegmentLines() { ! for (int i = 0; i < vertPosts; i++) { ! for (int j = 0; j < horPosts; j++) { if (vertSegs[i][j] != null && vertSegs[i][j].getOwner() != null && --- 496,501 ---- */ private void removeSegmentLines() { ! for (int i = 0; i < vertSegs.length; i++) { ! for (int j = 0; j < vertSegs[i].length; j++) { if (vertSegs[i][j] != null && vertSegs[i][j].getOwner() != null && |
From: Nordholt <nor...@us...> - 2006-10-16 15:15:11
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1368/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: Fixed error ocurring in offset when a surface was flipped. Should now work in some more cases. Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** Edge.java 16 Oct 2006 06:49:25 -0000 1.61 --- Edge.java 16 Oct 2006 15:14:51 -0000 1.62 *************** *** 584,588 **** */ public static List offset(List which, Surface inner, double offset, Map directions) { - boolean clockwise = Geometry.angle(inner.getVertices()) > 0; HashSet edges = new HashSet(which); ArrayList res = new ArrayList(); --- 584,587 ---- *************** *** 594,598 **** HashMap v2v = new HashMap(); Edge prevEdge = null; ! // Find all the affected vertexes and make the edges Iterator iter = inner.getEdges().iterator(); while (iter.hasNext()) { --- 593,598 ---- HashMap v2v = new HashMap(); Edge prevEdge = null; ! Edge firstEdge = null; ! // Find all the affected vertices and make the edges Iterator iter = inner.getEdges().iterator(); while (iter.hasNext()) { *************** *** 615,665 **** v2v.put(from, e.getFrom()); res.add(new Edge(from, to)); ! /*if (from2edge.containsKey(e.getFrom()) || prevEdge == null) { ! from2edge.put(e.getTo(), e); ! to2edge.put(e.getFrom(), e); ! } else { ! from2edge.put(e.getFrom(), e); ! to2edge.put(e.getTo(), e); ! }*/ ! Vertex common = Edge.commonVertex(e, prevEdge); ! if (common == null) { ! from2edge.put(e.getFrom(), e); ! to2edge.put(e.getTo(), e); ! } else { ! if (from2edge.containsKey(common)) { ! to2edge.put(common, e); ! from2edge.put(e.otherVertex(common), e); ! } else if (to2edge.containsKey(common)) { ! from2edge.put(common, e); ! to2edge.put(e.otherVertex(common), e); ! } else { ! log.error("common should be either from or to???"); ! } ! } } else { ! Vertex common = Edge.commonVertex(e, prevEdge); ! if (common == null) { ! from2edge.put(e.getFrom(), e); ! to2edge.put(e.getTo(), e); ! } else { ! if (from2edge.containsKey(common)) { ! to2edge.put(common, e); ! from2edge.put(e.otherVertex(common), e); ! } else if (to2edge.containsKey(common)) { ! from2edge.put(common, e); ! to2edge.put(e.otherVertex(common), e); ! } else { ! log.error("common should be either from or to???"); ! } ! } } prevEdge = e; } // calculate the directions iter = directions.values().iterator(); while (iter.hasNext()) { Direction dir = (Direction)iter.next(); ! Vertex work = (Vertex)v2v.get(dir.getVertex()); ! Vertex normal = inner.normal(); Edge e1 = (Edge)to2edge.get(work); Edge e2 = (Edge)from2edge.get(work); --- 615,638 ---- v2v.put(from, e.getFrom()); res.add(new Edge(from, to)); ! } ! if (prevEdge != null) { ! Vertex common = commonVertex(prevEdge, e); ! from2edge.put(common, prevEdge); ! to2edge.put(common, e); } else { ! firstEdge = e; } prevEdge = e; } + Vertex common = commonVertex(firstEdge, prevEdge); + from2edge.put(common, prevEdge); + to2edge.put(common, firstEdge); + // calculate the directions + Vertex normal = inner.normal(); iter = directions.values().iterator(); while (iter.hasNext()) { Direction dir = (Direction)iter.next(); ! Vertex work = (Vertex)v2v.get(dir.getVertex()); Edge e1 = (Edge)to2edge.get(work); Edge e2 = (Edge)from2edge.get(work); *************** *** 674,682 **** dir2.normalize(); Vertex mainDir = dir1.add(dir2); ! if (clockwise) { ! mainDir.scale(-1 / mainDir.dot(dir1)); ! } else { ! mainDir.scale(1 / mainDir.dot(dir1)); ! } dir.setDirection(mainDir); } else { --- 647,651 ---- dir2.normalize(); Vertex mainDir = dir1.add(dir2); ! mainDir.scale(1 / mainDir.dot(dir1)); dir.setDirection(mainDir); } else { *************** *** 688,696 **** Vertex dir2 = other.minus(work); dir2.normalize(); ! if (clockwise) { ! dir2.scale(-1 / dir2.dot(dir1)); ! } else { ! dir2.scale(1 / dir2.dot(dir1)); ! } dir.setDirection(dir2); } --- 657,661 ---- Vertex dir2 = other.minus(work); dir2.normalize(); ! dir2.scale(1 / dir2.dot(dir1)); dir.setDirection(dir2); } *************** *** 703,711 **** Vertex dir1 = other.minus(work); dir1.normalize(); ! if (clockwise) { ! dir1.scale(-1 / dir1.dot(dir2)); ! } else { ! dir1.scale(1 / dir1.dot(dir2)); ! } dir.setDirection(dir1); } --- 668,672 ---- Vertex dir1 = other.minus(work); dir1.normalize(); ! dir1.scale(1 / dir1.dot(dir2)); dir.setDirection(dir1); } *************** *** 715,729 **** while (diriter.hasNext()) { Direction cur = (Direction)diriter.next(); ! Vertex dir = cur.getDirection().copy(); dir.scale(offset); cur.getVertex().move(dir.getX(), dir.getY(), dir.getZ()); ! } ! return res; } /** ! * Find the common edge of the two given edges, if ther is one ! * otherwise it just return null * @param e1 The first edge * @param e2 The second edge --- 676,691 ---- while (diriter.hasNext()) { Direction cur = (Direction)diriter.next(); ! Vertex dir = cur.getDirection(); ! dir.scale(-1); ! dir = dir.copy(); dir.scale(offset); cur.getVertex().move(dir.getX(), dir.getY(), dir.getZ()); ! } return res; } /** ! * Find the common vertex of the two given edges, if there is one ! * otherwise return null * @param e1 The first edge * @param e2 The second edge |
From: Nordholt <nor...@us...> - 2006-10-16 15:07:13
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30563/src/net/sourceforge/bprocessor/gl/tool Modified Files: OffsetTool.java Log Message: Fixed error ocurring in offset when a surface was flipped. Should now work in some more cases. Index: OffsetTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** OffsetTool.java 10 Oct 2006 15:02:25 -0000 1.11 --- OffsetTool.java 16 Oct 2006 15:07:00 -0000 1.12 *************** *** 103,111 **** feedback(contour); outNormal = startEdge.getDirection().cross(surface.normal()); if (current.vertex().minus(start.vertex()).dot(outNormal) > 0) { outNormal.scale(1 / outNormal.length()); } else { outNormal.scale(-1 / outNormal.length()); ! } } lastOffsetPoint = current.vertex().copy(); --- 103,112 ---- feedback(contour); outNormal = startEdge.getDirection().cross(surface.normal()); + outNormal.scale(1 / outNormal.length()); if (current.vertex().minus(start.vertex()).dot(outNormal) > 0) { outNormal.scale(1 / outNormal.length()); } else { outNormal.scale(-1 / outNormal.length()); ! } } lastOffsetPoint = current.vertex().copy(); *************** *** 144,148 **** Direction d = (Direction)it.next(); Vertex dir; ! dir = d.getDirection().copy(1); dir.scale(length); d.getVertex().move(dir.getX(), dir.getY(), dir.getZ()); --- 145,149 ---- Direction d = (Direction)it.next(); Vertex dir; ! dir = d.getDirection().copy(); dir.scale(length); d.getVertex().move(dir.getX(), dir.getY(), dir.getZ()); |
From: Michael L. <he...@us...> - 2006-10-16 12:19:35
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27836/src/net/sourceforge/bprocessor/model Modified Files: Project.java Persistence.java Log Message: Fixed bug in persistence Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Persistence.java 16 Oct 2006 08:44:29 -0000 1.14 --- Persistence.java 16 Oct 2006 12:19:32 -0000 1.15 *************** *** 1091,1095 **** */ private static void externalizeReferences(Constructor object, ConstructorType xml, Map map) { ! Iterator iter = object.collect().iterator(); while (iter.hasNext()) { long l = id(map, iter.next()); --- 1091,1095 ---- */ private static void externalizeReferences(Constructor object, ConstructorType xml, Map map) { ! Iterator iter = object.getConnectedGeometry().iterator(); while (iter.hasNext()) { long l = id(map, iter.next()); Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** Project.java 16 Oct 2006 06:49:25 -0000 1.83 --- Project.java 16 Oct 2006 12:19:32 -0000 1.84 *************** *** 206,210 **** this.setActiveCoordinateSystem(cs); cs.setActive(true); - System.out.println("clearing"); changed(this); } --- 206,209 ---- |
From: rimestad <rim...@us...> - 2006-10-16 08:44:37
|
Update of /cvsroot/bprocessor/model/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6357/src/etc Modified Files: bprocessor.xsd Log Message: small fixes to the xmlification of modellors Index: bprocessor.xsd =================================================================== RCS file: /cvsroot/bprocessor/model/src/etc/bprocessor.xsd,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** bprocessor.xsd 14 Oct 2006 23:42:43 -0000 1.21 --- bprocessor.xsd 16 Oct 2006 08:44:29 -0000 1.22 *************** *** 112,115 **** --- 112,116 ---- <xsd:sequence> <xsd:element ref="vertex" maxOccurs="1" minOccurs="0"/> + <xsd:element name="connected" type="xsd:long" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> <xsd:attribute name="active" type="xsd:boolean" use="required"/> |
From: rimestad <rim...@us...> - 2006-10-16 08:44:31
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6357/src/net/sourceforge/bprocessor/model Modified Files: Persistence.java Log Message: small fixes to the xmlification of modellors Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Persistence.java 14 Oct 2006 23:42:43 -0000 1.13 --- Persistence.java 16 Oct 2006 08:44:29 -0000 1.14 *************** *** 221,240 **** while (iter.hasNext()) { TransformType current = (TransformType) iter.next(); ! if (current instanceof RotateType) { ! RotateType rot = (RotateType) current; ! space.addTransform(new Rotate(rot.getX(), rot.getY(), rot.getZ())); ! } else if (current instanceof IDTransformType) { ! space.addTransform(new IDTransform()); ! } else if (current instanceof AxisRotateType) { ! AxisRotateType arot = (AxisRotateType) current; ! space.addTransform( ! new AxisRotate(arot.getAngle(), arot.getX(), arot.getY(), arot.getZ())); ! } else if (current instanceof ScaleType) { ! ScaleType st = (ScaleType) current; ! space.addTransform(new Scale(st.getX(), st.getY(), st.getZ())); ! } else if (current instanceof TranslateType) { ! TranslateType tt = (TranslateType) current; ! space.addTransform(new Translate(tt.getX(), tt.getY(), tt.getZ())); ! } } } --- 221,225 ---- while (iter.hasNext()) { TransformType current = (TransformType) iter.next(); ! space.addTransform(internalizeTransformation(current, xmls)); } } *************** *** 243,255 **** while (iter.hasNext()) { Object current = iter.next(); if (current instanceof CoordinateSystemType) { ! space.add(internalizeCoordinateSystem((CoordinateSystemType)current, mapper, xmls)); } else if (current instanceof PointType) { ! space.add(internalizePoint((PointType)current, mapper, xmls)); } else if (current instanceof LineType) { ! space.add(internalizeLine((LineType)current, mapper, xmls)); } else { log.info("Const were " + current.getClass()); } } } --- 228,251 ---- while (iter.hasNext()) { Object current = iter.next(); + Constructor c = null; if (current instanceof CoordinateSystemType) { ! c = internalizeCoordinateSystem((CoordinateSystemType)current, mapper, xmls); } else if (current instanceof PointType) { ! c = internalizePoint((PointType)current, mapper, xmls); } else if (current instanceof LineType) { ! c = internalizeLine((LineType)current, mapper, xmls); } else { log.info("Const were " + current.getClass()); } + if (c != null) { + Set connected = new HashSet(); + Iterator cs = ((ConstructorType)current).getConnected().iterator(); + while (cs.hasNext()) { + Long l = (Long)cs.next(); + connected.add(get(l.longValue(), mapper)); + } + c.connect(connected); + space.add(c); + } } } *************** *** 258,261 **** --- 254,292 ---- /** + * create model object of the xml + * @param current the xml transform + * @param xmls the collection of xml objects + * @return the new model object + */ + private static Transform internalizeTransformation(TransformType current, Collection xmls) { + if (current instanceof RotateType) { + RotateType rot = (RotateType) current; + Rotate r = new Rotate(rot.getX(), rot.getY(), rot.getZ()); + xmls.add(rot); + return r; + } else if (current instanceof IDTransformType) { + IDTransform id = new IDTransform(); + xmls.add(current); + return id; + } else if (current instanceof AxisRotateType) { + AxisRotateType arot = (AxisRotateType) current; + AxisRotate ar = new AxisRotate(arot.getAngle(), arot.getX(), arot.getY(), arot.getZ()); + xmls.add(arot); + return ar; + } else if (current instanceof ScaleType) { + ScaleType st = (ScaleType) current; + Scale s = new Scale(st.getX(), st.getY(), st.getZ()); + xmls.add(st); + return s; + } else if (current instanceof TranslateType) { + TranslateType tt = (TranslateType) current; + Translate t = new Translate(tt.getX(), tt.getY(), tt.getZ()); + xmls.add(tt); + return t; + } + return null; + } + + /** * Internalize the modellor * @param xml the xml version of the modellor *************** *** 454,463 **** } else if (object instanceof Vertex) { internalizeReferences((Vertex) object, (VertexType) xml, map); ! } else if (object instanceof Material) { ! internalizeMaterial((Material) object, (MaterialType) xml, map); } } ! /** * --- 485,507 ---- } else if (object instanceof Vertex) { internalizeReferences((Vertex) object, (VertexType) xml, map); ! } else if (object instanceof Constructor) { ! internalizeReferences((Constructor) object, (ConstructorType) xml, map); } } ! /** ! * Take care of all references in a xml version of a constructor ! * @param constructor The constructor ! * @param type the xml version of the constructor ! * @param map the original to xml map ! */ ! private static void internalizeReferences(Constructor constructor, ! ConstructorType type, Map map) { ! Iterator iter = type.getConnected().iterator(); ! while (iter.hasNext()) { ! constructor.connect((Geometric)get(((Long)iter.next()).longValue(), map)); ! } ! } ! /** * *************** *** 557,571 **** /** - * - * @param object The object - * @param xml The xml - * @param map The map - */ - private static void internalizeMaterial(Material object, MaterialType xml, Map map) { - } - - - - /** * This method externalizes the B-model to an XML structure. * @return XML --- 601,604 ---- *************** *** 637,683 **** } xml.setTy(m.getClass().getName()); ! List att = xml.getAttribute(); ! Map cont = m.getContent(); ! if (cont != null) { ! Iterator iter = cont.entrySet().iterator(); ! while (iter.hasNext()) { ! Map.Entry o = (Map.Entry)iter.next(); ! MapElementType elem = new MapElementTypeImpl(); ! if (o.getKey() instanceof String) { ! elem.setKey((String)o.getKey()); ! } else { ! log.error("Key should always be of type String but were " + ! o.getKey().getClass().getName()); ! } ! Object val = o.getValue(); ! if (val instanceof Integer) { ! IntegerType t = new IntegerTypeImpl(); ! t.setInteger(((Integer)val).intValue()); ! elem.setValue(t); ! } else if (val instanceof Double) { ! DoubleType t = new DoubleTypeImpl(); ! t.setDouble(((Double)val).doubleValue()); ! elem.setValue(t); ! } else if (val instanceof String) { ! StringType t = new StringTypeImpl(); ! t.setString((String)val); ! elem.setValue(t); ! } else if (val instanceof Entity) { ! RefType r = new RefTypeImpl(); ! r.setRef(id(map, val)); ! if (r.getRef() == 0) { ! log.error("Could not find " + val); ! } ! elem.setValue(r); ! } else if (val == null) { ! elem = null; ! } else { ! log.error("Type were not implemented " + val.getClass().getName()); ! } ! if (elem != null) { ! att.add(elem); ! } ! } ! } return xml; } --- 670,674 ---- } xml.setTy(m.getClass().getName()); ! map.put(m, xml); return xml; } *************** *** 699,703 **** xml.setDescription(space.getDescription().toString()); xml.setClassification(space.getClassification().toString()); - map.put(space, xml); if (!space.isInstance()) { --- 690,693 ---- *************** *** 753,756 **** --- 743,751 ---- } } + { + if (space.getModellor() != null) { + xml.setModellor(externalizeModellor(space.getModellor(), map)); + } + } return xml; } *************** *** 980,983 **** --- 975,980 ---- } else if (object instanceof Constructor) { externalizeReferences((Constructor) object, (ConstructorType) xml, map); + } else if (object instanceof Modellor) { + externalizeReferences((Modellor) object, (ModellorType) xml, map); } } *************** *** 997,1003 **** } xml.getBoundary().addAll(ids(map, object.getEnvelope())); - if (object.getModellor() != null) { - xml.setModellor(externalizeModellor(object.getModellor(), map)); - } } --- 994,997 ---- *************** *** 1044,1048 **** --- 1038,1099 ---- * @param map The map */ + private static void externalizeReferences(Modellor object, ModellorType xml, Map map) { + Map cont = object.getContent(); + List att = xml.getAttribute(); + if (cont != null) { + Iterator iter = cont.entrySet().iterator(); + while (iter.hasNext()) { + Map.Entry o = (Map.Entry)iter.next(); + MapElementType elem = new MapElementTypeImpl(); + if (o.getKey() instanceof String) { + elem.setKey((String)o.getKey()); + } else { + log.error("Key should always be of type String but were " + + o.getKey().getClass().getName()); + } + Object val = o.getValue(); + if (val instanceof Integer) { + IntegerType t = new IntegerTypeImpl(); + t.setInteger(((Integer)val).intValue()); + elem.setValue(t); + } else if (val instanceof Double) { + DoubleType t = new DoubleTypeImpl(); + t.setDouble(((Double)val).doubleValue()); + elem.setValue(t); + } else if (val instanceof String) { + StringType t = new StringTypeImpl(); + t.setString((String)val); + elem.setValue(t); + } else if (val instanceof Entity) { + RefType r = new RefTypeImpl(); + r.setRef(id(map, val)); + if (r.getRef() == 0) { + log.error("Could not find " + val); + } + elem.setValue(r); + } else if (val == null) { + elem = null; + } else { + log.error("Type were not implemented " + val.getClass().getName()); + } + if (elem != null) { + att.add(elem); + } + } + } + } + + /** + * Externalize references + * @param object The object + * @param xml The xml entity + * @param map The map + */ private static void externalizeReferences(Constructor object, ConstructorType xml, Map map) { + Iterator iter = object.collect().iterator(); + while (iter.hasNext()) { + long l = id(map, iter.next()); + xml.getConnected().add(new Long(l)); + } } |
From: rimestad <rim...@us...> - 2006-10-16 08:44:27
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6345/src/net/sourceforge/bprocessor/facade/modellor Modified Files: FacadeModellor.java Log Message: small fixes to the xmlification of modellors Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** FacadeModellor.java 14 Oct 2006 23:37:40 -0000 1.23 --- FacadeModellor.java 16 Oct 2006 08:44:25 -0000 1.24 *************** *** 764,767 **** --- 764,768 ---- type = ((Integer)m.get("type")).intValue(); name = (String)m.get("name"); + space = (Space)m.get("Space"); } *************** *** 783,786 **** --- 784,788 ---- m.put("type", new Integer(type)); m.put("name", name); + m.put("Space", space); return m; } |
From: rimestad <rim...@us...> - 2006-10-16 08:43:40
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5962/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java SpaceTreeView.java Log Message: Hotfix of tree Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** GenericTreeView.java 13 Oct 2006 16:27:09 -0000 1.58 --- GenericTreeView.java 16 Oct 2006 08:43:32 -0000 1.59 *************** *** 997,1001 **** public ProjectNode(Project p) { super(p); - add(new GeometryContainer("Geometry", p.world())); } --- 997,1000 ---- *************** *** 1006,1014 **** public void update(Object o) { if (o instanceof Project) { - Collection c = new LinkedList(); Project proj = (Project)o; ! c.add(proj.world()); ! c.addAll(proj.getSpaces()); ! super.update(c); } else { log.warn("Were a " + o + " not a Project"); --- 1005,1010 ---- public void update(Object o) { if (o instanceof Project) { Project proj = (Project)o; ! super.update(proj.getSpaces()); } else { log.warn("Were a " + o + " not a Project"); *************** *** 1026,1034 **** while (iter.hasNext()) { Space s = (Space)iter.next(); ! if (s.getLevel() == Space.PROJECT_LEVEL) { ! this.insert(new GeometryContainer("Geometry", s), 0); ! } else { ! this.add(new SpaceNode(s)); ! } ins[i] = this.getChildCount() - 1; i++; --- 1022,1026 ---- while (iter.hasNext()) { Space s = (Space)iter.next(); ! this.add(new SpaceNode(s)); ins[i] = this.getChildCount() - 1; i++; Index: SpaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SpaceTreeView.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** SpaceTreeView.java 13 Oct 2006 15:49:37 -0000 1.18 --- SpaceTreeView.java 16 Oct 2006 08:43:32 -0000 1.19 *************** *** 8,11 **** --- 8,12 ---- package net.sourceforge.bprocessor.gui.treeview; + import net.sourceforge.bprocessor.gui.treeview.GenericTreeView.GeometryContainer; import net.sourceforge.bprocessor.model.Project; *************** *** 27,30 **** --- 28,32 ---- root.removeAllChildren(); root.add(new ProjectNode(Project.getInstance())); + root.add(new GeometryContainer("Geometry", Project.getInstance().world())); root.add(new ConstraintContainer("Constraints", Project.getInstance().getConstraints())); root.add(new ParameterBlockNode("Globals", Project.getInstance().getGlobals())); *************** *** 37,45 **** */ public void update() { ! if (root.getChildCount() == 4) { ((GenericNode)root.getChildAt(0)).update(Project.getInstance()); ! ((GenericNode)root.getChildAt(1)).update(Project.getInstance().getConstraints()); ! ((GenericNode)root.getChildAt(2)).update(Project.getInstance().getGlobals()); ! ((GenericNode)root.getChildAt(3)).update(Project.getInstance().getConstructors()); } } --- 39,48 ---- */ public void update() { ! if (root.getChildCount() == 5) { ((GenericNode)root.getChildAt(0)).update(Project.getInstance()); ! ((GenericNode)root.getChildAt(1)).update(Project.getInstance().world()); ! ((GenericNode)root.getChildAt(2)).update(Project.getInstance().getConstraints()); ! ((GenericNode)root.getChildAt(3)).update(Project.getInstance().getGlobals()); ! ((GenericNode)root.getChildAt(4)).update(Project.getInstance().getConstructors()); } } |
From: Michael L. <he...@us...> - 2006-10-16 06:49:27
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24556/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Space.java Project.java Log Message: Fixed problems in Space.insert() Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** Space.java 14 Oct 2006 23:41:03 -0000 1.81 --- Space.java 16 Oct 2006 06:49:25 -0000 1.82 *************** *** 894,897 **** --- 894,918 ---- public Surface insert(Surface surface, boolean split) { List edges = surface.getEdges(); + + Collection vertices = this.getVertices(); + { + Iterator iter = vertices.iterator(); + while (iter.hasNext()) { + Vertex current = (Vertex) iter.next(); + Collection es = Edge.findEdge(edges, current); + Iterator esit = es.iterator(); + while (esit.hasNext()) { + Edge edge = (Edge) esit.next(); + System.out.println("split " + edge + " by " + current); + Collection rep = edge.split(current); + Iterator i = rep.iterator(); + Edge e1 = (Edge) i.next(); + Edge e2 = (Edge) i.next(); + System.out.println("replace " + edge + " with " + e1 + " and " + e2); + surface.replace(edge, e1, e2); + } + } + } + edges = surface.getEdges(); List actual = new LinkedList(); { *************** *** 918,921 **** --- 939,963 ---- add(surface); Geometry.holeAnalysis(surface); + } else { + Vertex n1 = shadow.normal(); + Vertex n2 = surface.normal(); + double dot = n1.dot(n2); + Space back; + Space front; + if (dot < 0) { + front = surface.getBackDomain(); + back = surface.getFrontDomain(); + } else { + front = surface.getFrontDomain(); + back = surface.getBackDomain(); + } + if (front != null) { + shadow.setFrontDomain(front); + } + if (back != null) { + shadow.setBackDomain(back); + } + surface.setFrontDomain(null); + surface.setBackDomain(null); } return shadow; *************** *** 1074,1087 **** */ public Set findEdge(Vertex vertex) { - Set result = new HashSet(); Collection edges = getEdges(); ! Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! if (current.coincides(vertex)) { ! result.add(current); ! } ! } ! return result; } --- 1116,1121 ---- */ public Set findEdge(Vertex vertex) { Collection edges = getEdges(); ! return Edge.findEdge(edges, vertex); } Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** Edge.java 9 Oct 2006 13:12:37 -0000 1.60 --- Edge.java 16 Oct 2006 06:49:25 -0000 1.61 *************** *** 84,87 **** --- 84,105 ---- return vertices; } + + /** + * Find collection of edges that coincides with the vertex + * @param edges Collection of edges + * @param vertex Vertex + * @return Collection of edges that coincides + */ + public static Set findEdge(Collection edges, Vertex vertex) { + Set result = new HashSet(); + Iterator iter = edges.iterator(); + while (iter.hasNext()) { + Edge current = (Edge) iter.next(); + if (current.coincides(vertex)) { + result.add(current); + } + } + return result; + } /** *************** *** 324,339 **** public Collection split(Vertex vertex) { List added = new ArrayList(); ! // FIXME Why not split a strippled? ! if (!strippled) { ! Vertex from = getFrom(); ! Vertex to = getTo(); ! Edge e1 = new Edge(from, vertex); getOwner().add(e1); - added.add(e1); - Edge e2 = new Edge(vertex, to); getOwner().add(e2); - added.add(e2); - - Set surfaces = getSurfaces(); Iterator iter = surfaces.iterator(); --- 342,354 ---- public Collection split(Vertex vertex) { List added = new ArrayList(); ! Vertex from = getFrom(); ! Vertex to = getTo(); ! Edge e1 = new Edge(from, vertex); ! added.add(e1); ! Edge e2 = new Edge(vertex, to); ! added.add(e2); ! if (getOwner() != null) { getOwner().add(e1); getOwner().add(e2); Set surfaces = getSurfaces(); Iterator iter = surfaces.iterator(); *************** *** 438,442 **** t = (q.getZ() - p0.getZ()) / r.getZ(); } ! if ((t >= 0 && t <= 1)) { r.scale(t); Vertex p = p0.add(r).minus(q); --- 453,457 ---- t = (q.getZ() - p0.getZ()) / r.getZ(); } ! if ((t > 0 && t < 1)) { r.scale(t); Vertex p = p0.add(r).minus(q); Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** Project.java 13 Oct 2006 15:51:41 -0000 1.82 --- Project.java 16 Oct 2006 06:49:25 -0000 1.83 *************** *** 206,209 **** --- 206,210 ---- this.setActiveCoordinateSystem(cs); cs.setActive(true); + System.out.println("clearing"); changed(this); } |
From: Michael L. <he...@us...> - 2006-10-16 06:49:26
|
Update of /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24543/src/net/sourceforge/bprocessor/model/evaluator Modified Files: Primitive.java Log Message: Fixed problems in Space.insert() Index: Primitive.java =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator/Primitive.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Primitive.java 11 Oct 2006 11:23:26 -0000 1.7 --- Primitive.java 16 Oct 2006 06:49:18 -0000 1.8 *************** *** 57,63 **** switch(opcode) { case ADD: { ! Double op1 = (Double) stack.pop(); ! Double op2 = (Double) stack.pop(); ! stack.push(new Double(op1.doubleValue() + op2.doubleValue())); break; } --- 57,69 ---- switch(opcode) { case ADD: { ! Object op1 = stack.pop(); ! Object op2 = stack.pop(); ! if (op2 instanceof Double) { ! Double d1 = (Double) op1; ! Double d2 = (Double) op2; ! stack.push(new Double(d1.doubleValue() + d2.doubleValue())); ! } else { ! stack.push(op2.toString() + op1.toString()); ! } break; } |
From: rimestad <rim...@us...> - 2006-10-14 23:42:47
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11288/src/net/sourceforge/bprocessor/model Modified Files: Persistence.java Log Message: Made bug fixes and now persistence of modellors partially work Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Persistence.java 13 Oct 2006 15:54:59 -0000 1.12 --- Persistence.java 14 Oct 2006 23:42:43 -0000 1.13 *************** *** 12,15 **** --- 12,16 ---- import net.sourceforge.bprocessor.model.xml.ConstructorType; import net.sourceforge.bprocessor.model.xml.CoordinateSystemType; + import net.sourceforge.bprocessor.model.xml.DoubleType; import net.sourceforge.bprocessor.model.xml.EdgeType; import net.sourceforge.bprocessor.model.xml.EntityType; *************** *** 21,24 **** --- 22,26 ---- import net.sourceforge.bprocessor.model.xml.ModellorType; import net.sourceforge.bprocessor.model.xml.PointType; + import net.sourceforge.bprocessor.model.xml.RefType; import net.sourceforge.bprocessor.model.xml.RotateType; import net.sourceforge.bprocessor.model.xml.ScaleType; *************** *** 33,36 **** --- 35,39 ---- import net.sourceforge.bprocessor.model.xml.impl.BmodelImpl; import net.sourceforge.bprocessor.model.xml.impl.CoordinateSystemTypeImpl; + import net.sourceforge.bprocessor.model.xml.impl.DoubleTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.EdgeImpl; import net.sourceforge.bprocessor.model.xml.impl.IDTransformTypeImpl; *************** *** 41,47 **** --- 44,52 ---- import net.sourceforge.bprocessor.model.xml.impl.ModellorTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.PointTypeImpl; + import net.sourceforge.bprocessor.model.xml.impl.RefTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.RotateTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.ScaleTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.SpaceImpl; + import net.sourceforge.bprocessor.model.xml.impl.StringTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.SurfaceImpl; import net.sourceforge.bprocessor.model.xml.impl.TranslateTypeImpl; *************** *** 161,165 **** space.setClassification(xml.getClassification()); mapper.put(new Long(xml.getId()), space); - space.setModellor(internalizeModellor(xml.getModellor())); xmls.add(xml); --- 166,169 ---- *************** *** 256,262 **** * Internalize the modellor * @param xml the xml version of the modellor * @return the model modellor */ ! private static Modellor internalizeModellor(ModellorType xml) { if (xml != null) { Class model; --- 260,267 ---- * Internalize the modellor * @param xml the xml version of the modellor + * @param map the map of objects * @return the model modellor */ ! private static Modellor internalizeModellor(ModellorType xml, Map map) { if (xml != null) { Class model; *************** *** 270,273 **** --- 275,279 ---- try { Modellor m = (Modellor)model.getConstructor(new Class[0]).newInstance(new Object[0]); + m.setId(new Long(xml.getProgid())); HashMap content = new HashMap(); Iterator iter = xml.getAttribute().iterator(); *************** *** 276,282 **** Object val = elem.getValue(); if (val instanceof IntegerType) { ! content.put(elem.getKey(), elem.getValue()); } else if (val instanceof StringType) { ! content.put(elem.getKey(), elem.getValue()); } else { log.warn("Non supported type"); --- 282,292 ---- Object val = elem.getValue(); if (val instanceof IntegerType) { ! content.put(elem.getKey(), new Integer(((IntegerType)val).getInteger())); } else if (val instanceof StringType) { ! content.put(elem.getKey(), ((StringType)val).getString()); ! } else if (val instanceof DoubleType) { ! content.put(elem.getKey(), new Double(((DoubleType)val).getDouble())); ! } else if (val instanceof RefType) { ! content.put(elem.getKey(), get(((RefType)val).getRef(), map)); } else { log.warn("Non supported type"); *************** *** 504,507 **** --- 514,521 ---- object.setProto((Space) get(xml.getProtoref(), map)); object.setEnvelope(asSet(xml.getBoundary(), map)); + { + Modellor m = internalizeModellor(xml.getModellor(), map); + object.setModellor(m); + } } *************** *** 626,634 **** Map cont = m.getContent(); if (cont != null) { ! Iterator iter = map.entrySet().iterator(); while (iter.hasNext()) { Map.Entry o = (Map.Entry)iter.next(); MapElementType elem = new MapElementTypeImpl(); ! elem.setKey((String)o.getKey()); Object val = o.getValue(); if (val instanceof Integer) { --- 640,653 ---- Map cont = m.getContent(); if (cont != null) { ! Iterator iter = cont.entrySet().iterator(); while (iter.hasNext()) { Map.Entry o = (Map.Entry)iter.next(); MapElementType elem = new MapElementTypeImpl(); ! if (o.getKey() instanceof String) { ! elem.setKey((String)o.getKey()); ! } else { ! log.error("Key should always be of type String but were " + ! o.getKey().getClass().getName()); ! } Object val = o.getValue(); if (val instanceof Integer) { *************** *** 636,641 **** t.setInteger(((Integer)val).intValue()); elem.setValue(t); } - att.add(elem); } } --- 655,681 ---- t.setInteger(((Integer)val).intValue()); elem.setValue(t); + } else if (val instanceof Double) { + DoubleType t = new DoubleTypeImpl(); + t.setDouble(((Double)val).doubleValue()); + elem.setValue(t); + } else if (val instanceof String) { + StringType t = new StringTypeImpl(); + t.setString((String)val); + elem.setValue(t); + } else if (val instanceof Entity) { + RefType r = new RefTypeImpl(); + r.setRef(id(map, val)); + if (r.getRef() == 0) { + log.error("Could not find " + val); + } + elem.setValue(r); + } else if (val == null) { + elem = null; + } else { + log.error("Type were not implemented " + val.getClass().getName()); + } + if (elem != null) { + att.add(elem); } } } *************** *** 659,668 **** xml.setDescription(space.getDescription().toString()); xml.setClassification(space.getClassification().toString()); - if (space.getModellor() != null) { - xml.setModellor(externalizeModellor(space.getModellor(), map)); - } map.put(space, xml); if (!space.isInstance()) { { Iterator iter = space.getElements().iterator(); --- 699,706 ---- xml.setDescription(space.getDescription().toString()); xml.setClassification(space.getClassification().toString()); map.put(space, xml); if (!space.isInstance()) { + //Only save geometry if space isn't a instance { Iterator iter = space.getElements().iterator(); *************** *** 704,708 **** while (iter.hasNext()) { Constructor current = (Constructor) iter.next(); ! externalizeConstructor(current, map, xml); } } --- 742,746 ---- while (iter.hasNext()) { Constructor current = (Constructor) iter.next(); ! xml.getConstructor().add(externalizeConstructor(current, map)); } } *************** *** 711,748 **** Iterator iter = space.getTransformations().stack().iterator(); while (iter.hasNext()) { ! List trans = xml.getTransforms(); ! Object current = iter.next(); ! if (current instanceof Rotate) { ! Rotate r = (Rotate) current; ! RotateTypeImpl rot = new RotateTypeImpl(); ! rot.setX(r.rx()); ! rot.setY(r.ry()); ! rot.setZ(r.rz()); ! trans.add(0, rot); ! } else if (current instanceof IDTransform) { ! trans.add(0, new IDTransformTypeImpl()); ! } else if (current instanceof AxisRotate) { ! AxisRotate ar = (AxisRotate) current; ! AxisRotateType arot = new AxisRotateTypeImpl(); ! arot.setAngle(ar.angle()); ! arot.setX(ar.rx()); ! arot.setY(ar.ry()); ! arot.setZ(ar.rz()); ! trans.add(0, arot); ! } else if (current instanceof Scale) { ! Scale s = (Scale) current; ! ScaleType st = new ScaleTypeImpl(); ! st.setX(s.sx()); ! st.setY(s.sy()); ! st.setZ(s.sz()); ! trans.add(0, st); ! } else if (current instanceof Translate) { ! Translate t = (Translate) current; ! TranslateType tt = new TranslateTypeImpl(); ! tt.setX(t.tx()); ! tt.setY(t.ty()); ! tt.setZ(t.tz()); ! trans.add(0, tt); ! } } } --- 749,754 ---- Iterator iter = space.getTransformations().stack().iterator(); while (iter.hasNext()) { ! Transform t = (Transform)iter.next(); ! xml.getTransforms().add(externalizeTransformation(t, map)); } } *************** *** 751,761 **** /** * Create an xml ConstructorImpl and place it in the map * @param constructor The constructor * @param map The map ! * @param to The space that the constructors are extracted from */ ! private static void externalizeConstructor(Constructor constructor, ! Map map, SpaceType to) { if (constructor instanceof Point) { PointType xml = new PointTypeImpl(); --- 757,815 ---- /** + * Externalize a transformation + * @param current the original object + * @param map the map of original to xml object + * @return the xml object + */ + private static Object externalizeTransformation(Transform current, Map map) { + if (current instanceof Rotate) { + Rotate r = (Rotate) current; + RotateTypeImpl rot = new RotateTypeImpl(); + rot.setX(r.rx()); + rot.setY(r.ry()); + rot.setZ(r.rz()); + map.put(r, rot); + return rot; + } else if (current instanceof IDTransform) { + IDTransformType id = new IDTransformTypeImpl(); + map.put(current, id); + return id; + } else if (current instanceof AxisRotate) { + AxisRotate ar = (AxisRotate) current; + AxisRotateType arot = new AxisRotateTypeImpl(); + arot.setAngle(ar.angle()); + arot.setX(ar.rx()); + arot.setY(ar.ry()); + arot.setZ(ar.rz()); + map.put(ar, arot); + return arot; + } else if (current instanceof Scale) { + Scale s = (Scale) current; + ScaleType st = new ScaleTypeImpl(); + st.setX(s.sx()); + st.setY(s.sy()); + st.setZ(s.sz()); + map.put(s, st); + return st; + } else if (current instanceof Translate) { + Translate t = (Translate) current; + TranslateType tt = new TranslateTypeImpl(); + tt.setX(t.tx()); + tt.setY(t.ty()); + tt.setZ(t.tz()); + map.put(t, tt); + return tt; + } + return null; + } + + /** * Create an xml ConstructorImpl and place it in the map * @param constructor The constructor * @param map The map ! * @return the xml version */ ! private static ConstructorType externalizeConstructor(Constructor constructor, ! Map map) { if (constructor instanceof Point) { PointType xml = new PointTypeImpl(); *************** *** 766,771 **** VertexType orig = externalizeVertex(constructor.getOrigin(), new HashMap()); xml.setVertex(orig); - to.getConstructor().add(xml); map.put(constructor, xml); } else if (constructor instanceof Line) { LineType xml = new LineTypeImpl(); --- 820,825 ---- VertexType orig = externalizeVertex(constructor.getOrigin(), new HashMap()); xml.setVertex(orig); map.put(constructor, xml); + return xml; } else if (constructor instanceof Line) { LineType xml = new LineTypeImpl(); *************** *** 780,785 **** VertexType orig = externalizeVertex(constructor.getOrigin(), new HashMap()); xml.setVertex(orig); - to.getConstructor().add(xml); map.put(constructor, xml); } else if (constructor instanceof CoordinateSystem) { CoordinateSystem cs = (CoordinateSystem)constructor; --- 834,839 ---- VertexType orig = externalizeVertex(constructor.getOrigin(), new HashMap()); xml.setVertex(orig); map.put(constructor, xml); + return xml; } else if (constructor instanceof CoordinateSystem) { CoordinateSystem cs = (CoordinateSystem)constructor; *************** *** 798,805 **** VertexType orig = externalizeVertex(constructor.getOrigin(), new HashMap()); xml.setVertex(orig); - to.getConstructor().add(xml); map.put(constructor, xml); } else { log.error(constructor + " were of unknown type"); } } --- 852,860 ---- VertexType orig = externalizeVertex(constructor.getOrigin(), new HashMap()); xml.setVertex(orig); map.put(constructor, xml); + return xml; } else { log.error(constructor + " were of unknown type"); + return null; } } *************** *** 942,945 **** --- 997,1003 ---- } xml.getBoundary().addAll(ids(map, object.getEnvelope())); + if (object.getModellor() != null) { + xml.setModellor(externalizeModellor(object.getModellor(), map)); + } } |
From: rimestad <rim...@us...> - 2006-10-14 23:42:47
|
Update of /cvsroot/bprocessor/model/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11288/src/etc Modified Files: bprocessor.xsd Log Message: Made bug fixes and now persistence of modellors partially work Index: bprocessor.xsd =================================================================== RCS file: /cvsroot/bprocessor/model/src/etc/bprocessor.xsd,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** bprocessor.xsd 13 Oct 2006 15:54:59 -0000 1.20 --- bprocessor.xsd 14 Oct 2006 23:42:43 -0000 1.21 *************** *** 25,32 **** <xsd:complexType name="EntityType"> <xsd:complexContent> ! <xsd:extension base="Types"> ! <xsd:attribute name="id" type="xsd:long" use="required"/> ! <xsd:attribute name="progid" type="xsd:long" use="optional"/> ! </xsd:extension> </xsd:complexContent> </xsd:complexType> --- 25,32 ---- <xsd:complexType name="EntityType"> <xsd:complexContent> ! <xsd:extension base="Types"> ! <xsd:attribute name="id" type="xsd:long" use="required"/> ! <xsd:attribute name="progid" type="xsd:long" use="optional"/> ! </xsd:extension> </xsd:complexContent> </xsd:complexType> *************** *** 170,173 **** --- 170,183 ---- </xsd:complexType> + <xsd:complexType name="RefType"> + <xsd:complexContent> + <xsd:extension base="Types"> + <xsd:sequence> + <xsd:element name="ref" type="xsd:long" maxOccurs="1" minOccurs="1"/> + </xsd:sequence> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + <xsd:complexType name="IntegerType"> <xsd:complexContent> *************** *** 180,183 **** --- 190,203 ---- </xsd:complexType> + <xsd:complexType name="DoubleType"> + <xsd:complexContent> + <xsd:extension base="Types"> + <xsd:sequence> + <xsd:element name="double" type="xsd:double" maxOccurs="1" minOccurs="1"/> + </xsd:sequence> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + <xsd:complexType name="StringType"> <xsd:complexContent> |
From: rimestad <rim...@us...> - 2006-10-14 23:41:06
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10529/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Space.java Log Message: removed some changed events and added others Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.114 retrieving revision 1.115 diff -C2 -d -r1.114 -r1.115 *** Surface.java 10 Oct 2006 09:23:57 -0000 1.114 --- Surface.java 14 Oct 2006 23:41:03 -0000 1.115 *************** *** 954,959 **** hole.setBackDomain(back); } ! changed(); ! hole.changed(); } --- 954,959 ---- hole.setBackDomain(back); } ! //changed(); ! //hole.changed(); } *************** *** 1157,1161 **** backDomain.addSurface(this); } ! changed(); } } --- 1157,1161 ---- backDomain.addSurface(this); } ! //changed(); } } *************** *** 1189,1193 **** frontDomain.addSurface(this); } ! changed(); } } --- 1189,1193 ---- frontDomain.addSurface(this); } ! //changed(); } } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** Space.java 13 Oct 2006 15:54:59 -0000 1.80 --- Space.java 14 Oct 2006 23:41:03 -0000 1.81 *************** *** 1134,1138 **** public void addSurface(Surface surface) { envelope.add(surface); ! changed(); } --- 1134,1138 ---- public void addSurface(Surface surface) { envelope.add(surface); ! //changed(); } *************** *** 1143,1147 **** public void removeSurface(Surface surface) { envelope.remove(surface); ! changed(); } --- 1143,1147 ---- public void removeSurface(Surface surface) { envelope.remove(surface); ! //changed(); } |