bprocessor-commit Mailing List for B-processor (Page 62)
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-31 12:42:05
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4659/src/net/sourceforge/bprocessor/gl/tool Modified Files: FinalMoveTool.java Log Message: Refactored code in the model. delete(Surface) no longer deletes edges Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** FinalMoveTool.java 30 May 2007 06:57:38 -0000 1.12 --- FinalMoveTool.java 31 May 2007 12:41:59 -0000 1.13 *************** *** 132,139 **** private void divide(int i, int n) { Vertex v = direction.copy(); - System.out.println("n = " + n); - System.out.println("i = " + i); double delta = -v.length() / (double) (n - 1); - System.out.println("delta = " + delta); double d = (double) i * delta; --- 132,136 ---- *************** *** 247,251 **** public void cleanUp() { if (start != null) { - System.out.println("escaping..."); current = start; move(); --- 244,247 ---- |
From: Michael L. <he...@us...> - 2007-05-31 12:42:05
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4659/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Refactored code in the model. delete(Surface) no longer deletes edges Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.213 retrieving revision 1.214 diff -C2 -d -r1.213 -r1.214 *** View.java 30 May 2007 17:29:53 -0000 1.213 --- View.java 31 May 2007 12:41:59 -0000 1.214 *************** *** 1663,1689 **** gl.glNormal3d(norm.getX(), norm.getY(), norm.getZ()); } - if (debug) { - Vertex from = s.getEdges().get(0).getFrom(); - Vertex to = from.add(norm); - drawEdge(new Edge(from, to)); - } drawContour(s, tess); ! Collection innerSurfaces = s.getHoles(); ! if (innerSurfaces != null) { ! Iterator innerIt = innerSurfaces.iterator(); ! while (innerIt.hasNext()) { ! Surface surface = (Surface)innerIt.next(); ! if (surface.getOwner() == s.getOwner()) { ! drawContour(surface, tess); ! } ! if (FALSE) { ! if (hit) { ! if (surface.getOwner() == s.getOwner()) { ! drawContour(surface, tess); ! } ! } else { ! drawContour(surface, tess); ! } ! } } } --- 1663,1671 ---- gl.glNormal3d(norm.getX(), norm.getY(), norm.getZ()); } drawContour(s, tess); ! Collection<Surface> holes = s.getHoles(); ! for (Surface surface : holes) { ! if (surface.getOwner() == s.getOwner()) { ! drawContour(surface, tess); } } |
From: Michael L. <he...@us...> - 2007-05-31 12:42:01
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4644/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Geometry.java Space.java Log Message: Refactored code in the model. delete(Surface) no longer deletes edges Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.164 retrieving revision 1.165 diff -C2 -d -r1.164 -r1.165 *** Surface.java 30 May 2007 17:28:33 -0000 1.164 --- Surface.java 31 May 2007 12:41:55 -0000 1.165 *************** *** 328,331 **** --- 328,338 ---- /** + * Remove references to this Surface in the rest of the model + */ + public void unlink() { + + } + + /** * Calculate center of gravity * @return The center of gravity *************** *** 547,550 **** --- 554,567 ---- } copy.setEdges(edges); + Space front = (Space) map.get(frontDomain); + if (front == null) { + front = frontDomain; + } + copy.setFrontDomain(front); + Space back = (Space) map.get(backDomain); + if (back == null) { + back = backDomain; + } + copy.setBackDomain(back); } return copy; *************** *** 1110,1129 **** */ public void move(double dx, double dy, double dz) { ! { ! List vertices = getVertices(); ! Iterator iter = vertices.iterator(); ! while (iter.hasNext()) { ! Vertex vertex = (Vertex) iter.next(); ! vertex.move(dx, dy, dz); ! } } ! { ! if (getHoles() != null) { ! Iterator iter = getHoles().iterator(); ! while (iter.hasNext()) { ! Surface surface = (Surface) iter.next(); ! surface.move(dx, dy, dz); ! } ! } } } --- 1127,1135 ---- */ public void move(double dx, double dy, double dz) { ! for (Vertex vertex : getVertices()) { ! vertex.move(dx, dy, dz); } ! for (Surface surface : getHoles()) { ! surface.move(dx, dy, dz); } } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.147 retrieving revision 1.148 diff -C2 -d -r1.147 -r1.148 *** Space.java 29 May 2007 12:39:17 -0000 1.147 --- Space.java 31 May 2007 12:41:55 -0000 1.148 *************** *** 35,38 **** --- 35,40 ---- private static final long serialVersionUID = 1L; + private static final boolean DELETE_EDGES = false; + private static Logger log = Logger.getLogger(Space.class); /** Construction Type */ *************** *** 911,921 **** */ public void remove(Surface surface) { ! if (surface.getHoles() != null) { ! for (Surface curHole : surface.getHoles()) { ! if (surface.getExterior() != null) { ! surface.getExterior().addHole(curHole); ! } else { ! curHole.setExterior(null); ! } } } --- 913,921 ---- */ public void remove(Surface surface) { ! for (Surface current : surface.getHoles()) { ! if (surface.getExterior() != null) { ! surface.getExterior().addHole(current); ! } else { ! current.setExterior(null); } } *************** *** 994,1003 **** public void delete(Surface surface) { remove(surface); ! List edges = surface.getEdges(); ! Iterator it = edges.iterator(); ! while (it.hasNext()) { ! Edge edge = (Edge)it.next(); ! if (edge.getSurfaces().size() < 1) { ! delete(edge); } } --- 994,1002 ---- public void delete(Surface surface) { remove(surface); ! if (DELETE_EDGES) { ! for (Edge edge : surface.getEdges()) { ! if (edge.getSurfaces().size() < 1) { ! delete(edge); ! } } } *************** *** 1435,1439 **** @Override public String toString() { ! return "[ " + getLevelString() + getName() + "]"; } --- 1434,1438 ---- @Override public String toString() { ! return "[" + getLevelString() + " " + getName() + "]"; } Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** Geometry.java 30 May 2007 17:28:33 -0000 1.58 --- Geometry.java 31 May 2007 12:41:55 -0000 1.59 *************** *** 484,493 **** Surface surface = (Surface) o; vertices.addAll(surface.getVertices()); ! if (surface.getHoles() != null) { ! Iterator iter = surface.getHoles().iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! collect(current, vertices); ! } } } else if (o instanceof ClippingPlane) { --- 484,489 ---- Surface surface = (Surface) o; vertices.addAll(surface.getVertices()); ! for (Surface current : surface.getHoles()) { ! collect(current, vertices); } } else if (o instanceof ClippingPlane) { |
From: rimestad <rim...@us...> - 2007-05-30 17:31:23
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8505/src/net/sourceforge/bprocessor/gui/actions Modified Files: CsvReader.java Log Message: tried to make the spaceassignment in the readin better but not with much luck, the winding of the surfaces aren't consistens in the given data as far as I can see at least Index: CsvReader.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CsvReader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CsvReader.java 31 Jan 2007 20:45:54 -0000 1.2 --- CsvReader.java 30 May 2007 17:31:22 -0000 1.3 *************** *** 20,23 **** --- 20,24 ---- import net.sourceforge.bprocessor.model.Classification; + import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Space; *************** *** 197,204 **** outer.addHole(s); } ! s.setFrontDomain(currentSpace); where.add(s); } else { ! log.warn("There were a edge list with fewer that 3 edges"); } verts.clear(); --- 198,233 ---- outer.addHole(s); } ! CoordinateSystem cs = new CoordinateSystem(new Vertex(1, 0, 0), new Vertex(0, 1, 0), ! new Vertex(0, 0, 1), new Vertex(0, 0, 0)); ! int dir = s.direction(cs); ! if (dir == Surface.LEFT) { ! s.setBackDomain(currentSpace); ! } else if (dir == Surface.RIGHT) { ! s.setFrontDomain(currentSpace); ! } else { ! cs = new CoordinateSystem(new Vertex(0, 0, 1), new Vertex(0, 1, 0), ! new Vertex(1, 0, 0), new Vertex(0, 0, 0)); ! dir = s.direction(cs); ! if (dir == Surface.LEFT) { ! s.setBackDomain(currentSpace); ! } else if (dir == Surface.RIGHT) { ! s.setFrontDomain(currentSpace); ! } else { ! cs = new CoordinateSystem(new Vertex(1, 0, 0), new Vertex(0, 0, 1), ! new Vertex(0, 1, 0), new Vertex(0, 0, 0)); ! dir = s.direction(cs); ! if (dir == Surface.LEFT) { ! s.setBackDomain(currentSpace); ! } else if (dir == Surface.RIGHT) { ! s.setFrontDomain(currentSpace); ! } else { ! log.info("Had to give up assigning"); ! } ! } ! } where.add(s); + log.debug("Surface " + s + " had a direction of " + dir); } else { ! log.warn("There were a edge list with fewer than 3 edges"); } verts.clear(); |
From: rimestad <rim...@us...> - 2007-05-30 17:30:03
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8025/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: added a boolean field telling the view if it is in debug mode (make it draw normals) or not Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.212 retrieving revision 1.213 diff -C2 -d -r1.212 -r1.213 *** View.java 24 May 2007 10:41:04 -0000 1.212 --- View.java 30 May 2007 17:29:53 -0000 1.213 *************** *** 386,389 **** --- 386,391 ---- private List<Integer> deletedLists = new LinkedList<Integer>(); + private boolean debug = false; + static { setTransparency(100); *************** *** 1661,1664 **** --- 1663,1671 ---- gl.glNormal3d(norm.getX(), norm.getY(), norm.getZ()); } + if (debug) { + Vertex from = s.getEdges().get(0).getFrom(); + Vertex to = from.add(norm); + drawEdge(new Edge(from, to)); + } drawContour(s, tess); Collection innerSurfaces = s.getHoles(); |
From: rimestad <rim...@us...> - 2007-05-30 17:28:58
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7632/src/net/sourceforge/bprocessor/model/modellor Modified Files: TileModellor.java ModelBathModellor2.java Log Message: minor changes/fixes Index: TileModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/TileModellor.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** TileModellor.java 30 May 2007 11:28:48 -0000 1.15 --- TileModellor.java 30 May 2007 17:28:58 -0000 1.16 *************** *** 49,53 **** 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}); --- 49,53 ---- private int height = 0; ! private Material jointMaterial = 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}); *************** *** 63,66 **** --- 63,68 ---- private Net net; + + private Set<Surface> ignoredSurfaces = new HashSet<Surface>(); /** *************** *** 135,138 **** --- 137,143 ---- @Override public void update(Object entity) { + if (!isActive()) { + return; + } if (space == null || surface == null) { log.warn("Could not update modellor due to null space og surface"); *************** *** 153,169 **** 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); ! if (sign == -1) { ! newS.setBackDomain(sp); ! newS.setFrontMaterial(tileColor); ! } else { ! newS.setFrontDomain(sp); ! newS.setBackMaterial(tileColor); } - space.add(sp); } --- 158,176 ---- double offset = -(double)jointSize / 2000; for (Surface s : surs) { ! if (!ignoredSurfaces.contains(s)) { ! 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); ! if (sign == -1) { ! newS.setBackDomain(sp); ! newS.setFrontMaterial(tileColor); ! } else { ! newS.setFrontDomain(sp); ! newS.setBackMaterial(tileColor); ! } ! space.add(sp); } } *************** *** 171,178 **** if (sign == -1) { outer.setBackDomain(joint); ! outer.setFrontMaterial(jointMatetrial); } else { outer.setFrontDomain(joint); ! outer.setBackMaterial(jointMatetrial); } Collection<Surface> tmp = new LinkedList<Surface>(); --- 178,185 ---- if (sign == -1) { outer.setBackDomain(joint); ! outer.setFrontMaterial(jointMaterial); } else { outer.setFrontDomain(joint); ! outer.setBackMaterial(jointMaterial); } Collection<Surface> tmp = new LinkedList<Surface>(); *************** *** 211,214 **** --- 218,222 ---- Collection<Edge> edges = new ArrayList<Edge>(surface.getEdges()); for (Surface s : surface.getHoles()) { + ignoredSurfaces.add(s); edges.addAll(s.getEdges()); } *************** *** 405,409 **** a = attributes.get("Setting height"); if (a != null) { ! int h = ((Double)a.getValue()).intValue(); if (h != height) { updateNet = true; --- 413,417 ---- a = attributes.get("Setting height"); if (a != null) { ! int h = (int)(1000 * (Double)a.getValue()); if (h != height) { updateNet = true; Index: ModelBathModellor2.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/ModelBathModellor2.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ModelBathModellor2.java 30 May 2007 11:28:48 -0000 1.5 --- ModelBathModellor2.java 30 May 2007 17:28:58 -0000 1.6 *************** *** 175,179 **** private void addTileModellors() { for (Space elem : walls.getElements()) { - String name = elem.getName(); if (elem.getType() == Space.CONSTRUCTION && elem.isContainer() && --- 175,178 ---- *************** *** 365,387 **** for (Space spc : doorAndWindows) { double maxDist = 0; ! Surface outer = null; for (Surface s : spc.getEnvelope()) { ! Surface news = s.copy(walls); ! double dist = news.center().distance(center); ! Geometry.holeAnalysis(news); ! if (dist > maxDist && ! Math.abs(news.normal().getZ()) < 0.0001 && ! news.getExterior() != null) { ! maxDist = dist; ! outer = news; } } sides.clear(); ! Surface s = outer.extrusion(-(wallThickness - 0.005), sides); walls.insert(s); for (Surface sur : sides) { walls.insert(sur); } ! } } --- 364,387 ---- for (Space spc : doorAndWindows) { double maxDist = 0; ! Surface inner = null; for (Surface s : spc.getEnvelope()) { ! if (s.getFrontDomain() == bath || s.getBackDomain() == bath) { ! inner = s.copy(walls); } } + //extrude tile layer in + Geometry.holeAnalysis(inner); sides.clear(); ! Surface s = inner.extrusion(0.005, sides); walls.insert(s); for (Surface sur : sides) { walls.insert(sur); } ! //extrude contrete layer in ! sides.clear(); ! sides.add(s.extrusion(wallThickness - 0.005, sides)); ! for (Surface sur : sides) { ! walls.insert(sur); ! } } } *************** *** 430,433 **** --- 430,434 ---- t = sur.extrusion(-wallThickness, sides); } + t.setOppositeSpace(doorSpc, bath); sides.add(t); for (Surface surface : sides) { *************** *** 467,470 **** --- 468,472 ---- t = sur.extrusion(-wallThickness, sides); } + t.setOppositeSpace(winSpc, bath); sides.add(t); for (Surface surface : sides) { |
From: rimestad <rim...@us...> - 2007-05-30 17:28:45
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7610/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Geometry.java Log Message: small change to surface.direction making it more conservative Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.163 retrieving revision 1.164 diff -C2 -d -r1.163 -r1.164 *** Surface.java 29 May 2007 11:49:22 -0000 1.163 --- Surface.java 30 May 2007 17:28:33 -0000 1.164 *************** *** 102,105 **** --- 102,106 ---- Vertex v = to.minus(common); Vertex cross = u.cross(v); + cross.normalize(); double determinant = system.determinant(); *************** *** 113,117 **** // the orientation of the coordinate-system: positive means right-handed // and negative means left-handed. ! if (cross.getZ() * determinant < 0) { return RIGHT; --- 114,120 ---- // the orientation of the coordinate-system: positive means right-handed // and negative means left-handed. ! if (Math.abs(cross.getZ()) < 0.01) { ! return PARALLEL; ! } if (cross.getZ() * determinant < 0) { return RIGHT; *************** *** 1369,1373 **** /** ! * * @return value */ --- 1372,1376 ---- /** ! * USE normal for the normal * @return value */ Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** Geometry.java 20 May 2007 10:19:41 -0000 1.57 --- Geometry.java 30 May 2007 17:28:33 -0000 1.58 *************** *** 972,976 **** } } ! /** * Untranslates all vertices of a set of geometry, and changes the --- 972,976 ---- } } ! /** * Untranslates all vertices of a set of geometry, and changes the *************** *** 980,986 **** * @param system the coordinate system to untranslate according to */ ! public static void unTranslateGeometry(Collection geometry, CoordinateSystem system) { List<Vertex> vertices = new LinkedList<Vertex>(collect(geometry)); ! List<Vertex> unTranslatedVertices = system.unTranslate(vertices); Iterator it = vertices.iterator(); Iterator unTranslatedIt = unTranslatedVertices.iterator(); --- 980,987 ---- * @param system the coordinate system to untranslate according to */ ! public static void unTranslateGeometry(Collection<? extends Geometric> geometry, ! CoordinateSystem system) { List<Vertex> vertices = new LinkedList<Vertex>(collect(geometry)); ! List<Vertex> unTranslatedVertices = system.unTranslate(vertices, true); Iterator it = vertices.iterator(); Iterator unTranslatedIt = unTranslatedVertices.iterator(); *************** *** 993,997 **** } } ! /** * Find the angle between two edges, where both edges are treated as if they pointed --- 994,998 ---- } } ! /** * Find the angle between two edges, where both edges are treated as if they pointed |
From: rimestad <rim...@us...> - 2007-05-30 17:27:28
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7221/src/net/sourceforge/bprocessor/model Modified Files: CoordinateSystem.java Log Message: made untranslate take a boolean telling if it should alter the given geometry or copy it Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** CoordinateSystem.java 7 May 2007 13:32:05 -0000 1.51 --- CoordinateSystem.java 30 May 2007 17:27:22 -0000 1.52 *************** *** 11,15 **** import java.util.Collection; import java.util.HashMap; - import java.util.Iterator; import java.util.LinkedList; import java.util.List; --- 11,14 ---- *************** *** 431,437 **** * the global coordinate system * @param vertex The vertex to un-translate * @return The un-translated vertex */ ! public Vertex unTranslate(Vertex vertex) { Vertex ii = i.copy(); ii.scale(vertex.getX()); --- 430,437 ---- * the global coordinate system * @param vertex The vertex to un-translate + * @param modify True if the existing vertex should be modified false otherwise * @return The un-translated vertex */ ! public Vertex unTranslate(Vertex vertex, boolean modify) { Vertex ii = i.copy(); ii.scale(vertex.getX()); *************** *** 440,444 **** Vertex nn = n.copy(); nn.scale(vertex.getZ()); ! return getOrigin().add(ii).add(jj).add(nn); } --- 440,461 ---- Vertex nn = n.copy(); nn.scale(vertex.getZ()); ! Vertex tmp = getOrigin().add(ii).add(jj).add(nn); ! if (modify) { ! vertex.setX(tmp.getX()); ! vertex.setY(tmp.getY()); ! vertex.setZ(tmp.getZ()); ! tmp = vertex; ! } ! return tmp; ! } ! ! /** ! * Return the vertex translated from the CoordinateSystem to ! * the global coordinate system ! * @param vertex The vertex to un-translate ! * @return The un-translated vertex ! */ ! public Vertex unTranslate(Vertex vertex) { ! return unTranslate(vertex, false); } *************** *** 448,456 **** * @return The translated list */ ! public List translate(List vertices) { ! List result = new ArrayList(); ! Iterator iter = vertices.iterator(); ! while (iter.hasNext()) { ! Vertex current = (Vertex) iter.next(); result.add(translate(current)); } --- 465,471 ---- * @return The translated list */ ! public List<Vertex> translate(List<Vertex> vertices) { ! List<Vertex> result = new ArrayList<Vertex>(); ! for (Vertex current : vertices) { result.add(translate(current)); } *************** *** 461,470 **** * Untranslate all vertices in the list * @param vertices The list of vertices * @return The untranslated list */ ! public List<Vertex> unTranslate(List<Vertex> vertices) { List<Vertex> result = new ArrayList<Vertex>(); for (Vertex current : vertices) { ! result.add(unTranslate(current)); } return result; --- 476,486 ---- * Untranslate all vertices in the list * @param vertices The list of vertices + * @param modify true if the existing vertexes should be kept false if they should be copied * @return The untranslated list */ ! public List<Vertex> unTranslate(Collection<Vertex> vertices, boolean modify) { List<Vertex> result = new ArrayList<Vertex>(); for (Vertex current : vertices) { ! result.add(unTranslate(current, modify)); } return result; |
From: rimestad <rim...@us...> - 2007-05-30 11:53:29
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6125/src/net/sourceforge/bprocessor/model Modified Files: Classification.java Log Message: better tile modellor and bathcabin Index: Classification.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Classification.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Classification.java 18 May 2007 19:07:56 -0000 1.16 --- Classification.java 30 May 2007 11:28:49 -0000 1.17 *************** *** 184,195 **** if (cur != null && cur.getOwner().getLevel() != Space.PROJECT_LEVEL) { current = cur.getOwner(); ! if (current.getClassification() == par) { ! fullId = current.getClassification().getFullId(current) + "." + fullId; par = par.getParent(); } else { ! fullId = current.getClassification().getFullId(current) + "." + fullId; par = par.getParent(); } - } else { while (par != null) { --- 184,195 ---- if (cur != null && cur.getOwner().getLevel() != Space.PROJECT_LEVEL) { current = cur.getOwner(); ! Classification currentClas = current.getClassification(); ! if (currentClas == par) { ! fullId = currentClas.getFullId(current) + "." + fullId; par = par.getParent(); } else { ! fullId = par.getFullId(current) + "." + fullId; par = par.getParent(); } } else { while (par != null) { |
From: rimestad <rim...@us...> - 2007-05-30 11:53:28
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6125/src/net/sourceforge/bprocessor/model/modellor Modified Files: TileModellor.java ModelBathModellor2.java Log Message: better tile modellor and bathcabin Index: TileModellor.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/modellor/TileModellor.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TileModellor.java 24 May 2007 21:41:49 -0000 1.14 --- TileModellor.java 30 May 2007 11:28:48 -0000 1.15 *************** *** 103,107 **** private Surface pickSurface() { Surface res = null; ! for (Surface s : space.getSurfaces()) { Surface ext = s.getExterior(); if (ext != null && ext.getOwner().getLevel() < space.getLevel()) { --- 103,107 ---- private Surface pickSurface() { Surface res = null; ! for (Surface s : space.getEnvelope()) { Surface ext = s.getExterior(); if (ext != null && ext.getOwner().getLevel() < space.getLevel()) { *************** *** 116,120 **** } else { //look for a surface with a funktional space assign that is vertical ! if (s.getFrontDomain().getType() == Space.FUNCTIONAL && Math.abs(s.normal().getZ()) < 0.0001) { res = s; --- 116,121 ---- } else { //look for a surface with a funktional space assign that is vertical ! if (res == null && (s.getFrontDomain().getType() == Space.FUNCTIONAL || ! s.getBackDomain().getType() == Space.FUNCTIONAL) && Math.abs(s.normal().getZ()) < 0.0001) { res = s; *************** *** 215,223 **** Collection<Edge> vertEdges = new LinkedList<Edge>(); Collection<Vertex> horVerts = new LinkedList<Vertex>(); ! Collection<Vertex> otherVerts = new LinkedList<Vertex>(); long before = System.currentTimeMillis(); ! // insert horizontal edges if (height > 0) { maxY = height / 1000.0; --- 216,224 ---- Collection<Edge> vertEdges = new LinkedList<Edge>(); Collection<Vertex> horVerts = new LinkedList<Vertex>(); ! Collection<Vertex> vertVerts = new LinkedList<Vertex>(); long before = System.currentTimeMillis(); ! // find horizontal edges if (height > 0) { maxY = height / 1000.0; *************** *** 229,233 **** 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()); --- 230,234 ---- findIntersectingEdges(cs, slider, maxX, maxY, minX, minY, edges, horEdges, horVerts, horizontalAdd); ! //find vertical edges Vertex localVertical = new Vertex(tileSize.getWidth() / 1000.0 + jointSize / 1000.0, 0, 0); Vertex verticalAdd = cs.unTranslate(localVertical).minus(cs.center()); *************** *** 235,246 **** cs.unTranslate(new Vertex(0, maxY, 0)).minus(verticalAdd)); findIntersectingEdges(cs, slider, maxX, maxY, minX, minY, ! edges, vertEdges, otherVerts, verticalAdd); - //insert edges and vertices into the model List<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())) { --- 236,247 ---- cs.unTranslate(new Vertex(0, maxY, 0)).minus(verticalAdd)); findIntersectingEdges(cs, slider, maxX, maxY, minX, minY, ! edges, vertEdges, vertVerts, verticalAdd); List<Vertex> extras = new LinkedList<Vertex>(); for (Edge e1 : vertEdges) { for (Edge e2 : horEdges) { Edge inter = e1.intersection(e2); ! if (inter != null && ! inter.getLength() < 0.00001 && e2.coincides(inter.getFrom()) && e1.coincides(inter.getFrom())) { *************** *** 249,261 **** } } - 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); --- 250,256 ---- *************** *** 264,267 **** --- 259,263 ---- v = net.insert(v); } + long time1 = System.currentTimeMillis(); log.info("Edge insertsion time : " + (time1 - before)); *************** *** 345,354 **** @Override public void getAttributes(List<Attribute> l) { ! l.add(new Attribute("Tilewidth", new Double(tileSize.width))); ! l.add(new Attribute("Tileheight", new Double(tileSize.height))); ! l.add(new Attribute("Joint width", new Double(jointSize))); l.add(new Attribute("Material", tileColor)); l.add(new Attribute("Surface", surface)); ! l.add(new Attribute("Setting height", new Double(height))); } --- 341,350 ---- @Override public void getAttributes(List<Attribute> l) { ! l.add(new Attribute("Tilewidth", new Double(tileSize.width / 1000.0))); ! l.add(new Attribute("Tileheight", new Double(tileSize.height / 1000.0))); ! l.add(new Attribute("Joint width", new Double(jointSize / 1000.0))); l.add(new Attribute("Material", tileColor)); l.add(new Attribute("Surface", surface)); ! l.add(new Attribute("Setting height", new Double(height / 1000.0))); } *************** *** 359,363 **** boolean updateNet = false; if (a != null) { ! int width = ((Double)a.getValue()).intValue(); if (width != tileSize.width) { updateNet = true; --- 355,359 ---- boolean updateNet = false; if (a != null) { ! int width = (int)(1000 * ((Double)a.getValue()).doubleValue()); if (width != tileSize.width) { updateNet = true; *************** *** 367,372 **** a = attributes.get("Tileheight"); if (a != null) { ! int height = ((Double)a.getValue()).intValue(); ! if (height != tileSize.width) { updateNet = true; tileSize.height = height; --- 363,368 ---- a = attributes.get("Tileheight"); if (a != null) { ! int height = (int)(1000 * ((Double)a.getValue()).doubleValue()); ! if (height != tileSize.height) { updateNet = true; tileSize.height = height; *************** *** 375,379 **** a = attributes.get("Joint width"); if (a != null) { ! int joint = ((Double)a.getValue()).intValue(); if (joint != jointSize) { updateNet = true; --- 371,375 ---- a = attributes.get("Joint width"); if (a != null) { ! int joint = (int)(1000 * ((Double)a.getValue()).doubleValue()); if (joint != jointSize) { updateNet = true; *************** *** 487,492 **** @Override public void delete() { ! // TODO Auto-generated method stub ! } --- 483,487 ---- @Override public void delete() { ! Project.getInstance().removeObserver(this); } Index: ModelBathModellor2.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/modellor/ModelBathModellor2.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ModelBathModellor2.java 24 May 2007 21:41:50 -0000 1.4 --- ModelBathModellor2.java 30 May 2007 11:28:48 -0000 1.5 *************** *** 71,74 **** --- 71,76 ---- private Collection<Space> doorAndWindows = new ArrayList<Space>(); + private Collection<Modellor> insideModellors = new LinkedList<Modellor>(); + /** * the constructor *************** *** 87,97 **** space.setUnion(true); coord = Project.getInstance().getActiveCoordinateSystem(); ! width = 2.800; ! length = 3.200; ! height = 2.800; generateNet(); space.add(net); net.edit(); - Project.getInstance().addObserver(this); } --- 89,98 ---- space.setUnion(true); coord = Project.getInstance().getActiveCoordinateSystem(); ! width = 1.500; ! length = 1.500; ! height = 2.600; generateNet(); space.add(net); net.edit(); } *************** *** 169,178 **** elementWalls(); ! //addTileModellors(); } private void addTileModellors() { for (Space elem : walls.getElements()) { ! elem.setModellor(new TileModellor(elem)); } } --- 170,186 ---- elementWalls(); ! addTileModellors(); } private void addTileModellors() { for (Space elem : walls.getElements()) { ! String name = elem.getName(); ! if (elem.getType() == Space.CONSTRUCTION && ! elem.isContainer() && ! elem.getName().equals("Tile")) { ! TileModellor tm = new TileModellor(elem); ! insideModellors .add(tm); ! elem.setModellor(tm); ! } } } *************** *** 677,680 **** --- 685,691 ---- bath.clear(); ceiling.clear(); + for (Modellor m : insideModellors) { + m.delete(); + } } doorAndWindows.clear(); |
From: Michael L. <he...@us...> - 2007-05-30 06:57:38
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27139/src/net/sourceforge/bprocessor/gl/tool Modified Files: FinalMoveTool.java Log Message: Implemented divide Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** FinalMoveTool.java 29 May 2007 21:08:40 -0000 1.11 --- FinalMoveTool.java 30 May 2007 06:57:38 -0000 1.12 *************** *** 118,122 **** } ! private void apply(int i) { Vertex v = direction.copy(); v.scale(i); --- 118,122 ---- } ! private void multiply(int i) { Vertex v = direction.copy(); v.scale(i); *************** *** 129,132 **** --- 129,150 ---- Project.getInstance().getActiveSpace().insert(copy); } + + private void divide(int i, int n) { + Vertex v = direction.copy(); + System.out.println("n = " + n); + System.out.println("i = " + i); + double delta = -v.length() / (double) (n - 1); + System.out.println("delta = " + delta); + double d = (double) i * delta; + + v.scale(d / v.length()); + Mesh copy = mesh.copy(); + for (Vertex current : copy.vertices()) { + current.setX(current.getX() + v.getX()); + current.setY(current.getY() + v.getY()); + current.setZ(current.getZ() + v.getZ()); + } + Project.getInstance().getActiveSpace().insert(copy); + } /** {@inheritDoc} */ *************** *** 198,202 **** if (value.length() > 0) { char token = value.charAt(0); ! if (token == '*') { String expression = value.substring(1); Stack result = evaluateString("echo " + expression); --- 216,220 ---- if (value.length() > 0) { char token = value.charAt(0); ! if (token == '*' || token == '/') { String expression = value.substring(1); Stack result = evaluateString("echo " + expression); *************** *** 206,212 **** Double d = (Double) top; int n = d.intValue(); ! for (int i = 1; i < n - 1; i++) { ! apply(i); } Project.getInstance().checkpoint(); } --- 224,237 ---- Double d = (Double) top; int n = d.intValue(); ! if (token == '*') { ! for (int i = 1; i < n - 1; i++) { ! multiply(i); ! } ! } else if (token == '/') { ! for (int i = 1; i < n - 1; i++) { ! divide(i, n); ! } } + Project.getInstance().checkpoint(); } |
From: Michael L. <he...@us...> - 2007-05-29 21:08:44
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22376/src/net/sourceforge/bprocessor/gl/tool Modified Files: FinalMoveTool.java Log Message: Implemented repeat in move tool Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** FinalMoveTool.java 29 May 2007 13:57:56 -0000 1.10 --- FinalMoveTool.java 29 May 2007 21:08:40 -0000 1.11 *************** *** 42,46 **** private boolean copy; ! private int count = 0; /** --- 42,47 ---- private boolean copy; ! private Mesh mesh; ! private Vertex direction; /** *************** *** 116,119 **** --- 117,132 ---- } } + + private void apply(int i) { + Vertex v = direction.copy(); + v.scale(i); + Mesh copy = mesh.copy(); + for (Vertex current : copy.vertices()) { + current.setX(current.getX() + v.getX()); + current.setY(current.getY() + v.getY()); + current.setZ(current.getZ() + v.getZ()); + } + Project.getInstance().getActiveSpace().insert(copy); + } /** {@inheritDoc} */ *************** *** 165,175 **** edges.addAll(Surface.edges(surfaces)); vertices.addAll(Edge.vertices(edges)); ! Mesh mesh = new Mesh(surfaces, edges, vertices); ! owner.insert(mesh); geometrics = null; } owner.simplify(); Project.getInstance().checkpoint(); cleanUp(); } } --- 178,191 ---- edges.addAll(Surface.edges(surfaces)); vertices.addAll(Edge.vertices(edges)); ! mesh = new Mesh(surfaces, edges, vertices); ! direction = last.minus(start.vertex()); ! owner.insert(mesh.copy()); geometrics = null; } owner.simplify(); Project.getInstance().checkpoint(); + start = null; cleanUp(); + moved(e); } } *************** *** 180,189 **** @Override public Object evaluate(String value) { - System.out.println("evaluate " + value); if (value.length() > 0) { char token = value.charAt(0); if (token == '*') { String expression = value.substring(1); - System.out.println("repeat + '" + expression + "'"); Stack result = evaluateString("echo " + expression); if (result.size() == 1) { --- 196,203 ---- *************** *** 191,195 **** if (top instanceof Double) { Double d = (Double) top; ! System.out.println("repeat " + d); } } --- 205,213 ---- if (top instanceof Double) { Double d = (Double) top; ! int n = d.intValue(); ! for (int i = 1; i < n - 1; i++) { ! apply(i); ! } ! Project.getInstance().checkpoint(); } } *************** *** 203,206 **** --- 221,229 ---- */ public void cleanUp() { + if (start != null) { + System.out.println("escaping..."); + current = start; + move(); + } super.cleanUp(); if (copy) { |
From: Michael L. <he...@us...> - 2007-05-29 21:08:43
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22386/src/net/sourceforge/bprocessor/model Modified Files: Mesh.java Log Message: Implemented repeat in move tool Index: Mesh.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Mesh.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Mesh.java 11 Apr 2007 12:19:41 -0000 1.16 --- Mesh.java 29 May 2007 21:08:43 -0000 1.17 *************** *** 9,14 **** --- 9,16 ---- import java.util.Collection; + import java.util.HashMap; import java.util.LinkedList; import java.util.List; + import java.util.Map; /** *************** *** 183,185 **** --- 185,208 ---- return result; } + + /** + * Returns a copy of this mesh + * @return copy of this Mesh + */ + public Mesh copy() { + Collection<Vertex> vs = new LinkedList(); + Collection<Edge> es = new LinkedList(); + Collection<Surface> ss = new LinkedList(); + Map map = new HashMap(); + for (Vertex current : vertices) { + vs.add((Vertex) current.copy(map)); + } + for (Edge current : edges) { + es.add((Edge) current.copy(map)); + } + for (Surface current : surfaces) { + ss.add((Surface) current.copy(map)); + } + return new Mesh(ss, es, vs); + } } |
From: Michael L. <he...@us...> - 2007-05-29 13:57:56
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11135/src/net/sourceforge/bprocessor/gl/tool Modified Files: FinalMoveTool.java Log Message: Started implementation of repeat Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** FinalMoveTool.java 29 May 2007 13:23:01 -0000 1.9 --- FinalMoveTool.java 29 May 2007 13:57:56 -0000 1.10 *************** *** 15,18 **** --- 15,19 ---- import java.util.LinkedList; import java.util.Map; + import java.util.Stack; import net.sourceforge.bprocessor.gl.GLView; *************** *** 177,180 **** --- 178,205 ---- * {@inheritDoc} */ + @Override + public Object evaluate(String value) { + System.out.println("evaluate " + value); + if (value.length() > 0) { + char token = value.charAt(0); + if (token == '*') { + String expression = value.substring(1); + System.out.println("repeat + '" + expression + "'"); + Stack result = evaluateString("echo " + expression); + if (result.size() == 1) { + Object top = result.pop(); + if (top instanceof Double) { + Double d = (Double) top; + System.out.println("repeat " + d); + } + } + } + } + return null; + } + + /** + * {@inheritDoc} + */ public void cleanUp() { super.cleanUp(); |
From: Michael L. <he...@us...> - 2007-05-29 13:23:02
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29498/src/net/sourceforge/bprocessor/gl/tool Modified Files: FinalMoveTool.java Log Message: Implemented copy using the alt key in the new move tool Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** FinalMoveTool.java 29 May 2007 12:39:13 -0000 1.8 --- FinalMoveTool.java 29 May 2007 13:23:01 -0000 1.9 *************** *** 12,15 **** --- 12,16 ---- import java.util.Collection; import java.util.HashMap; + import java.util.HashSet; import java.util.LinkedList; import java.util.Map; *************** *** 20,26 **** --- 21,30 ---- import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Geometry; + import net.sourceforge.bprocessor.model.Mesh; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; + import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; + import net.sourceforge.bprocessor.model.Space; /** *************** *** 130,133 **** --- 134,139 ---- copied.add(current.copy(map)); } + geometrics = copied; + Project.getInstance().getActiveSpace().addProtected(geometrics); } *************** *** 141,145 **** } else { Geometric geometric = affected.iterator().next(); ! geometric.getOwner().simplify(); Project.getInstance().checkpoint(); cleanUp(); --- 147,172 ---- } else { Geometric geometric = affected.iterator().next(); ! Space owner = geometric.getOwner(); ! if (copy) { ! owner.removeProtected(geometrics); ! Collection<Vertex> vertices = new HashSet(); ! Collection<Edge> edges = new HashSet(); ! Collection<Surface> surfaces = new HashSet(); ! for (Geometric current : geometrics) { ! if (current instanceof Surface) { ! surfaces.add((Surface) current); ! } else if (current instanceof Edge) { ! edges.add((Edge) current); ! } else if (current instanceof Vertex) { ! vertices.add((Vertex) current); ! } ! } ! edges.addAll(Surface.edges(surfaces)); ! vertices.addAll(Edge.vertices(edges)); ! Mesh mesh = new Mesh(surfaces, edges, vertices); ! owner.insert(mesh); ! geometrics = null; ! } ! owner.simplify(); Project.getInstance().checkpoint(); cleanUp(); *************** *** 152,155 **** --- 179,187 ---- public void cleanUp() { super.cleanUp(); + if (copy) { + if (geometrics != null) { + Project.getInstance().getActiveSpace().removeProtected(geometrics); + } + } geometrics = null; affected = null; |
From: Michael L. <he...@us...> - 2007-05-29 12:39:35
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12153/src/net/sourceforge/bprocessor/gl/tool Modified Files: FinalMoveTool.java Log Message: Refacted add/remove protected in Space Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FinalMoveTool.java 29 May 2007 11:49:14 -0000 1.7 --- FinalMoveTool.java 29 May 2007 12:39:13 -0000 1.8 *************** *** 11,15 **** --- 11,17 ---- import java.awt.event.MouseEvent; import java.util.Collection; + import java.util.HashMap; import java.util.LinkedList; + import java.util.Map; import net.sourceforge.bprocessor.gl.GLView; *************** *** 122,131 **** copy = e.isAltDown(); ! ! Collection<Geometric> copied = new LinkedList(); ! for (Geometric current : geometrics) { ! // empty } ! vertices = Geometry.collect(geometrics); affected = getAffected(geometrics); --- 124,135 ---- copy = e.isAltDown(); ! if (copy) { ! Collection<Geometric> copied = new LinkedList(); ! Map map = new HashMap(); ! for (Geometric current : geometrics) { ! copied.add(current.copy(map)); ! } } ! vertices = Geometry.collect(geometrics); affected = getAffected(geometrics); |
From: Michael L. <he...@us...> - 2007-05-29 12:39:35
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12171/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Refacted add/remove protected in Space Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.146 retrieving revision 1.147 diff -C2 -d -r1.146 -r1.147 *** Space.java 24 May 2007 11:00:11 -0000 1.146 --- Space.java 29 May 2007 12:39:17 -0000 1.147 *************** *** 2413,2448 **** /** ! * Remove collection of surfaces from this space ! * @param extrusion Collection of surfaces */ ! public void removeProtected(Collection<Surface> extrusion) { ! Iterator surfaces = extrusion.iterator(); ! while (surfaces.hasNext()) { ! Surface surface = (Surface) surfaces.next(); ! if (surface.getOwner() == this) { ! if (surface.protect()) { ! this.remove(surface); ! } } ! Iterator edges = surface.getEdges().iterator(); ! while (edges.hasNext()) { ! Edge edge = (Edge) edges.next(); ! if (edge.getOwner() == this) { ! if (edge.protect()) { ! this.remove(edge); ! } ! } ! Vertex from = edge.getFrom(); ! if (from.getOwner() == this) { ! if (from.protect()) { ! this.remove(from); ! } ! } ! Vertex to = edge.getTo(); ! if (to.getOwner() == this) { ! if (to.protect()) { ! this.remove(to); ! } ! } } } --- 2413,2450 ---- /** ! * Removes a collection of geometric objects ! * @param geometrics Collection of geometric objects */ ! public void removeProtected(Collection geometrics) { ! for (Object object : geometrics) { ! removeProtected((Geometric) object); ! } ! } ! ! /** ! * Removes a protected geometric ! * @param geometric Geometric ! */ ! public void removeProtected(Geometric geometric) { ! if (geometric instanceof Surface) { ! removeProtected((Surface) geometric); ! } else if (geometric instanceof Edge) { ! removeProtected((Edge) geometric); ! } else if (geometric instanceof Vertex) { ! removeProtected((Vertex) geometric); ! } ! } ! ! /** ! * Removes a protected surface ! * @param surface Surface ! */ ! public void removeProtected(Surface surface) { ! if (surface.getOwner() == this) { ! if (surface.protect()) { ! remove(surface); } ! for (Edge edge : surface.getEdges()) { ! removeProtected(edge); } } *************** *** 2450,2481 **** /** ! * Add extrusion to this space and protect all elements ! * @param extrusion Collection of surfaces */ ! public void addProtected(Collection<Surface> extrusion) { ! Iterator surfaces = extrusion.iterator(); ! while (surfaces.hasNext()) { ! Surface surface = (Surface) surfaces.next(); ! Iterator edges = surface.getEdges().iterator(); ! while (edges.hasNext()) { ! Edge edge = (Edge) edges.next(); ! Vertex from = edge.getFrom(); ! if (from.getOwner() == null) { ! from.protect(true); ! this.add(from); ! } ! Vertex to = edge.getTo(); ! if (to.getOwner() == null) { ! to.protect(true); ! this.add(to); ! } ! if (edge.getOwner() == null) { ! edge.protect(true); ! this.add(edge); ! } } ! if (surface.getOwner() == null) { ! surface.protect(true); ! this.add(surface); } } --- 2452,2476 ---- /** ! * Removes a protected edge ! * @param edge Edge */ ! public void removeProtected(Edge edge) { ! if (edge.getOwner() == this) { ! if (edge.protect()) { ! remove(edge); } ! removeProtected(edge.from); ! removeProtected(edge.to); ! } ! } ! ! /** ! * Removes a protected vertex ! * @param vertex Vertex ! */ ! public void removeProtected(Vertex vertex) { ! if (vertex.getOwner() == this) { ! if (vertex.protect()) { ! remove(vertex); } } *************** *** 2483,2486 **** --- 2478,2543 ---- /** + * Add collection of geometrics to this space and protect all elements + * @param geometrics Collection of geometrics + */ + public void addProtected(Collection geometrics) { + for (Object object : geometrics) { + addProtected((Geometric) object); + } + } + + /** + * Adds a protected geometric + * @param geometric Geometric + */ + public void addProtected(Geometric geometric) { + if (geometric instanceof Surface) { + addProtected((Surface) geometric); + } else if (geometric instanceof Edge) { + addProtected((Edge) geometric); + } else if (geometric instanceof Vertex) { + addProtected((Vertex) geometric); + } + } + + /** + * Adds a protected surface + * @param surface Surface + */ + public void addProtected(Surface surface) { + for (Edge edge : surface.getEdges()) { + addProtected(edge); + } + if (surface.getOwner() == null) { + surface.protect(true); + add(surface); + } + } + + /** + * Adds a protected edge + * @param edge Edge + */ + public void addProtected(Edge edge) { + addProtected(edge.from); + addProtected(edge.to); + if (edge.getOwner() == null) { + edge.protect(true); + add(edge); + } + } + + /** + * Adds a protected vertex + * @param vertex Vertex + */ + public void addProtected(Vertex vertex) { + if (vertex.getOwner() == null) { + vertex.protect(true); + add(vertex); + } + } + + /** * Add surfaces and all of its geometry to this space * @param surfaces Collection of surfaces |
From: Michael L. <he...@us...> - 2007-05-29 12:37:40
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24587/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: Refactored the copy(Map) operations in geometric Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** PopupMenu.java 24 May 2007 10:58:12 -0000 1.33 --- PopupMenu.java 29 May 2007 11:49:25 -0000 1.34 *************** *** 456,460 **** for (Surface surface : inside) { ! Surface copy = surface.copy(map); Space front = surface.getFrontDomain(); if (front != owner.getEmpty()) { --- 456,460 ---- for (Surface surface : inside) { ! Surface copy = (Surface) surface.copy(map); Space front = surface.getFrontDomain(); if (front != owner.getEmpty()) { *************** *** 475,479 **** } for (Surface surface : border) { ! Surface copy = surface.copy(map); Space front = surface.getFrontDomain(); if (front != owner.getEmpty()) { --- 475,479 ---- } for (Surface surface : border) { ! Surface copy = (Surface) surface.copy(map); Space front = surface.getFrontDomain(); if (front != owner.getEmpty()) { |
From: Michael L. <he...@us...> - 2007-05-29 12:37:40
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24569/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java Surface.java Geometric.java Log Message: Refactored the copy(Map) operations in geometric Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.162 retrieving revision 1.163 diff -C2 -d -r1.162 -r1.163 *** Surface.java 24 May 2007 10:53:13 -0000 1.162 --- Surface.java 29 May 2007 11:49:22 -0000 1.163 *************** *** 518,522 **** public Surface copy(Space space) { HashMap map = new HashMap(); ! Surface surface = copy(map); Collection<Surface> surfaces = new LinkedList<Surface>(); surfaces.add(surface); --- 518,522 ---- public Surface copy(Space space) { HashMap map = new HashMap(); ! Surface surface = (Surface) copy(map); Collection<Surface> surfaces = new LinkedList<Surface>(); surfaces.add(surface); *************** *** 533,537 **** * @return A copy */ ! public Surface copy(Map map) { Surface copy = (Surface) map.get(this); if (copy == null) { --- 533,537 ---- * @return A copy */ ! public Geometric copy(Map map) { Surface copy = (Surface) map.get(this); if (copy == null) { *************** *** 541,545 **** while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! edges.add(current.copy(map)); } copy.setEdges(edges); --- 541,545 ---- while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! edges.add((Edge) current.copy(map)); } copy.setEdges(edges); Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** Edge.java 24 May 2007 10:44:53 -0000 1.90 --- Edge.java 29 May 2007 11:49:22 -0000 1.91 *************** *** 283,290 **** * @return A copy */ ! public Edge copy(Map<Edge, Edge> map) { Edge copy = (Edge) map.get(this); if (copy == null) { ! copy = new Edge(from.copy(map), to.copy(map)); map.put(this, copy); } --- 283,290 ---- * @return A copy */ ! public Geometric copy(Map map) { Edge copy = (Edge) map.get(this); if (copy == null) { ! copy = new Edge((Vertex) from.copy(map), (Vertex) to.copy(map)); map.put(this, copy); } Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** Vertex.java 24 May 2007 10:54:36 -0000 1.60 --- Vertex.java 29 May 2007 11:49:22 -0000 1.61 *************** *** 243,247 **** * @return A copy */ ! public Vertex copy(Map map) { Vertex copy = (Vertex) map.get(this); if (copy == null) { --- 243,247 ---- * @return A copy */ ! public Geometric copy(Map map) { Vertex copy = (Vertex) map.get(this); if (copy == null) { Index: Geometric.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometric.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Geometric.java 21 Mar 2007 11:58:06 -0000 1.15 --- Geometric.java 29 May 2007 11:49:22 -0000 1.16 *************** *** 9,12 **** --- 9,13 ---- import java.util.Collection; + import java.util.Map; import java.util.Set; *************** *** 77,80 **** --- 78,91 ---- } + + /** + * Return a copy of this geometric + * @param map Map to map originals to copies + * @return a copy. + */ + public Geometric copy(Map map) { + throw new Error("copy must be implemented in class " + this.getClass().getName()); + } + /** * Collects the set of vertices in this geometric |
From: Michael L. <he...@us...> - 2007-05-29 12:37:40
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24560/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java Log Message: Refactored the copy(Map) operations in geometric Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** NetFacadeModellor.java 20 May 2007 10:19:36 -0000 1.33 --- NetFacadeModellor.java 29 May 2007 11:49:18 -0000 1.34 *************** *** 974,978 **** private static Set<Surface> genFramePost(Surface cut, double length, double bottomAngle, double topAngle) { ! Surface copy = cut.copy(new HashMap()); copy.setBackDomain(cut.getBackDomain()); copy.setFrontDomain(cut.getFrontDomain()); --- 974,978 ---- private static Set<Surface> genFramePost(Surface cut, double length, double bottomAngle, double topAngle) { ! Surface copy = (Surface) cut.copy(new HashMap()); copy.setBackDomain(cut.getBackDomain()); copy.setFrontDomain(cut.getFrontDomain()); |
From: Michael L. <he...@us...> - 2007-05-29 12:37:40
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24550/src/net/sourceforge/bprocessor/gl/tool Modified Files: FinalMoveTool.java AltMoveTool.java Log Message: Refactored the copy(Map) operations in geometric Index: AltMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AltMoveTool.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** AltMoveTool.java 7 May 2007 13:29:48 -0000 1.11 --- AltMoveTool.java 29 May 2007 11:49:14 -0000 1.12 *************** *** 147,151 **** Plane plane = system.plane(); dragplane = plane.orthogonalPlane(ray); - } else { Project.getInstance().checkpoint(); --- 147,150 ---- *************** *** 153,157 **** cleanUp(); moved(e); ! } } --- 152,156 ---- cleanUp(); moved(e); ! } } Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FinalMoveTool.java 16 May 2007 06:58:04 -0000 1.6 --- FinalMoveTool.java 29 May 2007 11:49:14 -0000 1.7 *************** *** 33,36 **** --- 33,37 ---- private Vertex last; private Vertex to; + private boolean copy; private int count = 0; *************** *** 119,122 **** --- 120,131 ---- geometrics.addAll(Selection.primary()); } + + copy = e.isAltDown(); + + Collection<Geometric> copied = new LinkedList(); + for (Geometric current : geometrics) { + // empty + } + vertices = Geometry.collect(geometrics); affected = getAffected(geometrics); *************** *** 140,143 **** --- 149,154 ---- super.cleanUp(); geometrics = null; + affected = null; + copy = false; } } |
From: rimestad <rim...@us...> - 2007-05-24 21:43:08
|
Update of /cvsroot/bprocessor//gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10137/src/net/sourceforge/bprocessor/gui/attrview Modified Files: GenericPanel.java Log Message: didn't paint parameters when repainting, refactored to one methodcall do it all that both paint and update paint calls Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor//gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** GenericPanel.java 8 May 2007 12:34:06 -0000 1.37 --- GenericPanel.java 24 May 2007 21:43:07 -0000 1.38 *************** *** 71,80 **** this.content = Box.createVerticalBox(); obj = param; ! attributes = param.getAttributes(); ! generateContent(attributes, content); ! if (param instanceof Entity) { ! Entity paramEnt = (Entity)param; ! generateContent(paramEnt.getParameters().getAttributes(), content); ! } Box title = Box.createVerticalBox(); Box header = Box.createHorizontalBox(); --- 71,75 ---- this.content = Box.createVerticalBox(); obj = param; ! generateContentFor(param); Box title = Box.createVerticalBox(); Box header = Box.createHorizontalBox(); *************** *** 94,97 **** --- 89,101 ---- addMouseListener(this); } + + private void generateContentFor(Parametric param) { + attributes = param.getAttributes(); + generateContent(attributes, content); + if (param instanceof Entity) { + Entity paramEnt = (Entity)param; + generateContent(paramEnt.getParameters().getAttributes(), content); + } + } /** *************** *** 388,394 **** //FIXME need to delay call to a reasonable time content.removeAll(); ! attributes = obj.getAttributes(); ! genAttributes.clear(); ! generateContent(attributes, content); revalidate(); } --- 392,396 ---- //FIXME need to delay call to a reasonable time content.removeAll(); ! generateContentFor(obj); revalidate(); } |
From: rimestad <rim...@us...> - 2007-05-24 21:41:50
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9416/src/net/sourceforge/bprocessor/model/modellor Modified Files: TileModellor.java ModelBathModellor2.java Added Files: WallPartingModellor.java Log Message: forgot som modellor stuff Index: TileModellor.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/modellor/TileModellor.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TileModellor.java 7 May 2007 13:40:18 -0000 1.13 --- TileModellor.java 24 May 2007 21:41:49 -0000 1.14 *************** *** 79,86 **** } else { space = s; ! surface = s.getEnvelope().iterator().next(); ! startPoint = surface.coordinateSystem(); space.getOwner().add(startPoint); - startPoint.relate(surface); space.add(tileColor); updateNet(startPoint); --- 79,90 ---- } else { space = s; ! surface = pickSurface(); ! if (surface != null) { ! startPoint = surface.coordinateSystem(); ! startPoint.relate(surface); ! } else { ! startPoint = Project.getInstance().getActiveCoordinateSystem().copy(); ! } space.getOwner().add(startPoint); space.add(tileColor); updateNet(startPoint); *************** *** 88,92 **** } } ! /** * {@inheritDoc} --- 92,96 ---- } } ! /** * {@inheritDoc} *************** *** 96,100 **** return new TileModellor(s); } ! /** * {@inheritDoc} --- 100,132 ---- return new TileModellor(s); } ! ! private Surface pickSurface() { ! Surface res = null; ! for (Surface s : space.getSurfaces()) { ! Surface ext = s.getExterior(); ! if (ext != null && ext.getOwner().getLevel() < space.getLevel()) { ! // exterior were on a higher level look at the spaces of it ! if ((ext.getFrontDomain().getType() == Space.FUNCTIONAL ! && ext.getFrontDomain().isContainer()) || ! (ext.getBackDomain().getType() == Space.FUNCTIONAL ! && ext.getBackDomain().isContainer())) { ! //the surface is assigned to a ! res = s; ! } ! } else { ! //look for a surface with a funktional space assign that is vertical ! if (s.getFrontDomain().getType() == Space.FUNCTIONAL && ! Math.abs(s.normal().getZ()) < 0.0001) { ! res = s; ! } ! } ! } ! //if none is found and there are surfaces just pick the fist one ! if (res == null && !space.getSurfaces().isEmpty()) { ! res = space.getSurfaces().iterator().next(); ! } ! return res; ! } ! /** * {@inheritDoc} --- NEW FILE: WallPartingModellor.java --- //--------------------------------------------------------------------------------- // $Id: WallPartingModellor.java,v 1.1 2007/05/24 21:41:50 rimestad 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.ArrayList; import java.util.Collection; import java.util.LinkedList; import java.util.List; import java.util.Map; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.CoordinateSystem; 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.Selector; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; /** * A modellor for generating the elements in a wallsystem * create the specified offsets from the outling of the wallsystem * @author rimestad */ public class WallPartingModellor extends Modellor { private Space space; private Net net; private double minZ; private double maxZ; private double wallThickness = 0.055; /** * Constructor for modellor * @param walls the space where the wallsystem reside * @param net the net outlining the walls (can be auto calculated by sending null object) */ public WallPartingModellor(Space walls, Net net) { this.space = walls; if (net != null) { this.net = net; } else { this.net = calcNet(); } } private Net calcNet() { //find bottom surface and copy outer contour from it into a new net Net tmpNet = new Net("Contour"); space.getSurfaces().iterator().next().copy(tmpNet); return tmpNet; } private Map<Vertex, Vertex> findDirection() { return null; } /** * {@inheritDoc} */ @Override public void update(Object entity) { double wallHeight = findHeight(); Vertex toInnerOffset = null; Vertex fromInnerOffset = null; Vertex center = net.getSurfaces().iterator().next().center(); List<List<Edge>> straights = new LinkedList<List<Edge>>(); List<Edge> remainingEdges = new ArrayList<Edge>(net.getEdges()); while (!remainingEdges.isEmpty()) { List<Edge> parallel = remainingEdges.get(0).parrallelRun(); straights.add(parallel); remainingEdges.removeAll(parallel); } List<Surface> concretes = new ArrayList<Surface>(straights.size()); List<Surface> tiles = new ArrayList<Surface>(straights.size()); for (List<Edge> list : straights) { Edge outer = new Edge(list.get(0).getFrom(), list.get(list.size() - 1).getTo()); Edge outerCopy = outer.copy(); Edge tileCopy = outer.copy(); //Check if from corner should belong to outer Object info = outer.getFrom().getParameters().environment().get("Corner"); if (info != null) { if (info instanceof Selector) { Selector<String> s = (Selector<String>)info; String corner = s.getCurrentValue(); if (corner.equals("Left")) { Vertex delta = outer.getDirection(); delta.normalize(); delta.scale(wallThickness - 0.005); outerCopy.getFrom().move(delta.getX(), delta.getY(), delta.getZ()); delta.normalize(); delta.scale(wallThickness); tileCopy.getFrom().move(delta.getX(), delta.getY(), delta.getZ()); fromInnerOffset = null; } else { Vertex delta = outer.getDirection(); delta.normalize(); delta.scale(wallThickness); tileCopy.getFrom().move(delta.getX(), delta.getY(), delta.getZ()); if (corner.equals("Split")) { fromInnerOffset = delta; fromInnerOffset.normalize(); fromInnerOffset.scale(wallThickness - 0.005); } } } } //check if to corner should belong to outer info = outer.getTo().getParameters().environment().get("Corner"); if (info != null) { if (info instanceof Selector) { Selector<String> s = (Selector<String>)info; String corner = s.getCurrentValue(); if (corner.equals("Right")) { Vertex delta = outer.getDirection(); delta.normalize(); delta.scale(-1); delta.scale(wallThickness - 0.005); outerCopy.getTo().move(delta.getX(), delta.getY(), delta.getZ()); delta.normalize(); delta.scale(wallThickness); tileCopy.getTo().move(delta.getX(), delta.getY(), delta.getZ()); toInnerOffset = null; } else { Vertex delta = outer.getDirection(); delta.normalize(); delta.scale(-1); delta.scale(wallThickness); tileCopy.getTo().move(delta.getX(), delta.getY(), delta.getZ()); if (corner.equals("Split")) { toInnerOffset = delta; toInnerOffset.normalize(); toInnerOffset.scale(wallThickness - 0.005); } } } } //create a surface for the outline of the wall element //surface for concrete Edge inner = outerCopy.copy(); if (toInnerOffset != null) { inner.getTo().move(toInnerOffset); } if (fromInnerOffset != null) { inner.getFrom().move(fromInnerOffset); } Vertex inter = inner.intersection(center); Vertex dir = center.minus(inter); dir.normalize(); Vertex usedDir = dir.copy(); usedDir.scale(wallThickness - 0.005); inner.move(usedDir); Edge between1 = new Edge(outerCopy.getFrom(), inner.getFrom()); Edge between2 = new Edge(inner.getTo(), outerCopy.getTo()); Surface s = new Surface(inner, between1, outerCopy, between2); Space concrete = new Space("Concrete", Space.CONSTRUCTION, Space.ELEMENT_LEVEL, true); space.add(concrete); if (s.normal().getZ() == 1.0) { s.setFrontDomain(concrete); } else { s.setBackDomain(concrete); } concretes.add(s); //surface for tiles dir.normalize(); dir.scale(wallThickness - 0.005); tileCopy.move(dir); Edge inner2 = tileCopy.copy(); dir.normalize(); dir.scale(0.005); inner2.move(dir); between1 = new Edge(tileCopy.getFrom(), inner2.getFrom()); between2 = new Edge(inner2.getTo(), tileCopy.getTo()); s = new Surface(inner2, between1, tileCopy, between2); Space tile = new Space("Tile", Space.CONSTRUCTION, Space.ELEMENT_LEVEL, true); space.add(tile); if (s.normal().getZ() == 1.0) { s.setFrontDomain(tile); } else { s.setBackDomain(tile); } tiles.add(s); } CoordinateSystem cs = Project.getInstance().getActiveCoordinateSystem().copy(); cs.move(0, 0, minZ); Geometry.unTranslateGeometry(concretes, cs); Geometry.unTranslateGeometry(tiles, cs); for (Surface s : concretes) { s.setEdges(space.insert(s.getEdges())); space.add(s); } for (Surface s : tiles) { s.setEdges(space.insert(s.getEdges())); space.add(s); } //split edges at crossings Collection<Vertex> verts = space.getVertices(); List<Edge> edges = new LinkedList<Edge>(space.getEdges()); while (!edges.isEmpty()) { Edge e = edges.get(0); for (Vertex v : verts) { if (!e.contains(v) && e.coincides(v) && !e.getFrom().equalEps(v) && !e.getTo().equalEps(v)) { Vertex intersection = e.intersection(v); edges.addAll(e.split(intersection)); break; } } edges.remove(0); } Collection<Surface> sides = new ArrayList<Surface>(5); Collection<Surface> bottoms = new ArrayList<Surface>(space.getSurfaces()); // extrude wall parting up for (Surface s : bottoms) { double dist = wallHeight; if (s.getFrontDomain() == space.getEmpty()) { dist *= -1; } sides.add(s.extrusion(dist, sides)); for (Surface side : sides) { space.insert(side); } sides.clear(); } } private double findHeight() { minZ = 0; maxZ = 0; for (Vertex v : space.getVertices()) { if (v.getZ() < minZ) { minZ = v.getZ(); } if (v.getZ() > maxZ) { maxZ = v.getZ(); } } return maxZ - minZ; } /** * {@inheritDoc} */ @Override public void delete() { // TODO Auto-generated method stub } /** * {@inheritDoc} */ @Override public void getAttributes(List<Attribute> l) { super.getAttributes(); } /** * {@inheritDoc} */ @Override public void getSubContent(Map<String, Object> c) { } /** * {@inheritDoc} */ @Override public int getUseableLevel() { return Space.ELEMENT_LEVEL; } /** * {@inheritDoc} */ @Override public Modellor newInstance(Space s) { return new WallPartingModellor(s, null); } /** * {@inheritDoc} */ @Override public void setAttributes(Map<String, Attribute> m) { } /** * {@inheritDoc} */ @Override public void setSubContent(Map<String, Object> c) { } } Index: ModelBathModellor2.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/modellor/ModelBathModellor2.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ModelBathModellor2.java 24 May 2007 10:55:42 -0000 1.3 --- ModelBathModellor2.java 24 May 2007 21:41:50 -0000 1.4 *************** *** 726,736 **** @Override public void getAttributes(List<Attribute> l) { ! l.add(new Attribute("Length", length, true)); ! l.add(new Attribute("Width", width, true)); ! l.add(new Attribute("Height", height, true)); l.add(new Attribute("Floor thickness", floorThickness, true)); l.add(new Attribute("Wall thickness", wallThickness, true)); l.add(new Attribute("Ceiling thickness", ceilingThickness, true)); ! l.add(new Attribute("Door height", floorThickness, true)); l.add(new Attribute("Window offset", windowOffset, true)); l.add(new Attribute("Window height", windowHeight, true)); --- 726,736 ---- @Override public void getAttributes(List<Attribute> l) { ! l.add(new Attribute("Length", length, false)); ! l.add(new Attribute("Width", width, false)); ! l.add(new Attribute("Height", height, false)); l.add(new Attribute("Floor thickness", floorThickness, true)); l.add(new Attribute("Wall thickness", wallThickness, true)); l.add(new Attribute("Ceiling thickness", ceilingThickness, true)); ! l.add(new Attribute("Door height", doorHeight, true)); l.add(new Attribute("Window offset", windowOffset, true)); l.add(new Attribute("Window height", windowHeight, true)); |
From: rimestad <rim...@us...> - 2007-05-24 11:00:15
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18811/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: changed the string printing for the level to be generated only at one point in the code and made i more correct Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.145 retrieving revision 1.146 diff -C2 -d -r1.145 -r1.146 *** Space.java 20 May 2007 10:28:52 -0000 1.145 --- Space.java 24 May 2007 11:00:11 -0000 1.146 *************** *** 1627,1630 **** --- 1627,1633 ---- return "Instance"; } + if (isUnion()) { + return "Union"; + } String res = ""; switch (type) { *************** *** 1636,1657 **** break; } ! switch (level) { ! case SPACE_LEVEL: ! res = res.concat("Space"); ! break; ! case ELEMENT_LEVEL: ! res = res.concat("Element"); ! break; ! case PART_LEVEL: ! res = res.concat("Part"); ! break; ! case NET_LEVEL: ! res = "B-net"; ! break; ! } ! if (isUnion()) { ! res = res.concat("(Union)"); ! } ! return res; } --- 1639,1643 ---- break; } ! return res.concat(Space.levelToString(level)); } *************** *** 1682,1685 **** --- 1668,1674 ---- break; } + if (isUnion()) { + return res + " Union"; + } if (getClassification() != null) { return getClassification().toString() + " - " + res + id; *************** *** 2650,2669 **** if (isUnion()) { return "Union"; - } - if (getLevel() == Space.PROJECT_LEVEL) { - return "Project"; - } else if (getLevel() == Space.SPACE_LEVEL) { - return "Space"; - } else if (getLevel() == Space.ELEMENT_LEVEL) { - return "Element"; - } else if (getLevel() == Space.PART_LEVEL) { - return "Part"; - } else if (getLevel() == Space.NET_LEVEL) { - return "Net"; - } else if (getLevel() == Space.NET_LEVEL + 1) { - return "Net-void"; } else { ! log.error("Not a valid level"); ! return ""; } } --- 2639,2644 ---- if (isUnion()) { return "Union"; } else { ! return levelToString(getLevel()); } } *************** *** 2941,2950 **** /** * A method the can convert a level of a space to the string rep for it ! * @param level2 the level * @return the sting representation */ ! public static String levelToSting(int level2) { String res = ""; ! switch (level2) { case PROJECT_LEVEL: res += "Project"; --- 2916,2925 ---- /** * A method the can convert a level of a space to the string rep for it ! * @param level the level * @return the sting representation */ ! public static String levelToString(int level) { String res = ""; ! switch (level) { case PROJECT_LEVEL: res += "Project"; *************** *** 2962,2965 **** --- 2937,2943 ---- res += "Net"; break; + case NET_LEVEL + 1: + res += "Net-void"; + break; default: break; |
From: rimestad <rim...@us...> - 2007-05-24 10:58:13
|
Update of /cvsroot/bprocessor//gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18341/src/net/sourceforge/bprocessor/gui/actions Modified Files: EntitiesMenuAction.java Log Message: some better type handling Index: EntitiesMenuAction.java =================================================================== RCS file: /cvsroot/bprocessor//gui/src/net/sourceforge/bprocessor/gui/actions/EntitiesMenuAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EntitiesMenuAction.java 26 Sep 2006 09:50:54 -0000 1.1 --- EntitiesMenuAction.java 24 May 2007 10:58:12 -0000 1.2 *************** *** 11,14 **** --- 11,16 ---- import javax.swing.AbstractAction; + import net.sourceforge.bprocessor.model.Entity; + /** *************** *** 17,21 **** public abstract class EntitiesMenuAction extends AbstractAction { /** The entity */ ! protected Collection entities; /** --- 19,23 ---- public abstract class EntitiesMenuAction extends AbstractAction { /** The entity */ ! protected Collection<? extends Entity> entities; /** *************** *** 24,28 **** * @param name the name of the action */ ! public EntitiesMenuAction(Collection ent, String name) { super(name); this.entities = ent; --- 26,30 ---- * @param name the name of the action */ ! public EntitiesMenuAction(Collection<? extends Entity> ent, String name) { super(name); this.entities = ent; |