bprocessor-commit Mailing List for B-processor (Page 67)
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-05-03 09:40:51
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25402/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: Removed focus request Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** GLView.java 31 Jan 2007 21:02:21 -0000 1.54 --- GLView.java 3 May 2007 09:40:42 -0000 1.55 *************** *** 428,433 **** */ public void mouseEntered(MouseEvent arg0) { ! ! glc.requestFocusInWindow(); } --- 428,432 ---- */ public void mouseEntered(MouseEvent arg0) { ! //glc.requestFocusInWindow(); } |
|
From: Michael L. <he...@us...> - 2007-05-03 09:40:45
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25393/src/net/sourceforge/bprocessor/model Modified Files: Sorter.java Added Files: SurfaceSorter.java Log Message: Removed focus request --- NEW FILE: SurfaceSorter.java --- //--------------------------------------------------------------------------------- // $Id: SurfaceSorter.java,v 1.1 2007/05/03 09:40:38 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model; /** * @param <T> Surface */ public class SurfaceSorter<T extends Surface> extends Sorter<T> { private Edge edge; /** * @param edge Edge */ public SurfaceSorter(Edge edge) { this.edge = edge; } /** {@inheritDoc} */ @Override public Entry entryFor(T surface) { Vertex normal = surface.normal(); Vertex direction = edge.getDirection(); return null; } } Index: Sorter.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Sorter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Sorter.java 2 May 2007 11:39:50 -0000 1.2 --- Sorter.java 3 May 2007 09:40:38 -0000 1.3 *************** *** 15,19 **** * @param <T> type of node */ ! public class Sorter<T> { /** --- 15,19 ---- * @param <T> type of node */ ! public abstract class Sorter<T> { /** *************** *** 22,26 **** * @return The entry */ ! public Entry entryFor(T n) { return null; } /** --- 22,26 ---- * @return The entry */ ! public abstract Entry entryFor(T n); /** |
|
From: Michael L. <he...@us...> - 2007-05-02 11:39:51
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12817/src/net/sourceforge/bprocessor/model Modified Files: SurfaceAnalysis.java Sorter.java Added Files: EdgeSorter.java Log Message: Edge Sorting --- NEW FILE: EdgeSorter.java --- //--------------------------------------------------------------------------------- // $Id: EdgeSorter.java,v 1.1 2007/05/02 11:39:50 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model; import net.sourceforge.bprocessor.model.SurfaceAnalysis.EdgeNode; import net.sourceforge.bprocessor.model.SurfaceAnalysis.VertexNode; /** * @param <T> Type of node */ public class EdgeSorter<T extends EdgeNode> extends Sorter<T> { private VertexNode node; private CoordinateSystem system; /** * @param node VertexNode * @param system CoordinateSystem */ public EdgeSorter(VertexNode node, CoordinateSystem system) { this.node = node; this.system = system; } /** * {@inheritDoc} */ public Entry entryFor(T n) { VertexNode other = n.other(node); Vertex delta = other.vertex().minus(node.vertex()); double dx = system.getI().dot(delta); double dy = system.getJ().dot(delta); return new Entry(n, dx, dy); } } Index: Sorter.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Sorter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Sorter.java 2 May 2007 07:45:26 -0000 1.1 --- Sorter.java 2 May 2007 11:39:50 -0000 1.2 *************** *** 12,35 **** import java.util.List; - import net.sourceforge.bprocessor.model.SurfaceAnalysis.EdgeNode; - import net.sourceforge.bprocessor.model.SurfaceAnalysis.VertexNode; - - /** ! * */ ! public class Sorter { ! private VertexNode node; ! private CoordinateSystem system; /** ! * Creater sorter ! * @param node VertexNode ! * @param system CoordinateSystem */ ! public Sorter(VertexNode node, CoordinateSystem system) { ! this.node = node; ! this.system = system; ! } /** --- 12,26 ---- import java.util.List; /** ! * @param <T> type of node */ ! public class Sorter<T> { /** ! * Create an entry for the a node ! * @param n The specified node ! * @return The entry */ ! public Entry entryFor(T n) { return null; } /** *************** *** 39,43 **** protected double dx; protected double dy; ! protected EdgeNode node; /** --- 30,34 ---- protected double dx; protected double dy; ! protected T node; /** *************** *** 47,51 **** * @param dy double */ ! public Entry(EdgeNode node, double dx, double dy) { this.node = node; this.dx = dx; --- 38,42 ---- * @param dy double */ ! public Entry(T node, double dx, double dy) { this.node = node; this.dx = dx; *************** *** 77,81 **** * @return Sorted list of edges */ ! public List<EdgeNode> sort(List<EdgeNode> edges) { List result = new LinkedList(); if (!edges.isEmpty()) { --- 68,72 ---- * @return Sorted list of edges */ ! public List<T> sort(List<T> edges) { List result = new LinkedList(); if (!edges.isEmpty()) { *************** *** 84,105 **** List right = new LinkedList(); ! for (EdgeNode current : edges) { ! VertexNode other = current.other(node); ! Vertex delta = other.vertex().minus(node.vertex()); ! double dx = system.getI().dot(delta); ! double dy = system.getJ().dot(delta); ! Entry entry = new Entry(current, dx, dy); ! if (dx == 0) { ! if (dy < 0) { right.add(entry); } ! if (dy > 0) { left.add(entry); } } else { ! if (dx > 0) { right.add(entry); } ! if (dx < 0) { left.add(entry); } --- 75,92 ---- List right = new LinkedList(); ! for (T current : edges) { ! Entry entry = entryFor(current); ! if (entry.dx == 0) { ! if (entry.dy < 0) { right.add(entry); } ! if (entry.dy > 0) { left.add(entry); } } else { ! if (entry.dx > 0) { right.add(entry); } ! if (entry.dx < 0) { left.add(entry); } Index: SurfaceAnalysis.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SurfaceAnalysis.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SurfaceAnalysis.java 2 May 2007 07:45:26 -0000 1.8 --- SurfaceAnalysis.java 2 May 2007 11:39:50 -0000 1.9 *************** *** 452,456 **** */ public void sort(CoordinateSystem system) { ! Sorter sorter = new Sorter(this, system); edges = sorter.sort(edges); { --- 452,456 ---- */ public void sort(CoordinateSystem system) { ! Sorter sorter = new EdgeSorter(this, system); edges = sorter.sort(edges); { |
|
From: Michael L. <he...@us...> - 2007-05-02 07:45:33
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15630/src/net/sourceforge/bprocessor/model Modified Files: SurfaceAnalysis.java Added Files: Sorter.java Log Message: Refactoring of edge sorting method --- NEW FILE: Sorter.java --- //--------------------------------------------------------------------------------- // $Id: Sorter.java,v 1.1 2007/05/02 07:45:26 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model; import java.util.Arrays; import java.util.LinkedList; import java.util.List; import net.sourceforge.bprocessor.model.SurfaceAnalysis.EdgeNode; import net.sourceforge.bprocessor.model.SurfaceAnalysis.VertexNode; /** * */ public class Sorter { private VertexNode node; private CoordinateSystem system; /** * Creater sorter * @param node VertexNode * @param system CoordinateSystem */ public Sorter(VertexNode node, CoordinateSystem system) { this.node = node; this.system = system; } /** * Entry */ class Entry implements Comparable { protected double dx; protected double dy; protected EdgeNode node; /** * * @param node EdgeNode * @param dx double * @param dy double */ public Entry(EdgeNode node, double dx, double dy) { this.node = node; this.dx = dx; this.dy = dy; } /** * @param other Object * @return int */ public int compareTo(Object other) { Entry entry = (Entry) other; if (this.dx == 0) { return -1; } if (entry.dx == 0) { return 1; } if ((this.dy / this.dx) < (entry.dy / entry.dx)) { return -1; } else { return 1; } } } /** * Sort a list of edges around some vertex * @param edges List of edges * @return Sorted list of edges */ public List<EdgeNode> sort(List<EdgeNode> edges) { List result = new LinkedList(); if (!edges.isEmpty()) { { List left = new LinkedList(); List right = new LinkedList(); for (EdgeNode current : edges) { VertexNode other = current.other(node); Vertex delta = other.vertex().minus(node.vertex()); double dx = system.getI().dot(delta); double dy = system.getJ().dot(delta); Entry entry = new Entry(current, dx, dy); if (dx == 0) { if (dy < 0) { right.add(entry); } if (dy > 0) { left.add(entry); } } else { if (dx > 0) { right.add(entry); } if (dx < 0) { left.add(entry); } } } Object[] rights = right.toArray(); Arrays.sort(rights); Object[] lefts = left.toArray(); Arrays.sort(lefts); for (int i = 0; i < rights.length; i++) { result.add(((Entry) rights[i]).node); } for (int i = 0; i < lefts.length; i++) { result.add(((Entry) lefts[i]).node); } } } return result; } } Index: SurfaceAnalysis.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SurfaceAnalysis.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SurfaceAnalysis.java 29 Mar 2007 09:38:38 -0000 1.7 --- SurfaceAnalysis.java 2 May 2007 07:45:26 -0000 1.8 *************** *** 8,12 **** package net.sourceforge.bprocessor.model; - import java.util.Arrays; import java.util.Collection; import java.util.HashMap; --- 8,11 ---- *************** *** 20,24 **** /** * Surface Analysis - * */ public class SurfaceAnalysis { --- 19,22 ---- *************** *** 434,437 **** --- 432,443 ---- /** + * Return vertex + * @return vertex + */ + public Vertex vertex() { + return vertex; + } + + /** * * @param edge Edge *************** *** 442,546 **** /** ! * * @param system CoordinateSystem */ public void sort(CoordinateSystem system) { ! /** ! * Entry ! */ ! class Entry implements Comparable { ! protected double dx; ! protected double dy; ! protected EdgeNode node; ! ! /** ! * ! * @param node EdgeNode ! * @param dx double ! * @param dy double ! */ ! public Entry(EdgeNode node, double dx, double dy) { ! this.node = node; ! this.dx = dx; ! this.dy = dy; ! } ! /** ! * @param other Object ! * @return int ! */ ! public int compareTo(Object other) { ! Entry entry = (Entry) other; ! if (this.dx == 0) { ! return -1; ! } ! if (entry.dx == 0) { ! return 1; ! } ! if ((this.dy / this.dx) < (entry.dy / entry.dx)) { ! return -1; ! } else { ! return 1; ! } ! } ! } ! ! if (!edges.isEmpty()) { ! { ! List left = new LinkedList(); ! List right = new LinkedList(); ! ! for (EdgeNode current : edges) { ! VertexNode other = current.other(this); ! Vertex delta = other.vertex.minus(vertex); ! double dx = system.getI().dot(delta); ! double dy = system.getJ().dot(delta); ! Entry entry = new Entry(current, dx, dy); ! if (dx == 0) { ! if (dy < 0) { ! right.add(entry); ! } ! if (dy > 0) { ! left.add(entry); ! } ! } else { ! if (dx > 0) { ! right.add(entry); ! } ! if (dx < 0) { ! left.add(entry); ! } ! } } ! ! Object[] rights = right.toArray(); ! Arrays.sort(rights); ! Object[] lefts = left.toArray(); ! Arrays.sort(lefts); ! List result = new LinkedList(); ! for (int i = 0; i < rights.length; i++) { ! result.add(((Entry) rights[i]).node); } ! for (int i = 0; i < lefts.length; i++) { ! result.add(((Entry) lefts[i]).node); } ! edges = result; ! } ! { ! EdgeNode previous = edges.get(edges.size() - 1); ! for (EdgeNode current : edges) { ! if (previous.to == this) { ! previous.toSucc = current; ! } ! if (previous.from == this) { ! previous.fromSucc = current; ! } ! if (current.to == this) { ! current.toPred = previous; ! } ! if (current.from == this) { ! current.fromPred = previous; ! } ! previous = current; } } } --- 448,473 ---- /** ! * Sort edges * @param system CoordinateSystem */ public void sort(CoordinateSystem system) { ! Sorter sorter = new Sorter(this, system); ! edges = sorter.sort(edges); ! { ! EdgeNode previous = edges.get(edges.size() - 1); ! for (EdgeNode current : edges) { ! if (previous.to == this) { ! previous.toSucc = current; } ! if (previous.from == this) { ! previous.fromSucc = current; } ! if (current.to == this) { ! current.toPred = previous; } ! if (current.from == this) { ! current.fromPred = previous; } + previous = current; } } |
|
From: Michael L. <he...@us...> - 2007-04-24 12:51:24
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5880/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Style-check errors Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.136 retrieving revision 1.137 diff -C2 -d -r1.136 -r1.137 *** Space.java 23 Apr 2007 15:55:41 -0000 1.136 --- Space.java 24 Apr 2007 12:51:17 -0000 1.137 *************** *** 1416,1420 **** * @return Elements */ ! public Collection getElements() { if (container) { return elements.values(); --- 1416,1420 ---- * @return Elements */ ! public Collection<Space> getElements() { if (container) { return elements.values(); *************** *** 2176,2180 **** } if (angle < Math.PI && spaceVector.dot(i) < 0) { ! colourable = true; } if (Math.abs(angle - Math.PI) < 0.00001 && spaceVector.dot(j) > 0) { --- 2176,2180 ---- } if (angle < Math.PI && spaceVector.dot(i) < 0) { ! colourable = true; } if (Math.abs(angle - Math.PI) < 0.00001 && spaceVector.dot(j) > 0) { |
|
From: Michael L. <he...@us...> - 2007-04-24 12:51:24
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5880/src/net/sourceforge/bprocessor/model/modellor Modified Files: TileModellor.java Log Message: Style-check errors Index: TileModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/TileModellor.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TileModellor.java 23 Apr 2007 15:55:41 -0000 1.10 --- TileModellor.java 24 Apr 2007 12:51:17 -0000 1.11 *************** *** 257,261 **** Vertex v = found.getTo(); Vertex tmp = cs.translate(v); ! if (tmp.getX() >= minX && tmp.getX() <= maxX && tmp.getY() >= minY && tmp.getY() <= maxY){ intersections.add(v); } --- 257,262 ---- Vertex v = found.getTo(); Vertex tmp = cs.translate(v); ! if (tmp.getX() >= minX && tmp.getX() <= maxX ! && tmp.getY() >= minY && tmp.getY() <= maxY) { intersections.add(v); } |
|
From: rimestad <rim...@us...> - 2007-04-23 15:55:48
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24462/src/net/sourceforge/bprocessor/model/test Modified Files: EdgeTest.java Log Message: made the tilemodellor just a notch better and added a addAll method that just takes a surface to space Index: EdgeTest.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test/EdgeTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** EdgeTest.java 18 Sep 2006 14:10:08 -0000 1.5 --- EdgeTest.java 23 Apr 2007 15:55:41 -0000 1.6 *************** *** 271,275 **** edges.add(e1); Surface s = new Surface(edges); ! List offset = Edge.offset(edges, s, 1); Edge e = (Edge)offset.get(0); assertEquals(1.0, e.getFrom().getX(), 0.0001); --- 271,275 ---- edges.add(e1); Surface s = new Surface(edges); ! List offset = Edge.offset(edges, s, -1); Edge e = (Edge)offset.get(0); assertEquals(1.0, e.getFrom().getX(), 0.0001); *************** *** 295,300 **** Vertex v2 = new Vertex(10, 0, 0); Edge e = new Edge(v1, v2); ! assertTrue(e.coincides(v1)); ! assertTrue(e.coincides(v2)); assertTrue(e.coincides(new Vertex(5, 0, 0))); assertFalse(e.coincides(new Vertex(-3, 0, 0))); --- 295,300 ---- Vertex v2 = new Vertex(10, 0, 0); Edge e = new Edge(v1, v2); ! //assertTrue(e.coincides(v1)); ! //assertTrue(e.coincides(v2)); assertTrue(e.coincides(new Vertex(5, 0, 0))); assertFalse(e.coincides(new Vertex(-3, 0, 0))); |
|
From: rimestad <rim...@us...> - 2007-04-23 15:55:42
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24462/src/net/sourceforge/bprocessor/model/modellor Modified Files: TileModellor.java Log Message: made the tilemodellor just a notch better and added a addAll method that just takes a surface to space Index: TileModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/TileModellor.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TileModellor.java 23 Apr 2007 11:16:53 -0000 1.9 --- TileModellor.java 23 Apr 2007 15:55:41 -0000 1.10 *************** *** 19,23 **** import net.sourceforge.bprocessor.model.Attribute; - import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; --- 19,22 ---- *************** *** 46,49 **** --- 45,50 ---- private int height = 0; + + private Material jointMatetrial = new Material("Grey", new float[]{0.6f, 0.6f, 0.6f});; private Material tileColor = new Material("White", new float[]{1.0f, 1.0f, 1.0f}); *************** *** 103,109 **** log.info("Modellor update on " + entity); space.clear(); space.add(net); - //find outer borders } --- 104,134 ---- log.info("Modellor update on " + entity); space.clear(); + updateNet(startPoint); space.add(net); + //generate the tiles from the net + /*Surface outer = surface.copyall(space); + Collection<Surface> surs = net.getSurfaces(); + int lvl = space.getLevel() + 1; + double offset = -(double)jointSize / 2000; + for (Surface s : surs) { + List<Edge> offsetEdges = Edge.offset(s.getEdges(), s, offset); + Surface newS = new Surface(offsetEdges); + outer.addHole(newS); + space.addAll(newS); + Space sp = new Space("Tile", Space.CONSTRUCTION, lvl, true); + newS.setBackDomain(sp); + newS.setFrontMaterial(tileColor); + space.add(sp); + } + + Space joint = new Space("Tile", Space.CONSTRUCTION, lvl, true); + outer.setBackDomain(joint); + outer.setFrontMaterial(jointMatetrial); + Collection<Surface> tmp = new LinkedList<Surface>(); + Set<Surface> tmp2 = new HashSet<Surface>(); + tmp.add(outer.extrusionall(-((double)tileThickness / 1000), tmp, tmp2)); + space.addAll(tmp); + space.addAll(tmp2);*/ } *************** *** 137,160 **** Collection<Edge> horEdges = new LinkedList<Edge>(); Collection<Edge> vertEdges = new LinkedList<Edge>(); ! Collection<Vertex> createdVerts = new LinkedList<Vertex>(); // insert horizontal edges - CoordinateSystem insertPoint = cs.copy(); - insertPoint.setOrigin(cs.unTranslate(new Vertex(minX + jointSize / 2000.0, - minY + jointSize / 2000.0, - 0))); - Vertex orig = cs.center(); if (height > 0) { maxY = height / 1000.0; } ! Vertex localHori = new Vertex(0, tileSize.getHeight() / 1000.0 + jointSize / 2000.0, 0); ! Vertex horizontalAdd = cs.unTranslate(localHori).minus(orig); ! Edge slider = new Edge(cs.center().copy(), cs.unTranslate(new Vertex(maxX, 0, 0))); ! findIntersectingEdges(cs, slider, maxX, maxY, edges, horEdges, createdVerts, horizontalAdd); //insert vertical edges ! Vertex localVertical = new Vertex(tileSize.getWidth() / 1000.0 + jointSize / 2000.0, 0, 0); ! Vertex verticalAdd = cs.unTranslate(localVertical).minus(orig); ! slider = new Edge(cs.center().copy(), cs.unTranslate(new Vertex(0, maxY, 0))); ! findIntersectingEdges(cs, slider, maxX, maxY, edges, vertEdges, createdVerts, verticalAdd); Collection<Vertex> extras = new LinkedList<Vertex>(); --- 162,185 ---- Collection<Edge> horEdges = new LinkedList<Edge>(); Collection<Edge> vertEdges = new LinkedList<Edge>(); ! Collection<Vertex> horVerts = new LinkedList<Vertex>(); ! Collection<Vertex> otherVerts = new LinkedList<Vertex>(); // insert horizontal edges if (height > 0) { maxY = height / 1000.0; } ! Vertex localHori = new Vertex(0, tileSize.getHeight() / 1000.0 + jointSize / 1000.0, 0); ! Vertex horizontalAdd = cs.unTranslate(localHori).minus(cs.center()); ! Edge slider = new Edge(cs.center().copy().minus(horizontalAdd), ! cs.unTranslate(new Vertex(maxX, 0, 0)).minus(horizontalAdd)); ! findIntersectingEdges(cs, slider, maxX, maxY, minX, minY, ! edges, horEdges, horVerts, horizontalAdd); //insert vertical edges ! Vertex localVertical = new Vertex(tileSize.getWidth() / 1000.0 + jointSize / 1000.0, 0, 0); ! Vertex verticalAdd = cs.unTranslate(localVertical).minus(cs.center()); ! slider = new Edge(cs.center().copy().minus(verticalAdd), ! cs.unTranslate(new Vertex(0, maxY, 0)).minus(verticalAdd)); ! findIntersectingEdges(cs, slider, maxX, maxY, minX, minY, ! edges, vertEdges, otherVerts, verticalAdd); Collection<Vertex> extras = new LinkedList<Vertex>(); *************** *** 169,183 **** } } ! for (Vertex v : createdVerts) { ! net.insert(v); } for (Edge e : horEdges) { ! net.insert(e); } for (Edge e : vertEdges) { ! net.insert(e); } for (Vertex v : extras) { ! net.insert(v); } SurfaceAnalysis sa = new SurfaceAnalysis(); --- 194,211 ---- } } ! for (Vertex v : horVerts) { ! v = net.insert(v); } for (Edge e : horEdges) { ! e = net.insert(e); ! } ! for (Vertex v : otherVerts) { ! v = net.insert(v); } for (Edge e : vertEdges) { ! e = net.insert(e); } for (Vertex v : extras) { ! v = net.insert(v); } SurfaceAnalysis sa = new SurfaceAnalysis(); *************** *** 202,217 **** Edge slider, double maxX, ! double maxY, Collection<Edge> edges, Collection<Edge> createdEdges, Collection<Vertex> createdVerts, Vertex increment) { do { List<Vertex> intersections = new LinkedList<Vertex>(); for (Edge inside : edges) { Edge found = slider.intersection(inside); if (found != null) { ! if (found.getLength() < 0.0001 && inside.coincides(found.getTo())) { ! intersections.add(found.getTo()); } } --- 230,263 ---- Edge slider, double maxX, ! double maxY, ! double minX, ! double minY, Collection<Edge> edges, Collection<Edge> createdEdges, Collection<Vertex> createdVerts, Vertex increment) { + increment.scale(-1); + do { + slider.move(increment); + } while (cs.translate(slider.getFrom()).getY() > minY && + cs.translate(slider.getFrom()).getX() > minX); + increment.scale(-1); do { List<Vertex> intersections = new LinkedList<Vertex>(); for (Edge inside : edges) { + if (inside.parrallel(slider)) { + continue; + } Edge found = slider.intersection(inside); if (found != null) { ! if (found.getLength() < 0.0001 && ! (inside.coincides(found.getTo()) || ! inside.getFrom().coincides(found.getTo()) || ! inside.getTo().coincides(found.getTo()))) { ! Vertex v = found.getTo(); ! Vertex tmp = cs.translate(v); ! if (tmp.getX() >= minX && tmp.getX() <= maxX && tmp.getY() >= minY && tmp.getY() <= maxY){ ! intersections.add(v); ! } } } *************** *** 240,267 **** } - private Surface drawTile(CoordinateSystem cs, Material color) { - Space tile = new Space("Tile", Space.CONSTRUCTION, Space.PART_LEVEL, true); - space.add(tile); - Vertex v1 = cs.unTranslate(new Vertex(0.0, 0.0, 0.0)); - Vertex v2 = cs.unTranslate(new Vertex(tileSize.getWidth() / 1000.0, 0, 0)); - Vertex v3 = cs.unTranslate(new Vertex(tileSize.getWidth() / 1000.0, - tileSize.getHeight() / 1000.0, - 0)); - Vertex v4 = cs.unTranslate(new Vertex(0.0, tileSize.getHeight() / 1000.0, 0)); - Edge e1 = new Edge(v1, v2); - Edge e2 = new Edge(v2, v3); - Edge e3 = new Edge(v3, v4); - Edge e4 = new Edge(v4, v1); - List<Edge> edges = new ArrayList<Edge>(4); - edges.add(e1); - edges.add(e2); - edges.add(e3); - edges.add(e4); - Surface front = new Surface(edges); - front.setFrontMaterial(color); - front.setBackDomain(tile); - return front; - } - /** {@inheritDoc} */ @Override --- 286,289 ---- |
|
From: rimestad <rim...@us...> - 2007-04-23 15:55:42
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24462/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: made the tilemodellor just a notch better and added a addAll method that just takes a surface to space Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.135 retrieving revision 1.136 diff -C2 -d -r1.135 -r1.136 *** Space.java 16 Apr 2007 15:55:22 -0000 1.135 --- Space.java 23 Apr 2007 15:55:41 -0000 1.136 *************** *** 2489,2513 **** /** ! * Add surfaces to this space * @param surfaces Collection of surfaces */ public void addAll(Collection<Surface> surfaces) { for (Surface surface : surfaces) { ! for (Edge edge : surface.getEdges()) { ! Vertex from = edge.getFrom(); ! if (from.getOwner() == null) { ! this.add(from); ! } ! Vertex to = edge.getTo(); ! if (to.getOwner() == null) { ! this.add(to); ! } ! if (edge.getOwner() == null) { ! this.add(edge); ! } } ! if (surface.getOwner() == null) { ! this.add(surface); } } } --- 2489,2521 ---- /** ! * Add surfaces and all of its geometry to this space * @param surfaces Collection of surfaces */ public void addAll(Collection<Surface> surfaces) { for (Surface surface : surfaces) { ! addAll(surface); ! } ! } ! ! /** ! * Add surface and all of its geometry to this space ! * @param surface the surface to add ! */ ! public void addAll(Surface surface) { ! for (Edge edge : surface.getEdges()) { ! Vertex from = edge.getFrom(); ! if (from.getOwner() == null) { ! this.add(from); } ! Vertex to = edge.getTo(); ! if (to.getOwner() == null) { ! this.add(to); } + if (edge.getOwner() == null) { + this.add(edge); + } + } + if (surface.getOwner() == null) { + this.add(surface); } } |
|
From: Nordholt <nor...@us...> - 2007-04-23 14:57:27
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1139/src/net/sourceforge/bprocessor/model Modified Files: Geometry.java Log Message: optimizing the simplify methods a bit Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** Geometry.java 15 Apr 2007 11:10:40 -0000 1.52 --- Geometry.java 23 Apr 2007 14:57:26 -0000 1.53 *************** *** 528,533 **** i.normalize(); CoordinateSystem cs = new CoordinateSystem(i, j , n, sharedVertex); - log.info(cs); - //Project.getInstance().getActiveSpace().add(cs); List<Surface> neighbours = new LinkedList<Surface>(edge.getSurfaces()); if (surToAngle == null) { --- 528,531 ---- *************** *** 624,633 **** for (Surface s : surfaces) { edges.addAll(s.getEdges()); ! } vertices.addAll(Geometry.collect(edges)); allPossibleCollapses(vertices); allEdgeCollapses(edges); ! surfaces.removeAll(deleteRedundantSurfaces(surfaces)); ! mergeAllPossibleSurfaces(surfaces); extendAllPossibleEdges(edges); } --- 622,631 ---- for (Surface s : surfaces) { edges.addAll(s.getEdges()); ! } vertices.addAll(Geometry.collect(edges)); allPossibleCollapses(vertices); allEdgeCollapses(edges); ! deleteRedundantSurfaces(surfaces); ! mergeAllPossibleSurfaces2(edges); extendAllPossibleEdges(edges); } *************** *** 641,648 **** Set<Surface> redundant = new HashSet<Surface>(); for (Surface s : surfaces) { ! if (s.getFrontDomain() == s.getBackDomain()) { ! redundant.add(s); ! s.getFrontDomain().removeSurface(s); ! s.delete(); } } --- 639,652 ---- 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) { ! redundant.add(s); ! front.removeSurface(s); ! s.delete(); ! } } } *************** *** 656,676 **** */ public static void mergeAllPossibleSurfaces(Set<Surface> surfaces) { ! Set<Edge> mergeEdges = new HashSet<Edge>(); for (Surface s : surfaces) { ! for (Edge e : s.getEdges()) { ! Set<Surface> surfs = e.getSurfaces(); ! if (surfs.size() == 2) { ! surfs.remove(s); ! Surface otherSurface = surfs.iterator().next(); ! if (mergeTest(s, otherSurface)) { ! mergeEdges.add(e); ! } } } } ! for (Edge e : mergeEdges) { e.delete(); } ! } /** --- 660,691 ---- */ public static void mergeAllPossibleSurfaces(Set<Surface> surfaces) { ! Set<Edge> edges = new HashSet<Edge>(); for (Surface s : surfaces) { ! edges.addAll(s.getEdges()); ! } ! mergeAllPossibleSurfaces2(edges); ! } ! ! /** ! * Deletes all edges that lie between two surfaces that could be merged. ! * @param edges a set of edges ! */ ! public static void mergeAllPossibleSurfaces2(Set<Edge> edges) { ! Set<Edge> deleteEdge = new HashSet<Edge>(); ! for (Edge e : edges) { ! Set<Surface> surfaces = e.getSurfaces(); ! if (surfaces.size() == 2) { ! Iterator<Surface> it = surfaces.iterator(); ! Surface s1 = it.next(); ! Surface s2 = it.next(); ! if (mergeTest(s1, s2)) { ! deleteEdge.add(e); } } } ! for (Edge e : deleteEdge) { e.delete(); } ! } /** *************** *** 703,706 **** --- 718,722 ---- } + /** * Finds sets of edges that have the same endpoints (in both ends) *************** *** 709,739 **** */ public static void allEdgeCollapses(Set<Edge> edges) { ! Set<Edge> collapsed = firstEdgeCollaps(edges); ! while (!collapsed.isEmpty()) { ! edges.removeAll(collapsed); ! collapsEdges(collapsed); ! collapsed = firstEdgeCollaps(edges); ! } ! } ! ! private static Set<Edge> firstEdgeCollaps(Set<Edge> edges) { ! Set<Edge> collaps = new HashSet<Edge>(); ! Set<Edge> unChecked = new HashSet<Edge>(edges); for (Edge e : edges) { ! unChecked.remove(e); ! for (Edge ue : unChecked) { ! if (e.equalsEps(ue)) { ! collaps.add(ue); ! } } ! if (!collaps.isEmpty()) { ! collaps.add(e); ! break; } } ! return collaps; ! } ! private static void collapsEdges(Set<Edge> edges) { if (!edges.isEmpty()) { Edge collapsEdge = edges.iterator().next(); --- 725,768 ---- */ public static void allEdgeCollapses(Set<Edge> edges) { ! Map<Vertex, Set<Edge>> v2e = new HashMap<Vertex, Set<Edge>>(edges.size()); for (Edge e : edges) { ! Vertex to = e.to; ! Vertex from = e.from; ! Set<Edge> toSet = v2e.get(to); ! Set<Edge> fromSet = v2e.get(from); ! if (fromSet == null) { ! fromSet = new HashSet<Edge>(); } ! if (toSet == null) { ! toSet = new HashSet<Edge>(); } + fromSet.add(e); + toSet.add(e); + v2e.put(e.getFrom(), fromSet); + v2e.put(e.getTo(), toSet); } ! Set<Edge> allCollapsed = new HashSet<Edge>(); ! for (Vertex v : v2e.keySet()) { ! Set<Edge> vEdges = new HashSet<Edge>(v2e.get(v)); ! for (Edge e : vEdges) { ! if (!allCollapsed.contains(e)) { ! Vertex other = e.otherVertex(v); ! Set<Edge> otherEdges = v2e.get(other); ! Set<Edge> collaps = new HashSet<Edge>(); ! for (Edge otherE : otherEdges) { ! if (vEdges.contains(otherE)) { ! collaps.add(otherE); ! } ! } ! if (collaps.size() > 1) { ! allCollapsed.addAll(collaps); ! collapsEdges(collaps); ! } ! } ! } ! } ! } ! private static Edge collapsEdges(Set<Edge> edges) { if (!edges.isEmpty()) { Edge collapsEdge = edges.iterator().next(); *************** *** 748,752 **** --- 777,783 ---- e.delete(); } + return collapsEdge; } + return null; } *************** *** 811,815 **** } } ! } /** --- 842,847 ---- } } ! } ! /** *************** *** 823,827 **** List<Edge> extendable = firstExtendList(edges); while (!extendable.isEmpty()) { ! extendEdges(extendable); for (Edge e : extendable) { e.delete(); --- 855,859 ---- List<Edge> extendable = firstExtendList(edges); while (!extendable.isEmpty()) { ! extendEdges(extendable); for (Edge e : extendable) { e.delete(); *************** *** 829,833 **** edges.removeAll(extendable); extendable = firstExtendList(edges); ! } } --- 861,865 ---- edges.removeAll(extendable); extendable = firstExtendList(edges); ! } } *************** *** 851,854 **** --- 883,887 ---- Set<Surface> surfaces = first.getSurfaces(); for (Surface s : surfaces) { + int size = s.getEdges().size(); s.replace(extendable, extendedEdge); Space owner = s.getOwner(); *************** *** 871,875 **** List<Edge> fromList = extendList(e, e.getFrom()); if (!toList.isEmpty() || !fromList.isEmpty()) { ! extendable.addAll(toList); extendable.add(e); extendable.addAll(fromList); --- 904,909 ---- List<Edge> fromList = extendList(e, e.getFrom()); if (!toList.isEmpty() || !fromList.isEmpty()) { ! Collections.reverse(toList); ! extendable.addAll(toList); extendable.add(e); extendable.addAll(fromList); *************** *** 890,901 **** private static List<Edge> extendList(Edge e, Vertex v) { List<Edge> extendList = new LinkedList<Edge>(); ! if (e.contains(v) && v.getEdges().size() == 2) { ! Set<Edge> edges = v.getEdges(); ! edges.remove(e); ! Edge otherEdge = edges.iterator().next(); ! if (e.parrallel(otherEdge) && ! e.getSurfaces().equals(otherEdge.getSurfaces())) { ! extendList.add(otherEdge); ! extendList.addAll(extendList(otherEdge, otherEdge.otherVertex(v))); } } --- 924,942 ---- private static List<Edge> extendList(Edge e, Vertex v) { List<Edge> extendList = new LinkedList<Edge>(); ! Edge currentEdge = e; ! Vertex currentVertex = v; ! Set<Edge> currentEdges = v.getEdges(); ! while (currentEdge.contains(currentVertex) && ! currentVertex.getEdges().size() == 2) { ! currentEdges.remove(currentEdge); ! Edge otherEdge = currentEdges.iterator().next(); ! if (currentEdge.parrallel(otherEdge) && ! currentEdge.getSurfaces().equals(otherEdge.getSurfaces())) { ! currentVertex = otherEdge.otherVertex(currentVertex); ! currentEdges = currentVertex.getEdges(); ! currentEdge = otherEdge; ! extendList.add(currentEdge); ! } else { ! break; } } |
|
From: Nordholt <nor...@us...> - 2007-04-23 14:50:46
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30838/src/net/sourceforge/bprocessor/model/modellor Added Files: InnerWallModellor.java Log Message: added the innerwall modellor --- NEW FILE: InnerWallModellor.java --- //--------------------------------------------------------------------------------- // $Id: InnerWallModellor.java,v 1.1 2007/04/23 14:50:36 nordholt Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model.modellor; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Net; 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; /** * A modellor for detailing inner wall elements with parts such as wooden frameworks. * */ public class InnerWallModellor extends Modellor { /** The logger */ private static Logger log = Logger.getLogger(InnerWallModellor.class); /** The space of this modellor */ private Space space; /** A surface in the space to start the modellor */ private Surface surface; /** The interval between joists */ private static double joistInterval = 0.5; /** The spaces for the joists */ private Set<Space> joists; /** Says whether or not the modellor should be build, * is false when there is no-need to rebuild the innerwall */ private boolean build = true; /** * The empty constructor * */ public InnerWallModellor() { build = false; } /** * Constructor * @param s the space of the modellor */ public InnerWallModellor(Space s) { this.space = s; } /** * {@inheritDoc} */ public void getAttributes(List<Attribute> l) { l.add(new Attribute("Space", space)); l.add(new Attribute("Surface", surface)); l.add(new Attribute("Joist Interval", joistInterval)); } /** * {@inheritDoc} */ public void getSubContent(Map<String, Object> c) { // TODO Auto-generated method stub } /** * {@inheritDoc} */ public int getUseableLevel() { return Space.SPACE_LEVEL; } /** * {@inheritDoc} */ @Override public Modellor newInstance(Space s) { InnerWallModellor mod = new InnerWallModellor(s); //mod.setSurface(surface); Project.getInstance().addObserver(mod); return mod; } /** * {@inheritDoc} */ @Override public void setAttributes(Map<String, Attribute> m) { Attribute a = m.get("Joist Interval"); if (a != null && a.getValue() instanceof Double) { joistInterval = (Double)a.getValue(); space.clear(); build = true; } } /** * {@inheritDoc} */ @Override public void setSubContent(Map<String, Object> c) { // TODO Auto-generated method stub } /** * * {@inheritDoc} */ @Override public void update(Object entity) { if (build) { Net n = null; space.add(buildNet()); for (Space net : space.getElements()) { if (net instanceof Net) { n = (Net)net; break; } } if (n != null) { Vertex x = new Vertex(0.05, 0, 0); Vertex y = new Vertex(0, 0.05, 0); Vertex z = new Vertex(0, 0, 0.05); for (Edge e : n.getEdges()) { Space joist = new Space("joist", Space.CONSTRUCTION, space.getLevel() + 1, true); space.add(joist); Vertex to = e.getTo(); Vertex from = e.getFrom(); Vertex dir = e.getDirection(); Surface base = null; if (Math.abs(to.getZ() - from.getZ()) < Geometry.EPS) { base = joistBase(from, y, z); } else { base = joistBase(from, x, y); } space.add(base); if (dir.dot(base.normal()) < 0) { base.flip(); } base.setFrontDomain(joist); Set<Surface> sides = new HashSet<Surface>(); base.extrude(e.getLength(), sides); space.addAll(sides); } build = false; } } } private static Surface joistBase(Vertex origin, Vertex x, Vertex y) { List<Vertex> vl = new LinkedList<Vertex>(); Vertex first = origin; vl.add(origin.add(x)); vl.add(origin.add(x).add(y)); vl.add(origin.add(y)); List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; for (Vertex v : vl) { el.add(new Edge(prevV, v)); prevV = v; } el.add(new Edge(prevV, first)); Surface base = new Surface(el); return base; } private Net buildNet() { if (space != null && !space.getEnvelope().isEmpty()) { Net net = new Net("net"); space.add(net); surface = space.getEnvelope().iterator().next(); surface.copy(net); Edge vertical = null; Edge horizontal = null; for (Edge e : surface.getEdges()) { Vertex to = e.getTo(); Vertex from = e.getFrom(); if (Math.abs(to.getZ() - from.getZ()) < Geometry.EPS) { horizontal = e; } } for (Edge e : surface.getEdges()) { Vertex to = e.getTo(); Vertex from = e.getFrom(); if (!(Math.abs(to.getZ() - from.getZ()) < Geometry.EPS) && Edge.commonVertex(horizontal, e) == horizontal.getFrom()) { vertical = e; } } Vertex origin = horizontal.getFrom(); Vertex verticalV = vertical.otherVertex(origin).minus(origin); Vertex interval = horizontal.getDirection(); interval.scale(joistInterval / interval.length()); Vertex current = origin.copy(); current.move(interval.getX(), interval.getY(), interval.getZ()); while (origin.minus(current).length() < horizontal.getLength()) { Vertex from = current.copy(); Vertex to = from.add(verticalV); net.insert(from); net.insert(to); net.insert(new Edge(from, to)); current.move(interval.getX(), interval.getY(), interval.getZ()); } return net; } return null; } /** * {@inheritDoc} */ @Override public void delete() { // TODO Auto-generated method stub } /** * Gets the space of this modellor * @return the space */ public Space getSpace() { return space; } /** Sets the space of this modellor * @param space the space */ public void setSpace(Space space) { this.space = space; } /** Gets the surface of this modellor * @return the surface */ public Surface getSurface() { return surface; } /** Sets the surface of this modellor * @param surface the surface */ public void setSurface(Surface surface) { this.surface = surface; } /** * Finds the outline of a net, if it makes sence. * The outline must be a sequence of connected outer edges, so that * the last edge is connected to the first. Also all outer edges most be * in the outline. * @param net a net * @return a list of connected edges making up the net outline */ private List netOutline(Net net) { /*Find outer edges*/ Iterator edges = net.getEdges().iterator(); Set<Edge> outer = new HashSet<Edge>(); while (edges.hasNext()) { Edge current = (Edge)edges.next(); if (current.getSurfaces().size() == 1) { outer.add(current); } } /*If there are outer edges sort them in order*/ if (!outer.isEmpty()) { LinkedList<Edge> outline = new LinkedList<Edge>(); Edge first = (Edge)outer.iterator().next(); outline.add(first); outer.remove(first); Vertex nextVertex = first.getTo(); boolean doneAll = false; while (!doneAll) { Edge next = null; Iterator nextEdges = nextVertex.getEdges().iterator(); while (nextEdges.hasNext()) { Object e = nextEdges.next(); if (outer.contains(e)) { next = (Edge)e; break; } } if (next != null) { outer.remove(next); nextVertex = next.otherVertex(nextVertex); outline.add(next); } else { doneAll = true; } } /*If all outer edges are in the outline, * and the last edge is connected to the first, * return the outline */ if (outer.isEmpty() && first.getFrom().getEdges().contains(outline.getLast())) { return outline; } else { log.warn("Outline not well defined, " + " outer edges left: " + outer.size() + " outline connected: " + first.getFrom().getEdges().contains(outline.getLast())); } } return new LinkedList(); } } |
|
From: Nordholt <nor...@us...> - 2007-04-23 14:50:17
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30625/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: added the innerwall modellor Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.120 retrieving revision 1.121 diff -C2 -d -r1.120 -r1.121 *** Project.java 17 Apr 2007 13:04:43 -0000 1.120 --- Project.java 23 Apr 2007 14:50:13 -0000 1.121 *************** *** 23,26 **** --- 23,27 ---- import net.sourceforge.bprocessor.model.modellor.Cylinder; + import net.sourceforge.bprocessor.model.modellor.InnerWallModellor; import net.sourceforge.bprocessor.model.modellor.LayerModellor; import net.sourceforge.bprocessor.model.modellor.ModelBathModellor; *************** *** 160,163 **** --- 161,165 ---- Modellor.registerModellor(new LayerModellor()); Modellor.registerModellor(new TileModellor(null)); + Modellor.registerModellor(new InnerWallModellor()); Modellor.registerModellor(new Cylinder()); Modellor.registerModellor(new WindowModellor()); |
|
From: Nordholt <nor...@us...> - 2007-04-23 14:48:39
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30024/src/net/sourceforge/bprocessor/model Modified Files: Entity.java Log Message: check to avoid null pointer exception in the comparator Index: Entity.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Entity.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Entity.java 11 Apr 2007 08:44:58 -0000 1.16 --- Entity.java 23 Apr 2007 14:48:38 -0000 1.17 *************** *** 68,77 **** */ public static void sort(List< ? > entities) { ! final Comparator<Object> comparator = ! new Comparator<Object>() { ! public int compare(Object s1, Object s2) { ! return ((Entity) s1).getId().compareTo(((Entity) s2).getId()); ! } ! }; Collections.sort(entities, comparator); } --- 68,84 ---- */ public static void sort(List< ? > entities) { ! final Comparator<Object> comparator = new Comparator<Object>() { ! public int compare(Object s1, Object s2) { ! Entity ent1 = (Entity) s1; ! Entity ent2 = (Entity) s2; ! Long id1 = ent1.getId(); ! Long id2 = ent2.getId(); ! int compare = 0; ! if (id1 == null || id2 == null) { ! return compare; ! } ! return id1.compareTo(id2); ! } ! }; Collections.sort(entities, comparator); } |
|
From: Nordholt <nor...@us...> - 2007-04-23 14:48:00
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29618/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: check if there are no surfaces Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** Edge.java 21 Apr 2007 13:36:50 -0000 1.86 --- Edge.java 23 Apr 2007 14:47:59 -0000 1.87 *************** *** 1010,1014 **** Map<Surface, Double> surToAngle = new HashMap<Surface, Double>(); List<Surface> surfs = Geometry.neighbourAroundEdge(side, e, surToAngle); ! if (surfs != null) { //for front domain Surface inside = surfs.get(0); --- 1010,1014 ---- Map<Surface, Double> surToAngle = new HashMap<Surface, Double>(); List<Surface> surfs = Geometry.neighbourAroundEdge(side, e, surToAngle); ! if (surfs != null && !surfs.isEmpty()) { //for front domain Surface inside = surfs.get(0); |
|
From: Nordholt <nor...@us...> - 2007-04-23 14:47:10
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29308/src/net/sourceforge/bprocessor/gui Modified Files: CameraView.java Log Message: no white backgroundcolor for the buttons Index: CameraView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/CameraView.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CameraView.java 15 Nov 2006 10:28:18 -0000 1.9 --- CameraView.java 23 Apr 2007 14:47:03 -0000 1.10 *************** *** 8,12 **** import java.awt.BorderLayout; - import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; --- 8,11 ---- *************** *** 25,29 **** /** * A component for displaying views - * @author rimestad * */ --- 24,27 ---- *************** *** 55,59 **** but.add(add); but.add(remove); - this.setBackground(new Color(255, 255, 255)); this.add(but, BorderLayout.SOUTH); } --- 53,56 ---- |
|
From: rimestad <rim...@us...> - 2007-04-23 11:17:02
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10829/src/net/sourceforge/bprocessor/model/modellor Modified Files: TileModellor.java Log Message: now with surface analysis Index: TileModellor.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/modellor/TileModellor.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TileModellor.java 21 Apr 2007 13:37:12 -0000 1.8 --- TileModellor.java 23 Apr 2007 11:16:53 -0000 1.9 *************** *** 19,22 **** --- 19,23 ---- import net.sourceforge.bprocessor.model.Attribute; + import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; *************** *** 25,28 **** --- 26,30 ---- import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; + import net.sourceforge.bprocessor.model.SurfaceAnalysis; import net.sourceforge.bprocessor.model.Vertex; *************** *** 107,113 **** /** ! * @param cs */ private void updateNet(CoordinateSystem cs) { double maxX = Double.MIN_VALUE, maxY = Double.MIN_VALUE, minX = Double.MAX_VALUE, minY = Double.MAX_VALUE; --- 109,119 ---- /** ! * @param cs the coordinatesystem to use as origin */ private void updateNet(CoordinateSystem cs) { + if (net == null) { + net = new Net("strip"); + } + net.clear(); double maxX = Double.MIN_VALUE, maxY = Double.MIN_VALUE, minX = Double.MAX_VALUE, minY = Double.MAX_VALUE; *************** *** 127,133 **** } } - - net = new Net("strip"); - space.add(net); surface.copyall(net); Collection<Edge> edges = new ArrayList<Edge>(net.getEdges()); --- 133,136 ---- *************** *** 178,182 **** net.insert(v); } ! //new SurfaceAnalysis().surfaceAnalysis(net); } --- 181,190 ---- net.insert(v); } ! SurfaceAnalysis sa = new SurfaceAnalysis(); ! Collection<CoordinateSystem> cons = sa.planeAnalysis(net); ! for (CoordinateSystem coors : cons) { ! net.add(coors); ! } ! sa.surfaceAnalysis(net); } |
|
From: rimestad <rim...@us...> - 2007-04-21 13:37:13
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8847/src/net/sourceforge/bprocessor/model/modellor Modified Files: TileModellor.java Log Message: made the modellor draw a net instead Index: TileModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/TileModellor.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TileModellor.java 17 Apr 2007 13:04:44 -0000 1.7 --- TileModellor.java 21 Apr 2007 13:37:12 -0000 1.8 *************** *** 9,12 **** --- 9,15 ---- import java.awt.Dimension; import java.util.ArrayList; + import java.util.Collection; + import java.util.Collections; + import java.util.Comparator; import java.util.LinkedList; import java.util.List; *************** *** 19,23 **** import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Material; ! import net.sourceforge.bprocessor.model.Relation; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; --- 22,26 ---- import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Material; ! import net.sourceforge.bprocessor.model.Net; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; *************** *** 52,55 **** --- 55,60 ---- /** tile thickness in mm */ private int tileThickness = 8; + + private Net net; /** *************** *** 70,75 **** surface = s.getEnvelope().iterator().next(); startPoint = surface.coordinateSystem(); ! startPoint.add(new Relation(surface, "0")); space.add(tileColor); } } --- 75,82 ---- surface = s.getEnvelope().iterator().next(); startPoint = surface.coordinateSystem(); ! space.getOwner().add(startPoint); ! startPoint.relate(surface); space.add(tileColor); + updateNet(startPoint); } } *************** *** 94,100 **** log.info("Modellor update on " + entity); space.clear(); ! space.add(startPoint); ! CoordinateSystem cs = startPoint; //find outer borders double maxX = Double.MIN_VALUE, maxY = Double.MIN_VALUE, minX = Double.MAX_VALUE, minY = Double.MAX_VALUE; --- 101,113 ---- log.info("Modellor update on " + entity); space.clear(); ! space.add(net); //find outer borders + + } + + /** + * @param cs + */ + private void updateNet(CoordinateSystem cs) { double maxX = Double.MIN_VALUE, maxY = Double.MIN_VALUE, minX = Double.MAX_VALUE, minY = Double.MAX_VALUE; *************** *** 114,152 **** } } ! List<Surface> tiles = new LinkedList<Surface>(); CoordinateSystem insertPoint = cs.copy(); insertPoint.setOrigin(cs.unTranslate(new Vertex(minX + jointSize / 2000.0, minY + jointSize / 2000.0, 0))); ! Vertex orig = insertPoint.center(); if (height > 0) { maxY = height / 1000.0; } ! Vertex localHori = new Vertex(tileSize.getWidth() / 1000.0 + jointSize / 2000.0, 0, 0); ! Vertex horizontalAdd = insertPoint.unTranslate(localHori).minus(orig); ! do { ! Vertex localVert = new Vertex(0, tileSize.getHeight() / 1000.0 + jointSize / 2000.0, 0); ! Vertex verticalAdd = insertPoint.unTranslate(localVert).minus(orig); ! int iterations = 0; ! do { ! tiles.add(drawTile(insertPoint, tileColor)); ! orig = orig.add(verticalAdd); ! insertPoint.setOrigin(orig); ! iterations++; ! } while (cs.translate(orig.copy()).getY() < maxY); ! orig = orig.add(horizontalAdd); ! Vertex tmp = verticalAdd.copy(); ! tmp.scale(iterations); ! orig = orig.minus(tmp); ! insertPoint.setOrigin(orig); ! } while (cs.translate(orig.copy()).getX() < maxX); ! ! for (Surface s : tiles) { ! List<Surface> extrusion = new ArrayList<Surface>(); ! Surface back = s.extrusion(-tileThickness / 1000.0, extrusion); ! extrusion.add(back); ! extrusion.add(s); ! space.addAll(extrusion); } } --- 127,233 ---- } } ! ! net = new Net("strip"); ! space.add(net); ! surface.copyall(net); ! Collection<Edge> edges = new ArrayList<Edge>(net.getEdges()); ! Collection<Edge> horEdges = new LinkedList<Edge>(); ! Collection<Edge> vertEdges = new LinkedList<Edge>(); ! Collection<Vertex> createdVerts = new LinkedList<Vertex>(); ! ! // insert horizontal edges CoordinateSystem insertPoint = cs.copy(); insertPoint.setOrigin(cs.unTranslate(new Vertex(minX + jointSize / 2000.0, minY + jointSize / 2000.0, 0))); ! Vertex orig = cs.center(); if (height > 0) { maxY = height / 1000.0; } ! Vertex localHori = new Vertex(0, tileSize.getHeight() / 1000.0 + jointSize / 2000.0, 0); ! Vertex horizontalAdd = cs.unTranslate(localHori).minus(orig); ! Edge slider = new Edge(cs.center().copy(), cs.unTranslate(new Vertex(maxX, 0, 0))); ! findIntersectingEdges(cs, slider, maxX, maxY, edges, horEdges, createdVerts, horizontalAdd); ! //insert vertical edges ! Vertex localVertical = new Vertex(tileSize.getWidth() / 1000.0 + jointSize / 2000.0, 0, 0); ! Vertex verticalAdd = cs.unTranslate(localVertical).minus(orig); ! slider = new Edge(cs.center().copy(), cs.unTranslate(new Vertex(0, maxY, 0))); ! findIntersectingEdges(cs, slider, maxX, maxY, edges, vertEdges, createdVerts, verticalAdd); ! ! Collection<Vertex> extras = new LinkedList<Vertex>(); ! for (Edge e1 : vertEdges) { ! for (Edge e2 : horEdges) { ! Edge inter = e1.intersection(e2); ! if (inter.getLength() < 0.00001 && ! e2.coincides(inter.getFrom()) && ! e1.coincides(inter.getFrom())) { ! extras.add(inter.getFrom()); ! } ! } } + for (Vertex v : createdVerts) { + net.insert(v); + } + for (Edge e : horEdges) { + net.insert(e); + } + for (Edge e : vertEdges) { + net.insert(e); + } + for (Vertex v : extras) { + net.insert(v); + } + //new SurfaceAnalysis().surfaceAnalysis(net); + } + + /** + * @param cs the coordinatesystem to work in + * @param slider The edge that slides over the surface + * @param maxX the maximum value for x + * @param maxY the maximum value for y + * @param edges The edges to check intersection with + * @param createdEdges the list to put all the created edges in + * @param createdVerts the list to put all the found intersection in + * @param increment the vertex to increment with in each step + */ + private void findIntersectingEdges(CoordinateSystem cs, + Edge slider, + double maxX, + double maxY, + Collection<Edge> edges, + Collection<Edge> createdEdges, + Collection<Vertex> createdVerts, + Vertex increment) { + do { + List<Vertex> intersections = new LinkedList<Vertex>(); + for (Edge inside : edges) { + Edge found = slider.intersection(inside); + if (found != null) { + if (found.getLength() < 0.0001 && inside.coincides(found.getTo())) { + intersections.add(found.getTo()); + } + } + } + if (intersections.size() > 1) { + Collections.sort(intersections, new DistComparator(slider.getFrom())); + Vertex prev = null; + for (Vertex v : intersections) { + if (prev != null) { + createdVerts.add(prev); + createdVerts.add(v); + createdEdges.add(new Edge(prev, v)); + prev = null; + } else { + prev = v; + } + } + } else { + if (!intersections.isEmpty()) { + createdVerts.add(intersections.get(0)); + } + } + slider.move(increment); + } while (cs.translate(slider.getFrom()).getY() < maxY && + cs.translate(slider.getFrom()).getX() < maxX); } *************** *** 190,203 **** public void setAttributes(Map<String, Attribute> attributes) { Attribute a = attributes.get("Tilewidth"); if (a != null) { ! tileSize.width = ((Double)a.getValue()).intValue(); } a = attributes.get("Tileheight"); if (a != null) { ! tileSize.height = ((Double)a.getValue()).intValue(); } a = attributes.get("Joint width"); if (a != null) { ! jointSize = ((Double)a.getValue()).intValue(); } a = attributes.get("Material"); --- 271,297 ---- public void setAttributes(Map<String, Attribute> attributes) { Attribute a = attributes.get("Tilewidth"); + boolean updateNet = false; if (a != null) { ! int width = ((Double)a.getValue()).intValue(); ! if (width != tileSize.width) { ! updateNet = true; ! tileSize.width = width; ! } } a = attributes.get("Tileheight"); if (a != null) { ! int height = ((Double)a.getValue()).intValue(); ! if (height != tileSize.width) { ! updateNet = true; ! tileSize.height = height; ! } } a = attributes.get("Joint width"); if (a != null) { ! int joint = ((Double)a.getValue()).intValue(); ! if (joint != jointSize) { ! updateNet = true; ! jointSize = joint; ! } } a = attributes.get("Material"); *************** *** 209,217 **** a = attributes.get("Surface"); if (a != null) { ! surface = (Surface)a.getValue(); } a = attributes.get("Setting height"); if (a != null) { ! height = ((Double)a.getValue()).intValue(); } update(this); --- 303,325 ---- a = attributes.get("Surface"); if (a != null) { ! Surface tmp = (Surface)a.getValue(); ! if (space.getEnvelope().contains(tmp)) { ! if (!tmp.equals(surface)) { ! surface = tmp; ! startPoint = surface.coordinateSystem(); ! updateNet = true; ! } ! } } a = attributes.get("Setting height"); if (a != null) { ! int h = ((Double)a.getValue()).intValue(); ! if (h != height) { ! updateNet = true; ! height = h; ! } ! } ! if (updateNet) { ! updateNet(startPoint); } update(this); *************** *** 304,306 **** --- 412,448 ---- return "Tilemodellor"; } + + /** + * A comparator class to compare vertices distance to at third vertex + * @author Rimestad + */ + public class DistComparator implements Comparator<Vertex> { + + private Vertex origin; + + /** + * Constructor + * @param origin the Vertex that the distance is compared to + */ + public DistComparator(Vertex origin) { + this.origin = origin; + } + + /** + * {@inheritDoc} + */ + public int compare(Vertex o1, Vertex o2) { + double dist1 = origin.distance(o1); + double dist2 = origin.distance(o2); + double diff = dist1 - dist2; + if (diff > 0) { + return 1; + } else if (diff < 0) { + return -1; + } else { + return 0; + } + } + + } } |
|
From: rimestad <rim...@us...> - 2007-04-21 13:36:58
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8464/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: added move method that takes a vertex and calls the already implemented move(double, double, double) method Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** Edge.java 16 Apr 2007 15:55:22 -0000 1.85 --- Edge.java 21 Apr 2007 13:36:50 -0000 1.86 *************** *** 1116,1118 **** --- 1116,1126 ---- (to.equalEps(e.from) || to.equalEps(e.to))); } + + /** + * Calls {@link net.sourceforge.bprocessor.model.Edge#move(double, double, double)} + * @param delta The delta vector to move + */ + public void move(Vertex delta) { + move(delta.getX(), delta.getY(), delta.getZ()); + } } |
|
From: rimestad <rim...@us...> - 2007-04-21 13:36:09
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8077/src/net/sourceforge/bprocessor/gl/tool Modified Files: AltMoveTool.java Log Message: avoided anoying bug when related system and surface ain't in the same space Index: AltMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AltMoveTool.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AltMoveTool.java 14 Mar 2007 10:22:08 -0000 1.9 --- AltMoveTool.java 21 Apr 2007 13:35:59 -0000 1.10 *************** *** 20,23 **** --- 20,24 ---- import net.sourceforge.bprocessor.gl.view.Transformation; import net.sourceforge.bprocessor.gl.view.View; + import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; *************** *** 121,124 **** --- 122,130 ---- vertices = Collections.EMPTY_LIST; } + if (system == null) { + GUI.getInstance().alert( + "The Alternative move tool does not like nonexsisting coordinatesystems"); + //TODO find a nicer solution + } origin = system.getOrigin().copy(); start = new Intersection(origin, Intersection.SURFACE, null); |
|
From: Michael L. <he...@us...> - 2007-04-19 13:39:01
|
Update of /cvsroot/bprocessor/test/input In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1703/input Added Files: angle1.xml Log Message: New test program under construction --- NEW FILE: angle1.xml --- <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <bmodel> <active>1</active> <cs>57</cs> <name>new project</name> <space name="World" union="false" level="2" transparent="false" type="1" voidref="2" progid="0" id="1"> <description/> <Classification>unassigned</Classification> <constructor xsi:type="CoordinateSystemType" onlyplane="false" active="true" editable="true" progid="1" id="57" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <vertex y="0.0" z="0.0" x="0.0" id="58"/> <ijn> <vertex y="0.0" z="0.0" x="1.0" id="54"/> <vertex y="1.0" z="0.0" x="0.0" id="55"/> <vertex y="0.0" z="1.0" x="0.0" id="56"/> </ijn> </constructor> <space name="Void" union="false" level="3" transparent="false" type="1" progid="1" id="2"> <description/> <Classification>unassigned</Classification> <boundary>3</boundary> <boundary>4</boundary> <boundary>5</boundary> <boundary>6</boundary> <boundary>7</boundary> <boundary>8</boundary> <boundary>9</boundary> <boundary>10</boundary> </space> <surface progid="13" id="3"> <edgeref>21</edgeref> <edgeref>13</edgeref> <edgeref>19</edgeref> <edgeref>20</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="14" id="4"> <edgeref>23</edgeref> <edgeref>16</edgeref> <edgeref>19</edgeref> <edgeref>22</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="15" id="5"> <edgeref>25</edgeref> <edgeref>14</edgeref> <edgeref>19</edgeref> <edgeref>24</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="16" id="6"> <edgeref>27</edgeref> <edgeref>17</edgeref> <edgeref>19</edgeref> <edgeref>26</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="17" id="7"> <edgeref>29</edgeref> <edgeref>11</edgeref> <edgeref>19</edgeref> <edgeref>28</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="18" id="8"> <edgeref>31</edgeref> <edgeref>18</edgeref> <edgeref>19</edgeref> <edgeref>30</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="19" id="9"> <edgeref>33</edgeref> <edgeref>12</edgeref> <edgeref>19</edgeref> <edgeref>32</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="20" id="10"> <edgeref>35</edgeref> <edgeref>15</edgeref> <edgeref>19</edgeref> <edgeref>34</edgeref> <back>2</back> <front>2</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <edge constructor="false" progid="1" id="11"> <from>36</from> <to>37</to> </edge> <edge constructor="false" progid="2" id="12"> <from>36</from> <to>38</to> </edge> <edge constructor="false" progid="3" id="13"> <from>36</from> <to>39</to> </edge> <edge constructor="false" progid="4" id="14"> <from>36</from> <to>40</to> </edge> <edge constructor="false" progid="8" id="15"> <from>41</from> <to>36</to> </edge> <edge constructor="false" progid="12" id="16"> <from>36</from> <to>42</to> </edge> <edge constructor="false" progid="16" id="17"> <from>36</from> <to>43</to> </edge> <edge constructor="false" progid="20" id="18"> <from>36</from> <to>44</to> </edge> <edge constructor="false" progid="21" id="19"> <from>36</from> <to>45</to> </edge> <edge constructor="false" progid="22" id="20"> <from>45</from> <to>46</to> </edge> <edge constructor="false" progid="23" id="21"> <from>46</from> <to>39</to> </edge> <edge constructor="false" progid="24" id="22"> <from>45</from> <to>47</to> </edge> <edge constructor="false" progid="25" id="23"> <from>47</from> <to>42</to> </edge> <edge constructor="false" progid="26" id="24"> <from>45</from> <to>48</to> </edge> <edge constructor="false" progid="27" id="25"> <from>48</from> <to>40</to> </edge> <edge constructor="false" progid="28" id="26"> <from>45</from> <to>49</to> </edge> <edge constructor="false" progid="29" id="27"> <from>49</from> <to>43</to> </edge> <edge constructor="false" progid="30" id="28"> <from>45</from> <to>50</to> </edge> <edge constructor="false" progid="31" id="29"> <from>50</from> <to>37</to> </edge> <edge constructor="false" progid="32" id="30"> <from>45</from> <to>51</to> </edge> <edge constructor="false" progid="33" id="31"> <from>51</from> <to>44</to> </edge> <edge constructor="false" progid="34" id="32"> <from>45</from> <to>52</to> </edge> <edge constructor="false" progid="35" id="33"> <from>52</from> <to>38</to> </edge> <edge constructor="false" progid="36" id="34"> <from>45</from> <to>53</to> </edge> <edge constructor="false" progid="37" id="35"> <from>53</from> <to>41</to> </edge> <vertex y="5.0" z="0.0" x="5.0" progid="2" id="36"/> <vertex y="2.0" z="0.0" x="5.0" progid="3" id="37"/> <vertex y="5.0" z="0.0" x="2.0" progid="4" id="38"/> <vertex y="8.0" z="0.0" x="5.0" progid="5" id="39"/> <vertex y="5.0" z="0.0" x="8.0" progid="6" id="40"/> <vertex y="6.5" z="0.0" x="3.5" progid="7" id="41"/> <vertex y="6.5" z="0.0" x="6.5" progid="8" id="42"/> <vertex y="3.5" z="0.0" x="6.5" progid="9" id="43"/> <vertex y="3.5" z="0.0" x="3.5" progid="10" id="44"/> <vertex y="5.0" z="6.0" x="5.0" progid="11" id="45"/> <vertex y="8.0" z="5.0" x="5.0" progid="12" id="46"/> <vertex y="6.5" z="5.0" x="6.5" progid="13" id="47"/> <vertex y="5.0" z="5.0" x="8.0" progid="14" id="48"/> <vertex y="3.5" z="5.0" x="6.5" progid="15" id="49"/> <vertex y="2.0" z="5.0" x="5.0" progid="16" id="50"/> <vertex y="3.5" z="5.0" x="3.5" progid="17" id="51"/> <vertex y="5.0" z="5.0" x="2.0" progid="18" id="52"/> <vertex y="6.5" z="5.0" x="3.5" progid="19" id="53"/> </space> </bmodel> |
|
From: Michael L. <he...@us...> - 2007-04-19 13:39:01
|
Update of /cvsroot/bprocessor/test/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1703/src Modified Files: build.xml Log Message: New test program under construction Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/test/src/build.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** build.xml 4 Dec 2006 14:45:53 -0000 1.1 --- build.xml 19 Apr 2007 13:38:50 -0000 1.2 *************** *** 14,18 **** <target name="compile" depends="dep"> <javac srcdir="${src.dir}" destdir="${build.dir}" deprecation="yes" ! debug="yes" target="1.2" source="1.3" includes="net/**"> <classpath refid="build.path"/> --- 14,18 ---- <target name="compile" depends="dep"> <javac srcdir="${src.dir}" destdir="${build.dir}" deprecation="yes" ! debug="yes" target="1.5" source="1.5" includes="net/**"> <classpath refid="build.path"/> |
|
From: Michael L. <he...@us...> - 2007-04-19 13:39:01
|
Update of /cvsroot/bprocessor/test/src/net/sourceforge/bprocessor/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1703/src/net/sourceforge/bprocessor/test Added Files: SurfaceAngles.java Log Message: New test program under construction --- NEW FILE: SurfaceAngles.java --- //--------------------------------------------------------------------------------- // $Id: SurfaceAngles.java,v 1.1 2007/04/19 13:38:50 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.test; import java.io.File; import java.util.Collection; import java.util.LinkedList; import java.util.List; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Persistence; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; /** * */ public class SurfaceAngles { /** * @param args args */ public static void main(String[] args) { File input = new File(args[0]); try { Persistence.load(input); printEdges(Project.getInstance().world().getEdges()); } catch (Exception e) { e.printStackTrace(); } } private static void printEdges(Collection<Edge> edges) { List<Edge> sorted = new LinkedList(edges); Entity.sort(sorted); for (Edge edge : sorted) { printEdge(edge); } } private static void printEdge(Edge edge) { Collection<Surface> surfaces = edge.getSurfaces(); List<Surface> sorted = new LinkedList(surfaces); Entity.sort(sorted); Vertex direction = edge.getDirection(); System.out.println("" + edge.getId() + " direction: " + direction); for (Surface surface : sorted) { Vertex normal = surface.normal(); System.out.println(" " + surface.getId() + " normal: " + normal); } } } |
|
From: Michael L. <he...@us...> - 2007-04-19 13:39:01
|
Update of /cvsroot/bprocessor/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1703 Added Files: angles.sh Log Message: New test program under construction --- NEW FILE: angles.sh --- #!/bin/sh CLASSPATH="dist/test.jar:lib/model.jar:lib/jaxb.jar:lib/log4j.jar" CLASS="net.sourceforge.bprocessor.test.SurfaceAngles" echo '-- angle 1 --' java -cp ${CLASSPATH} ${CLASS} input/angle1.xml |
|
From: rimestad <rim...@us...> - 2007-04-17 13:05:18
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1041/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: made transforms show in the att view when created Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** PopupMenu.java 15 Apr 2007 11:08:37 -0000 1.31 --- PopupMenu.java 17 Apr 2007 13:05:11 -0000 1.32 *************** *** 27,30 **** --- 27,31 ---- import net.sourceforge.bprocessor.gui.actions.ModellorMenuAction; import net.sourceforge.bprocessor.gui.actions.SpaceMenuAction; + import net.sourceforge.bprocessor.gui.attrview.AttributeView; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Camera; *************** *** 40,43 **** --- 41,45 ---- import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; + import net.sourceforge.bprocessor.model.Transform; import net.sourceforge.bprocessor.model.Translate; import net.sourceforge.bprocessor.model.Vertex; *************** *** 130,135 **** AbstractAction translate = new SpaceMenuAction(s, "Translate") { public void actionPerformed(ActionEvent arg0) { ! space.addTransform(new Translate()); space.changed(); Project.getInstance().checkpoint(); } --- 132,139 ---- AbstractAction translate = new SpaceMenuAction(s, "Translate") { public void actionPerformed(ActionEvent arg0) { ! Transform t = new Translate(); ! space.addTransform(t); space.changed(); + AttributeView.instance().display(t); Project.getInstance().checkpoint(); } *************** *** 138,143 **** AbstractAction rotate = new SpaceMenuAction(s, "Rotate") { public void actionPerformed(ActionEvent arg0) { ! space.addTransform(new Rotate()); space.changed(); Project.getInstance().checkpoint(); } --- 142,149 ---- AbstractAction rotate = new SpaceMenuAction(s, "Rotate") { public void actionPerformed(ActionEvent arg0) { ! Transform t = new Rotate(); ! space.addTransform(t); space.changed(); + AttributeView.instance().display(t); Project.getInstance().checkpoint(); } *************** *** 146,151 **** AbstractAction scale = new SpaceMenuAction(s, "Scale") { public void actionPerformed(ActionEvent arg0) { ! space.addTransform(new Scale()); space.changed(); Project.getInstance().checkpoint(); } --- 152,159 ---- AbstractAction scale = new SpaceMenuAction(s, "Scale") { public void actionPerformed(ActionEvent arg0) { ! Transform t = new Scale(); ! space.addTransform(t); space.changed(); + AttributeView.instance().display(t); Project.getInstance().checkpoint(); } *************** *** 154,159 **** AbstractAction translatelocal = new SpaceMenuAction(s, "Translate Local") { public void actionPerformed(ActionEvent arg0) { ! space.pushTransform(new Translate()); space.changed(); Project.getInstance().checkpoint(); } --- 162,169 ---- AbstractAction translatelocal = new SpaceMenuAction(s, "Translate Local") { public void actionPerformed(ActionEvent arg0) { ! Transform t = new Translate(); ! space.pushTransform(t); space.changed(); + AttributeView.instance().display(t); Project.getInstance().checkpoint(); } *************** *** 162,167 **** AbstractAction rotatelocal = new SpaceMenuAction(s, "Rotate Local") { public void actionPerformed(ActionEvent arg0) { ! space.pushTransform(new Rotate()); space.changed(); Project.getInstance().checkpoint(); } --- 172,179 ---- AbstractAction rotatelocal = new SpaceMenuAction(s, "Rotate Local") { public void actionPerformed(ActionEvent arg0) { ! Transform t = new Rotate(); ! space.pushTransform(t); space.changed(); + AttributeView.instance().display(t); Project.getInstance().checkpoint(); } *************** *** 170,175 **** AbstractAction scalelocal = new SpaceMenuAction(s, "Scale Local") { public void actionPerformed(ActionEvent arg0) { ! space.pushTransform(new Scale()); space.changed(); Project.getInstance().checkpoint(); } --- 182,189 ---- AbstractAction scalelocal = new SpaceMenuAction(s, "Scale Local") { public void actionPerformed(ActionEvent arg0) { ! Transform t = new Scale(); ! space.pushTransform(t); space.changed(); + AttributeView.instance().display(t); Project.getInstance().checkpoint(); } |
|
From: rimestad <rim...@us...> - 2007-04-17 13:04:45
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv634/src/net/sourceforge/bprocessor/model Modified Files: Persistence.java Project.java Log Message: made cylinder and tile modellor able to be saved by persistence by adding material as a type in externalizeModellor Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Persistence.java 11 Apr 2007 12:19:41 -0000 1.36 --- Persistence.java 17 Apr 2007 13:04:43 -0000 1.37 *************** *** 1354,1357 **** --- 1354,1364 ---- } else if (val == null) { elem = null; + } else if (val instanceof Material) { + RefType r = new RefTypeImpl(); + r.setRef(id(map, val)); + if (r.getRef() == 0) { + log.error("Could not find " + val); + } + elem.setValue(r); } else { log.error("Type were not implemented " + val.getClass().getName()); Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.119 retrieving revision 1.120 diff -C2 -d -r1.119 -r1.120 *** Project.java 16 Apr 2007 15:55:22 -0000 1.119 --- Project.java 17 Apr 2007 13:04:43 -0000 1.120 *************** *** 935,938 **** --- 935,939 ---- new Classification("-99", "Egne klassifikationer", functionalClas, 1)); } + bf.close(); } |