bprocessor-commit Mailing List for B-processor (Page 41)
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-11-13 12:19:19
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22651/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: renamed Vertex.scale to scaleInPlace Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.257 retrieving revision 1.258 diff -C2 -d -r1.257 -r1.258 *** View.java 12 Nov 2007 10:55:48 -0000 1.257 --- View.java 13 Nov 2007 12:19:22 -0000 1.258 *************** *** 1427,1431 **** if (!edge.getStrippled()) { Vertex m = edge.getFrom().add(edge.getTo()); ! m.scale(0.5); Vertex projected = transformation.project(m); double dx = x - projected.getX(); --- 1427,1431 ---- if (!edge.getStrippled()) { Vertex m = edge.getFrom().add(edge.getTo()); ! m.scaleInPlace(0.5); Vertex projected = transformation.project(m); double dx = x - projected.getX(); *************** *** 1719,1723 **** ray = transformation.unProject(ray); rayDir = ray.getTo().minus(ray.getFrom()); ! normal.scale(1 / normal.length()); return rayDir.dot(normal) < 0; } --- 1719,1723 ---- ray = transformation.unProject(ray); rayDir = ray.getTo().minus(ray.getFrom()); ! normal.scaleInPlace(1 / normal.length()); return rayDir.dot(normal) < 0; } |
From: Michael L. <he...@us...> - 2007-11-13 12:19:14
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22556/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java FacadeModellor.java Log Message: renamed Vertex.scale to scaleInPlace Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** NetFacadeModellor.java 5 Nov 2007 10:18:54 -0000 1.40 --- NetFacadeModellor.java 13 Nov 2007 12:19:10 -0000 1.41 *************** *** 421,425 **** Vertex out = front.normal(); if (front.getBackDomain() == space) { ! out.scale(-1); } Set<Surface> frame1 = generateFrame(cut1, field.getEdges(), out); --- 421,425 ---- Vertex out = front.normal(); if (front.getBackDomain() == space) { ! out.scaleInPlace(-1); } Set<Surface> frame1 = generateFrame(cut1, field.getEdges(), out); *************** *** 821,825 **** angleV = local.unTranslate(angleV); Plane plane = new Plane(angleV.getX(), angleV.getY(), angleV.getZ(), shared); ! j.scale(-1); Collection<Surface> extrusion = Edge.extrude(cutEdges, j, plane); return extrusion; --- 821,825 ---- angleV = local.unTranslate(angleV); Plane plane = new Plane(angleV.getX(), angleV.getY(), angleV.getZ(), shared); ! j.scaleInPlace(-1); Collection<Surface> extrusion = Edge.extrude(cutEdges, j, plane); return extrusion; Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** FacadeModellor.java 12 Nov 2007 08:08:23 -0000 1.35 --- FacadeModellor.java 13 Nov 2007 12:19:11 -0000 1.36 *************** *** 439,443 **** offset = horDir.copy(); for (int i = 0; i < vertPosts; i++) { ! offset.scale(lengthV / offset.length()); Constructor l = new Line(cross.add(offset), vertDir.copy(), true, true); lengthV += intervalV; --- 439,443 ---- offset = horDir.copy(); for (int i = 0; i < vertPosts; i++) { ! offset.scaleInPlace(lengthV / offset.length()); Constructor l = new Line(cross.add(offset), vertDir.copy(), true, true); lengthV += intervalV; *************** *** 450,454 **** offset = vertDir.copy(); for (int i = 0; i < horPosts; i++) { ! offset.scale(lengthH / offset.length()); Line l = new Line(cross.add(offset), horDir.copy(), true, true); lengthH += (intervalH); --- 450,454 ---- offset = vertDir.copy(); for (int i = 0; i < horPosts; i++) { ! offset.scaleInPlace(lengthH / offset.length()); Line l = new Line(cross.add(offset), horDir.copy(), true, true); lengthH += (intervalH); |
From: Michael L. <he...@us...> - 2007-11-13 11:07:00
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24149/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: x = red, y = green, z = blue Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** Display.java 12 Nov 2007 21:16:26 -0000 1.54 --- Display.java 13 Nov 2007 11:06:58 -0000 1.55 *************** *** 637,642 **** Line zaxis = new Line(origin, n); zaxis.setEditable(system.isEditable()); ! paint(xaxis, green); ! paint(yaxis, red); paint(zaxis, blue); } --- 637,642 ---- Line zaxis = new Line(origin, n); zaxis.setEditable(system.isEditable()); ! paint(xaxis, red); ! paint(yaxis, green); paint(zaxis, blue); } |
From: Michael L. <he...@us...> - 2007-11-13 10:48:37
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16022/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: removed some hibernate comments Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.206 retrieving revision 1.207 diff -C2 -d -r1.206 -r1.207 *** Space.java 12 Nov 2007 14:15:22 -0000 1.206 --- Space.java 13 Nov 2007 10:48:39 -0000 1.207 *************** *** 26,35 **** /** ! * The space ! * @hibernate.joined-subclass ! * table="SPACE" ! * lazy="false" ! * @hibernate.key ! * column="DOMAIN_ID" */ public class Space extends Geometric implements Parametric { --- 26,30 ---- /** ! * Space */ public class Space extends Geometric implements Parametric { *************** *** 145,151 **** if (fl != null) { fl.add(current); - } else { - log.error(from + " werent in the space but were part of edge " + current + - " in space " + this); } Vertex to = current.getTo(); --- 140,143 ---- *************** *** 361,365 **** * Set the description * @return description The description of the space - * @hibernate.property */ public Description getDescription() { --- 353,356 ---- *************** *** 630,635 **** if (tempedge != null) { tmp.add(tempedge); - } else { - log.warn("Edge were very short " + edge); } } --- 621,624 ---- *************** *** 958,967 **** * Get the surfaces * @return The surfaces - * @hibernate.set - * lazy="false" - * @hibernate.key - * column="DOMAIN_ID" - * @hibernate.many-to-many - * class="net.sourceforge.bprocessor.model.Surface" */ public Set<Surface> getEnvelope() { --- 947,950 ---- *************** *** 2839,2841 **** --- 2822,2832 ---- } } + + /** + * Info + * @param object Object + */ + public static void info(Object object) { + log.info(object); + } } |
From: Michael L. <he...@us...> - 2007-11-13 10:04:33
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29804/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Removed some hibernate comments Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.204 retrieving revision 1.205 diff -C2 -d -r1.204 -r1.205 *** Surface.java 13 Nov 2007 09:46:27 -0000 1.204 --- Surface.java 13 Nov 2007 10:04:29 -0000 1.205 *************** *** 191,195 **** * Get the name * @return The name - * @hibernate.property */ public String getName() { --- 191,194 ---- *************** *** 206,210 **** * Is the surface a constructor * @return True if constructor; otherwise false - * @hibernate.property */ public boolean getConstructor() { --- 205,208 ---- *************** *** 223,234 **** * Get the edges * @return The edges - * @hibernate.list - * lazy="false" - * @hibernate.key - * column="SURFACE_ID" - * @hibernate.collection-index - * column="SORT_ORDER" - * @hibernate.many-to-many - * class="net.sourceforge.bprocessor.model.Edge" */ public List<Edge> getEdges() { --- 221,224 ---- *************** *** 535,544 **** * Get the hole surfaces * @return The hole surfaces - * @hibernate.set - * lazy="false" - * @hibernate.key - * column="SURFACE_ID" - * @hibernate.many-to-many - * class="net.sourceforge.bprocessor.model.Surface" */ public Collection<Surface> getHoles() { --- 525,528 ---- *************** *** 1303,1309 **** * Get the material on the backside of the surface * @return the backmaterial - * @hibernate.one-to-one - * column="BACK_MATERIAL_ID" - * class="net.sourceforge.bprocessor.model.Material" */ public Material getBackMaterial() { --- 1287,1290 ---- *************** *** 1323,1329 **** * Get the material on the frontside of the surface * @return the frontmaterial - * @hibernate.one-to-one - * column="FRONT_MATERIAL_ID" - * class="net.sourceforge.bprocessor.model.Material" */ public Material getFrontMaterial() { --- 1304,1307 ---- *************** *** 1343,1349 **** * Get the domain behind the surface * @return the backdomain - * @hibernate.many-to-one - * column="BACK_DOMAIN_ID" - * class="net.sourceforge.bprocessor.model.Domain" */ public Space getBackDomain() { --- 1321,1324 ---- *************** *** 1386,1392 **** * Get the domain in front of the surface * @return the frontdomain - * @hibernate.many-to-one - * column="FRONT_DOMAIN_ID" - * class="net.sourceforge.bprocessor.model.Domain" */ public Space getFrontDomain() { --- 1361,1364 ---- |
From: Michael L. <he...@us...> - 2007-11-13 09:46:25
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22153/src/net/sourceforge/bprocessor/model Modified Files: Edge.java ClippingPlane.java Surface.java Point.java CoordinateSystem.java Log Message: Removed unused declarations of canMove Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClippingPlane.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ClippingPlane.java 18 Jul 2007 12:24:04 -0000 1.21 --- ClippingPlane.java 13 Nov 2007 09:46:27 -0000 1.22 *************** *** 327,335 **** /** {@inheritDoc} */ - public Vertex canMove(double x, double y, double z, Collection entities) { - return (new Vertex(x, y, z).projectOnto(getPlane().normal())); - } - - /** {@inheritDoc} */ public List<Attribute> getAttributes() { ArrayList<Attribute> res = new ArrayList<Attribute>(); --- 327,330 ---- Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.203 retrieving revision 1.204 diff -C2 -d -r1.203 -r1.204 *** Surface.java 12 Nov 2007 20:11:51 -0000 1.203 --- Surface.java 13 Nov 2007 09:46:27 -0000 1.204 *************** *** 1250,1265 **** } } - - /** {@inheritDoc} */ - public Vertex canMove(double x, double y, double z, Collection entities) { - Vertex dir = new Vertex(x, y, z); - if (this.getExterior() != null) { - if (!entities.contains(this.getExterior())) { - // Restricted to be in plane of the exterior surface - dir = getExterior().plane().project(dir); - } - } - return dir; - } /** --- 1250,1253 ---- Index: Point.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Point.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Point.java 18 Jul 2007 13:35:38 -0000 1.18 --- Point.java 13 Nov 2007 09:46:28 -0000 1.19 *************** *** 8,12 **** import java.util.ArrayList; - import java.util.Collection; import java.util.List; --- 8,11 ---- *************** *** 30,39 **** super(); } - - /** {@inheritDoc} */ - public Vertex canMove(double x, double y, double z, Collection entities) { - // TODO Think it through - return new Vertex(x, y, z); - } /** {@inheritDoc} */ --- 29,32 ---- Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** CoordinateSystem.java 13 Nov 2007 07:32:42 -0000 1.62 --- CoordinateSystem.java 13 Nov 2007 09:46:28 -0000 1.63 *************** *** 241,250 **** } - /** {@inheritDoc} */ - public Vertex canMove(double x, double y, double z, Collection entities) { - // TODO Think it through - return new Vertex(x, y, z); - } - /** * Computes the box-product of the vectors of this CoordinateSystem: --- 241,244 ---- Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** Edge.java 9 Nov 2007 13:39:09 -0000 1.99 --- Edge.java 13 Nov 2007 09:46:27 -0000 1.100 *************** *** 379,388 **** } - /** {@inheritDoc} */ - public Vertex canMove(double x, double y, double z, Collection entities) { - // TODO Think it through - return new Vertex(x, y, z); - } - /** * Find the intersection between this Edge and the Other. --- 379,382 ---- |
From: Michael L. <he...@us...> - 2007-11-13 09:42:22
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20513/src/net/sourceforge/bprocessor/model Modified Files: Vertex.java Log Message: fixed stuff in vertex Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** Vertex.java 22 Oct 2007 19:26:32 -0000 1.66 --- Vertex.java 13 Nov 2007 09:42:24 -0000 1.67 *************** *** 18,33 **** /** ! * The vertex ! * @hibernate.class ! * table="VERTEX" ! * lazy="false" ! * @hibernate.cache ! * usage="read-write" */ public class Vertex extends Geometric implements Parametric { - /** Default */ - private static final long serialVersionUID = 1L; - - /** The logger */ private static Logger log = Logger.getLogger(Vertex.class); --- 18,24 ---- /** ! * Vertex */ public class Vertex extends Geometric implements Parametric { private static Logger log = Logger.getLogger(Vertex.class); *************** *** 84,94 **** */ public Vertex(double[] v) { ! if (v.length == 3) { ! setX(v[0]); ! setY(v[1]); ! setZ(v[2]); ! } else { ! log.error("Wrong amount of arguments were " + v.length + " should be 3"); ! } } --- 75,81 ---- */ public Vertex(double[] v) { ! setX(v[0]); ! setY(v[1]); ! setZ(v[2]); } *************** *** 156,173 **** /** - * Set the placement of this to the given vertex - * @param other Vertex - */ - public void set(Vertex other) { - if (other != null) { - setX(other.getX()); - setY(other.getY()); - setZ(other.getZ()); - } else { - log.error(this + " were set with a null vertex as argument"); - } - } - - /** * Set the z coordinate * @param z The z coordinate --- 143,146 ---- *************** *** 178,181 **** --- 151,164 ---- /** + * Set the placement of this to the given vertex + * @param other Vertex + */ + public void set(Vertex other) { + setX(other.getX()); + setY(other.getY()); + setZ(other.getZ()); + } + + /** * Return x, y, z in a double array * @return Values *************** *** 298,309 **** */ public Vertex cross(Vertex v) { ! if (v != null) { ! Vertex cross = new Vertex(); ! cross.setX(this.getY() * v.getZ() - v.getY() * this.getZ()); ! cross.setY(this.getZ() * v.getX() - v.getZ() * this.getX()); ! cross.setZ(this.getX() * v.getY() - v.getX() * this.getY()); ! return cross; ! } ! return null; } --- 281,289 ---- */ public Vertex cross(Vertex v) { ! Vertex cross = new Vertex(); ! cross.setX(this.getY() * v.getZ() - v.getY() * this.getZ()); ! cross.setY(this.getZ() * v.getX() - v.getZ() * this.getX()); ! cross.setZ(this.getX() * v.getY() - v.getX() * this.getY()); ! return cross; } *************** *** 571,579 **** return null; } ! ! /** {@inheritDoc} */ ! public Vertex canMove(double x, double y, double z, Collection entities) { ! // TODO Think it through ! return new Vertex(x, y, z); } } --- 551,561 ---- return null; } ! ! /** ! * Info ! * @param object Object ! */ ! public static void info(Object object) { ! log.info(object); } } |
From: Michael L. <he...@us...> - 2007-11-13 09:03:46
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3859/src/net/sourceforge/bprocessor/model Modified Files: Command.java Log Message: Creates cube in local coordinatesystem Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Command.java 13 Nov 2007 07:32:42 -0000 1.26 --- Command.java 13 Nov 2007 09:03:41 -0000 1.27 *************** *** 646,656 **** double h = parameters.getDouble("height"); double d = parameters.getDouble("depth"); double x = -w / 2; double y = -h / 2; double z = -d / 2; ! Vertex v0 = new Vertex(x, y, z); ! Vertex v1 = new Vertex(x + w, y, z); ! Vertex v2 = new Vertex(x + w, y + h, z); ! Vertex v3 = new Vertex(x, y + h, z); Edge e0 = new Edge(v0, v1); --- 646,657 ---- double h = parameters.getDouble("height"); double d = parameters.getDouble("depth"); + CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); double x = -w / 2; double y = -h / 2; double z = -d / 2; ! Vertex v0 = system.unTranslate(new Vertex(x, y, z)); ! Vertex v1 = system.unTranslate(new Vertex(x + w, y, z)); ! Vertex v2 = system.unTranslate(new Vertex(x + w, y + h, z)); ! Vertex v3 = system.unTranslate(new Vertex(x, y + h, z)); Edge e0 = new Edge(v0, v1); |
From: rimestad <rim...@us...> - 2007-11-13 08:47:19
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29825/src/net/sourceforge/bprocessor/model Modified Files: Persistence.java Log Message: lib load fixed Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** Persistence.java 12 Nov 2007 19:17:32 -0000 1.57 --- Persistence.java 13 Nov 2007 08:47:09 -0000 1.58 *************** *** 1628,1632 **** for (int i = 0; i < libs.length; i++) { File f = libs[i]; ! library.addAll(internalizeLibObjs(f, map, xmls)); } } --- 1628,1634 ---- for (int i = 0; i < libs.length; i++) { File f = libs[i]; ! if (!f.isDirectory() && f.getName().endsWith(".bpl")) { ! library.addAll(internalizeLibObjs(f, map, xmls)); ! } } } |
From: Michael L. <he...@us...> - 2007-11-13 07:32:40
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32504/src/net/sourceforge/bprocessor/model Modified Files: Command.java CoordinateSystem.java Log Message: An experiment with scaling handles that does not work Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Command.java 12 Nov 2007 14:15:22 -0000 1.25 --- Command.java 13 Nov 2007 07:32:42 -0000 1.26 *************** *** 710,713 **** --- 710,714 ---- Vertex v2 = locals.get(i); v1.set(v2); + v1.update(); } } Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** CoordinateSystem.java 12 Nov 2007 14:45:47 -0000 1.61 --- CoordinateSystem.java 13 Nov 2007 07:32:42 -0000 1.62 *************** *** 14,17 **** --- 14,18 ---- import java.util.List; import java.util.Map; + import java.util.Set; import org.apache.log4j.Logger; *************** *** 231,234 **** --- 232,243 ---- } + /** + * {@inheritDoc} + */ + public Set<Vertex> collect() { + Set<Vertex> result = super.collect(); + // result.addAll(handles(1.0)); + return result; + } /** {@inheritDoc} */ *************** *** 719,725 **** list.add(new Tip(i, distance)); list.add(new Tip(j, distance)); ! if (!onlyPlane()) { ! list.add(new Tip(n, distance)); ! } return list; } --- 728,732 ---- list.add(new Tip(i, distance)); list.add(new Tip(j, distance)); ! list.add(new Tip(n, distance)); return list; } *************** *** 868,872 **** public void update() { vector.set(this.minus(getOrigin())); - CoordinateSystem.this.normalize(vector); } --- 875,878 ---- |
From: Michael L. <he...@us...> - 2007-11-12 21:16:23
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30799/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: Grid drawing according to active coordinate-system Creates empty library when library-loading fails Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** Display.java 12 Nov 2007 19:20:18 -0000 1.53 --- Display.java 12 Nov 2007 21:16:26 -0000 1.54 *************** *** 1159,1227 **** } private static void draw(Grid grid) { Vertex origin = grid.origin(); double size = grid.size(); double delta = grid.delta(); ! gl.glColor3fv(grey, 0); gl.glLineWidth(1.0f); - { - double x = origin.getX() - size / 2; - double y = origin.getY(); - double z = origin.getZ(); - gl.glBegin(GL.GL_LINE_STRIP); - gl.glVertex3d(x, y, z); - gl.glVertex3d(x + size, y, z); - gl.glEnd(); - int n = (int) Math.floor((size / 2) / delta); - y = origin.getY(); - for (int i = 0; i < n; i++) { - y += delta; - gl.glBegin(GL.GL_LINE_STRIP); - gl.glVertex3d(x, y, z); - gl.glVertex3d(x + size, y, z); - gl.glEnd(); - } - y = origin.getY(); - for (int i = 0; i < n; i++) { - y -= delta; - gl.glBegin(GL.GL_LINE_STRIP); - gl.glVertex3d(x, y, z); - gl.glVertex3d(x + size, y, z); - gl.glEnd(); - } - } ! { ! double x = origin.getX(); ! double y = origin.getY() - size / 2; ! double z = origin.getZ(); ! gl.glBegin(GL.GL_LINE_STRIP); ! gl.glVertex3d(x, y, z); ! gl.glVertex3d(x, y + size, z); ! gl.glEnd(); ! ! int n = (int) Math.floor((size / 2) / delta); ! x = origin.getX(); ! for (int i = 0; i < n; i++) { ! x += delta; ! gl.glBegin(GL.GL_LINE_STRIP); ! gl.glVertex3d(x, y, z); ! gl.glVertex3d(x, y + size, z); ! gl.glEnd(); ! } ! x = origin.getX(); ! for (int i = 0; i < n; i++) { ! x -= delta; ! gl.glBegin(GL.GL_LINE_STRIP); ! gl.glVertex3d(x, y, z); ! gl.glVertex3d(x, y + size, z); ! gl.glEnd(); ! } ! } } - /** * --- 1159,1200 ---- } + private static void draw(Grid grid) { Vertex origin = grid.origin(); double size = grid.size(); double delta = grid.delta(); ! CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); ! Vertex v = system.getI(); ! Vertex u = system.getJ(); ! int n = (int) Math.floor((size / 2) / delta); gl.glColor3fv(grey, 0); gl.glLineWidth(1.0f); ! for (int i = 0; i < n; i++) { ! Vertex o = origin.add(u.copy(i * delta)); ! Line line = new Line(o, v); ! Edge edge = line.edge(size / 2); ! draw(edge); ! } ! for (int i = 1; i < n; i++) { ! Vertex o = origin.add(u.copy(-i * delta)); ! Line line = new Line(o, v); ! Edge edge = line.edge(size / 2); ! draw(edge); ! } ! for (int i = 0; i < n; i++) { ! Vertex o = origin.add(v.copy(i * delta)); ! Line line = new Line(o, u); ! Edge edge = line.edge(size / 2); ! draw(edge); ! } ! for (int i = 1; i < n; i++) { ! Vertex o = origin.add(v.copy(-i * delta)); ! Line line = new Line(o, u); ! Edge edge = line.edge(size / 2); ! draw(edge); } } /** * |
From: Michael L. <he...@us...> - 2007-11-12 21:16:20
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30788/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Grid drawing according to active coordinate-system Creates empty library when library-loading fails Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.141 retrieving revision 1.142 diff -C2 -d -r1.141 -r1.142 *** Project.java 12 Nov 2007 19:17:32 -0000 1.141 --- Project.java 12 Nov 2007 21:16:22 -0000 1.142 *************** *** 135,142 **** functionalClas = (Classification)loaded[1]; classificationTypes = (Collection<ClassificationType>)loaded[2]; ! library = Persistence.loadLibrary(); ! /*Map<String, ClassificationType> typeMap = ClassificationFileReader.loadTypes(""); ! constructionClas = ClassificationFileReader.loadClassification(true, "", typeMap); ! functionalClas = ClassificationFileReader.loadClassification(false, "", typeMap);*/ } catch (Exception e) { log.error("Error loading classification " + e); --- 135,143 ---- functionalClas = (Classification)loaded[1]; classificationTypes = (Collection<ClassificationType>)loaded[2]; ! try { ! library = Persistence.loadLibrary(); ! } catch (Exception e) { ! library = new LinkedList(); ! } } catch (Exception e) { log.error("Error loading classification " + e); |
From: Michael L. <he...@us...> - 2007-11-12 20:11:53
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3367/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: fixed normal calculation bug Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.202 retrieving revision 1.203 diff -C2 -d -r1.202 -r1.203 *** Surface.java 12 Nov 2007 13:29:35 -0000 1.202 --- Surface.java 12 Nov 2007 20:11:51 -0000 1.203 *************** *** 1512,1524 **** public Vertex normal() { ! return normal1(edges); } /** ! * USE normal for the normal ! * @param edges The collection of edges to calculate the normal from * @return value */ ! public static Vertex normal0(Collection<Edge> edges) { int size = edges.size(); Edge[] e = new Edge[size]; --- 1512,1523 ---- public Vertex normal() { ! return normalOf(edges); } /** ! * @param edges edges * @return value */ ! public static Vertex normalOf(Collection<Edge> edges) { int size = edges.size(); Edge[] e = new Edge[size]; *************** *** 1563,1567 **** } } - double[] coord; if (y > x) { --- 1562,1565 ---- *************** *** 1587,1687 **** } ! int inx0 = inx1 == 0 ? e.length - 1 : inx1 - 1; ! int inx2 = (inx1 + 1) % e.length; ! ! for (int i = 0; i < e.length; i++) { ! if (coord[inx1] < coord[(inx2 + i) % e.length]) { ! inx2 = (inx2 + i) % e.length; ! break; ! } ! } ! ! vx = xs[inx1] - xs[inx0]; ! vy = ys[inx1] - ys[inx0]; ! vz = zs[inx1] - zs[inx0]; ! ! double ux = xs[inx2] - xs[inx1]; ! double uy = ys[inx2] - ys[inx1]; ! double uz = zs[inx2] - zs[inx1]; ! ! x = vy * uz - vz * uy; ! y = vz * ux - vx * uz; ! z = vx * uy - vy * ux; ! double length = Math.sqrt(x * x + y * y + z * z); ! x = x / length; ! y = y / length; ! z = z / length; ! return new Vertex(x, y, z); ! } ! ! /** ! * @param edges edges ! * @return value ! */ ! public static Vertex normal1(Collection<Edge> edges) { ! int size = edges.size(); ! Edge[] e = new Edge[size]; ! double[] xs = new double[size]; ! double[] ys = new double[size]; ! double[] zs = new double[size]; ! final double eps = 0.0000000001; ! edges.toArray(e); ! Edge e0 = e[0]; ! Edge e1 = e[1]; ! Vertex current; ! if (e0.to == e1.from || e0.to == e1.to) { ! current = e0.from; ! } else { ! current = e0.to; ! } ! for (int i = 0; i < e.length; i++) { ! xs[i] = current.x; ! ys[i] = current.y; ! zs[i] = current.z; ! if (current == e[i].from) { ! current = e[i].to; ! } else { ! current = e[i].from; ! } ! } ! double vx = xs[1] - xs[0]; ! double vy = ys[1] - ys[0]; ! double vz = zs[1] - zs[0]; ! double x = 0.0; ! double y = 0.0; ! double z = 0.0; ! for (int i = 2; i < e.length; i++) { ! double ux = xs[i] - xs[i - 1]; ! double uy = ys[i] - ys[i - 1]; ! double uz = zs[i] - zs[i - 1]; ! x = Math.abs(vy * uz - vz * uy); ! y = Math.abs(vz * ux - vx * uz); ! z = Math.abs(vx * uy - vy * ux); ! if (x > eps || y > eps || z > eps) { ! break; ! } ! } ! double[] coord; ! if (y > x) { ! if (y > z) { ! coord = xs; ! } else { ! coord = ys; ! } ! } else { ! if (x > z) { ! coord = zs; ! } else { ! coord = ys; ! } ! } ! double min = Double.MAX_VALUE; ! int inx1 = -1; for (int i = 0; i < e.length; i++) { if (coord[i] <= min) { inx1 = i; min = coord[i]; } } int inx0 = inx1 == 0 ? e.length - 1 : inx1 - 1; int inx2 = (inx1 + 1) % e.length; --- 1585,1598 ---- } ! search: for (int i = 0; i < e.length; i++) { if (coord[i] <= min) { inx1 = i; min = coord[i]; + } else { + break search; } } + int inx0 = inx1 == 0 ? e.length - 1 : inx1 - 1; int inx2 = (inx1 + 1) % e.length; |
From: Michael L. <he...@us...> - 2007-11-12 20:11:52
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3379/src/net/sourceforge/bprocessor/gl/tool Modified Files: OffsetTool.java Log Message: fixed normal calculation bug Index: OffsetTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** OffsetTool.java 9 Nov 2007 09:45:32 -0000 1.21 --- OffsetTool.java 12 Nov 2007 20:11:55 -0000 1.22 *************** *** 453,457 **** } } else { ! n = Surface.normal0(finalEdgeList); } if (n != null) { --- 453,457 ---- } } else { ! n = Surface.normalOf(finalEdgeList); } if (n != null) { |
From: rimestad <rim...@us...> - 2007-11-12 19:21:14
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13305/src/net/sourceforge/bprocessor/gui/treeview Modified Files: LibraryTreeView.java GenericTreeView.java Log Message: library and catalog shows 2 different things Index: LibraryTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/LibraryTreeView.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LibraryTreeView.java 12 Nov 2007 14:15:28 -0000 1.2 --- LibraryTreeView.java 12 Nov 2007 19:20:57 -0000 1.3 *************** *** 20,24 **** super(); root.removeAllChildren(); ! root.add(new CatalogContainer("Unions", Project.getInstance().getCatalogObjects())); model.nodeStructureChanged(root); } --- 20,24 ---- super(); root.removeAllChildren(); ! root.add(new CatalogContainer("Unions", Project.getLibraryObjects())); model.nodeStructureChanged(root); } *************** *** 27,31 **** @Override public void update() { ! ((GenericNode)root.getChildAt(0)).update(Project.getInstance().getCatalogObjects()); } } --- 27,31 ---- @Override public void update() { ! ((GenericNode)root.getChildAt(0)).update(Project.getInstance().getLibraryObjects()); } } Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.120 retrieving revision 1.121 diff -C2 -d -r1.120 -r1.121 *** GenericTreeView.java 12 Nov 2007 14:15:28 -0000 1.120 --- GenericTreeView.java 12 Nov 2007 19:21:01 -0000 1.121 *************** *** 63,67 **** import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.gui.PopupMenu; ! import net.sourceforge.bprocessor.gui.actions.GeometricMenuAction; import net.sourceforge.bprocessor.gui.attrview.AttributeView; --- 63,67 ---- import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.gui.PopupMenu; ! import net.sourceforge.bprocessor.gui.actions.CollectionMenuAction; import net.sourceforge.bprocessor.gui.attrview.AttributeView; *************** *** 1167,1171 **** * @param content the children for the node */ ! public CatalogContainer(String name, List<LibraryObj> content) { super(name); for (LibraryObj l : content) { --- 1167,1171 ---- * @param content the children for the node */ ! public CatalogContainer(String name, Collection<LibraryObj> content) { super(name); for (LibraryObj l : content) { *************** *** 1225,1237 **** public JPopupMenu menu() { JPopupMenu menu = new JPopupMenu(); ! Collection<Space> spaces = new LinkedList<Space>(); ! spaces.add(((LibraryObj)getUserObject()).getSpace()); ! menu.add(new GeometricMenuAction(spaces, "Instanciate") { public void actionPerformed(ActionEvent e) { Project proj = Project.getInstance(); Space world = proj.getActiveSpace(); ! for (Geometric g : entities) { ! Space space = (Space)g; Space instance = new Space(space.getName() + " instance ", space.getType(), false); instance.setProto(space); space.setOwner(instance); --- 1225,1239 ---- public JPopupMenu menu() { JPopupMenu menu = new JPopupMenu(); ! Collection<LibraryObj> spaces = new LinkedList<LibraryObj>(); ! spaces.add((LibraryObj)getUserObject()); ! menu.add(new CollectionMenuAction(spaces, "Instanciate") { public void actionPerformed(ActionEvent e) { Project proj = Project.getInstance(); Space world = proj.getActiveSpace(); ! for (Object o : col) { ! LibraryObj lo = (LibraryObj)o; ! Space space = lo.getSpace(); Space instance = new Space(space.getName() + " instance ", space.getType(), false); + proj.addCalalogObject(lo); instance.setProto(space); space.setOwner(instance); |
From: rimestad <rim...@us...> - 2007-11-12 19:20:20
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13200/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: tried to fix selecting problem with instance Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** Display.java 12 Nov 2007 14:17:05 -0000 1.52 --- Display.java 12 Nov 2007 19:20:18 -0000 1.53 *************** *** 94,99 **** private static Map<Geometric, Integer> displayLists = new HashMap<Geometric, Integer>(); - private static Map<Geometric, Integer> displayListsSelecting = - new HashMap<Geometric, Integer>(); private static final boolean USEDL = true; --- 94,97 ---- *************** *** 831,870 **** private static void drawInstance(Space space, boolean inside) { translateToCoordinatesystem(space); ! if (USEDL) { Space work = space.getProto(); ! if (selecting) { ! Integer index = displayListsSelecting.get(work); ! if (index != null) { ! gl.glCallList(index); ! gl.glPopMatrix(); ! return; ! } else { ! index = gl.glGenLists(1); ! displayListsSelecting.put(work, index); ! gl.glNewList(index, GL.GL_COMPILE_AND_EXECUTE); ! } } else { ! Integer index = displayLists.get(work); ! if (index != null) { ! gl.glCallList(index); ! gl.glPopMatrix(); ! return; ! } else { ! index = gl.glGenLists(1); ! displayLists.put(work, index); ! gl.glNewList(index, GL.GL_COMPILE_AND_EXECUTE); ! } } } ! ! if (selecting() && active == space.getOwner()) { push(space); } drawSpace(space.getProto(), inside || active == space.getProto()); ! if (selecting() && active == space.getOwner()) { pop(); } ! if (USEDL) { //will only reach here if a displaylist are being generated gl.glEndList(); --- 829,858 ---- private static void drawInstance(Space space, boolean inside) { translateToCoordinatesystem(space); ! if (USEDL && inside) { Space work = space.getProto(); ! Integer index = displayLists.get(work); ! if (index != null) { ! gl.glCallList(index); ! gl.glPopMatrix(); ! return; } else { ! index = gl.glGenLists(1); ! displayLists.put(work, index); ! gl.glNewList(index, GL.GL_COMPILE_AND_EXECUTE); } } ! boolean selActivated = false; ! if (selecting() && active == space.getProto()) { push(space); + selActivated = true; + selecting = false; } drawSpace(space.getProto(), inside || active == space.getProto()); ! if (selActivated) { ! selecting = true; pop(); } ! if (USEDL && inside) { //will only reach here if a displaylist are being generated gl.glEndList(); |
From: rimestad <rim...@us...> - 2007-11-12 19:18:04
|
Update of /cvsroot/bprocessor/bprocessor/library In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11886/library Added Files: lib.bpl Log Message: Progress on library, not working 100% yet --- NEW FILE: lib.bpl --- <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Library> <libObj useableLevels="127" name="666210 Hommage toilet.obj" locked="false" author="n/a" version="n/a"> <space union="true" transparent="false" name="666210 Hommage toilet.obj" type="0" id="17"> <description/> <Classification>unassigned</Classification> <space union="false" transparent="true" name="Void" type="1" progid="1" id="18"> <description/> <Classification>unassigned</Classification> </space> <space union="false" transparent="false" name="Object" type="0" progid="2" id="19"> <description/> <Classification>unassigned</Classification> <space union="false" transparent="true" name="Void" type="1" progid="1" id="20"> <description/> <Classification>unassigned</Classification> </space> </space> <surface progid="1" id="21"/> [...28588 lines suppressed...] <vertex z="1.33200867" x="4.43679504" y="-4.385" progid="1963" id="28572"/> <vertex z="5.46781677" x="4.43679504" y="-4.385" progid="1964" id="28573"/> <vertex z="5.46781677" x="0.59862968" y="-4.385" progid="1965" id="28574"/> <vertex z="1.33200867" x="4.43679504" y="-4.365" progid="1966" id="28575"/> <vertex z="5.46781677" x="4.43679504" y="-4.365" progid="1967" id="28576"/> <vertex z="5.46781677" x="0.59862968" y="-4.365" progid="1968" id="28577"/> <vertex z="1.33200867" x="0.59862968" y="-4.365" progid="1969" id="28578"/> <vertex z="1.33200867" x="0.59862968" y="-4.385" progid="1970" id="28579"/> <vertex z="1.33200867" x="0.59862968" y="4.385" progid="1971" id="28580"/> <vertex z="1.33200867" x="4.43679504" y="4.365" progid="1972" id="28581"/> <vertex z="5.46781677" x="4.43679504" y="4.365" progid="1973" id="28582"/> <vertex z="5.46781677" x="0.59862968" y="4.365" progid="1974" id="28583"/> <vertex z="1.33200867" x="4.43679504" y="4.385" progid="1975" id="28584"/> <vertex z="5.46781677" x="4.43679504" y="4.385" progid="1976" id="28585"/> <vertex z="1.33200867" x="0.59862968" y="4.365" progid="1977" id="28586"/> <vertex z="5.46781677" x="0.59862968" y="4.385" progid="1978" id="28587"/> </space> </libObj> </Library> |
From: rimestad <rim...@us...> - 2007-11-12 19:18:04
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12269/src/net/sourceforge/bprocessor/gui/actions Modified Files: FileImportActionListener.java ImportFileReader.java Log Message: Progress on library, not working 100% yet Index: FileImportActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileImportActionListener.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** FileImportActionListener.java 12 Nov 2007 14:15:28 -0000 1.14 --- FileImportActionListener.java 12 Nov 2007 19:18:07 -0000 1.15 *************** *** 27,30 **** --- 27,31 ---- import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.model.LibraryObj; + import net.sourceforge.bprocessor.model.Persistence; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; *************** *** 111,115 **** s.setUnion(true); LibraryObj lo = new LibraryObj(Byte.MAX_VALUE, lfile, s); ! Project.getInstance().addCalalogObject(lo); ImportFileReader.importObjFile(lfile, s, info.objPanel.getScale(), info.objPanel.getDirection(), info.objPanel.getCalcNormals()); --- 112,116 ---- s.setUnion(true); LibraryObj lo = new LibraryObj(Byte.MAX_VALUE, lfile, s); ! Project.getLibraryObjects().add(lo); ImportFileReader.importObjFile(lfile, s, info.objPanel.getScale(), info.objPanel.getDirection(), info.objPanel.getCalcNormals()); *************** *** 117,120 **** --- 118,123 ---- Project.getInstance().changed(s); Project.getInstance().checkpoint(); + //FIXME dont do this here + Persistence.saveLibrary(); } catch (Exception ex) { log.error("Could not open file: " + lfile, ex); Index: ImportFileReader.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/ImportFileReader.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ImportFileReader.java 12 Nov 2007 14:15:28 -0000 1.13 --- ImportFileReader.java 12 Nov 2007 19:18:07 -0000 1.14 *************** *** 192,195 **** --- 192,198 ---- } loadMaterials(new File(f.getParent() + "\\" + name), materialMap); + } else if (lineContent[0].equals("") || lineContent[0].equals("#")) { + //Just comments + continue; } else { log.warn("Did not understand line " + lineNum + " : " + line); *************** *** 197,201 **** } for (Space s : groups) { ! if (!s.getEnvelope().isEmpty()) { into.add(s); } --- 200,204 ---- } for (Space s : groups) { ! if (!s.collect().isEmpty()) { into.add(s); } *************** *** 205,212 **** } for (Vertex v : verts) { ! into.addProtected(v); } for (Edge e : edges) { ! into.addProtected(e); } for (Surface s : surfaces) { --- 208,215 ---- } for (Vertex v : verts) { ! into.add(v); } for (Edge e : edges) { ! into.add(e); } for (Surface s : surfaces) { *************** *** 214,218 **** s.calcNormals(); } ! into.addProtected(s); } into.changed(); --- 217,221 ---- s.calcNormals(); } ! into.add(s); } into.changed(); |
From: rimestad <rim...@us...> - 2007-11-12 19:17:29
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11856/src/net/sourceforge/bprocessor/model Modified Files: Persistence.java LibraryObj.java Project.java Log Message: Progress on library, not working 100% yet Index: LibraryObj.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/LibraryObj.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LibraryObj.java 12 Nov 2007 14:15:22 -0000 1.1 --- LibraryObj.java 12 Nov 2007 19:17:32 -0000 1.2 *************** *** 81,84 **** --- 81,85 ---- void setSpace(Space s) { space = s; + name = s.getName(); } *************** *** 113,117 **** att.add(new Attribute("geometry", getSpace())); att.add(new Attribute("Locked", isLocked())); ! att.add(new Attribute("File", getFile().getAbsoluteFile())); att.add(new Attribute("Author", getAuthor())); att.add(new Attribute("Version", getVersion())); --- 114,122 ---- att.add(new Attribute("geometry", getSpace())); att.add(new Attribute("Locked", isLocked())); ! String fileStr = "n/a"; ! if (getFile() != null) { ! fileStr = getFile().getAbsolutePath(); ! } ! att.add(new Attribute("File", fileStr)); att.add(new Attribute("Author", getAuthor())); att.add(new Attribute("Version", getVersion())); *************** *** 150,153 **** --- 155,161 ---- */ public String getAuthor() { + if (author == null) { + author = "n/a"; + } return author; } *************** *** 164,167 **** --- 172,178 ---- */ public String getVersion() { + if (version == null) { + version = "n/a"; + } return version; } *************** *** 173,175 **** --- 184,193 ---- this.version = version; } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } } Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** Persistence.java 9 Nov 2007 08:04:41 -0000 1.56 --- Persistence.java 12 Nov 2007 19:17:32 -0000 1.57 *************** *** 21,24 **** --- 21,26 ---- import net.sourceforge.bprocessor.model.xml.IDTransformType; import net.sourceforge.bprocessor.model.xml.IntegerType; + import net.sourceforge.bprocessor.model.xml.LibObjType; + import net.sourceforge.bprocessor.model.xml.Library; import net.sourceforge.bprocessor.model.xml.LineType; import net.sourceforge.bprocessor.model.xml.MapElementType; *************** *** 53,56 **** --- 55,60 ---- import net.sourceforge.bprocessor.model.xml.impl.IDTransformTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.IntegerTypeImpl; + import net.sourceforge.bprocessor.model.xml.impl.LibObjTypeImpl; + import net.sourceforge.bprocessor.model.xml.impl.LibraryImpl; import net.sourceforge.bprocessor.model.xml.impl.LineTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.MapElementTypeImpl; *************** *** 151,154 **** --- 155,166 ---- } { + p.getCatalogObjects().clear(); + for (Object o : document.getCatalogObjects()) { + LibObjType lot = (LibObjType)o; + LibraryObj lo = internalizeLibraryObj(lot, mapper, xmls); + p.addCalalogObject(lo); + } + } + { Iterator iter = document.getCamera().iterator(); while (iter.hasNext()) { *************** *** 784,787 **** --- 796,805 ---- } } + { + Collection libObjs = document.getCatalogObjects(); + for (LibraryObj lo : Project.getInstance().getCatalogObjects()) { + libObjs.add(externalizeLibObj(lo, mapper)); + } + } document.setCs(id(mapper, Project.getInstance().getActiveCoordinateSystem())); document.setActive(id(mapper, Project.getInstance().getActiveSpace())); *************** *** 915,919 **** private static SpaceType externalizeSpace(SpaceType xml, Space space, Map map) { xml.setId(counter++); ! xml.setProgid(space.getId().longValue()); xml.setName(space.getName()); xml.setType(space.getType()); --- 933,939 ---- private static SpaceType externalizeSpace(SpaceType xml, Space space, Map map) { xml.setId(counter++); ! if (space.getId() != null) { ! xml.setProgid(space.getId()); ! } xml.setName(space.getName()); xml.setType(space.getType()); *************** *** 1526,1529 **** --- 1546,1550 ---- Classification functional = internalizeClassification( (XMLClassificationType)xml.getXMLClassification().get(1), typeMap, Space.FUNCTIONAL); + input.close(); return new Object[]{construction, functional, types}; } *************** *** 1589,1598 **** } /** * Load all lbr files in the library folder * @return A collection of library objects */ ! public static Collection<Space> loadLibrary() { ! return new LinkedList<Space>(); } } --- 1610,1697 ---- } + ///////////////////////////////////////////////////////////////////////////////////////////// + // LIBRARAY INTERNALIZE AND EXTERNALIZE + ///////////////////////////////////////////////////////////////////////////////////////////// + /** * Load all lbr files in the library folder * @return A collection of library objects + * @throws Exception a exception */ ! public static Collection<LibraryObj> loadLibrary() throws Exception { ! Map<Integer, Object> map = new HashMap<Integer, Object>(); ! Collection<Object> xmls = new LinkedList<Object>(); ! Collection<LibraryObj> library = new LinkedList<LibraryObj>(); ! File libdir = new File("Library"); ! if (libdir.isDirectory()) { ! File[] libs = libdir.listFiles(); ! for (int i = 0; i < libs.length; i++) { ! File f = libs[i]; ! library.addAll(internalizeLibObjs(f, map, xmls)); ! } ! } ! return library; ! } ! ! private static List<LibraryObj> internalizeLibObjs(File f, Map map, Collection xmls) ! throws Exception { ! List<LibraryObj> res = new LinkedList<LibraryObj>(); ! if (f.exists() && f.canRead()) { ! FileInputStream is = new FileInputStream(f); ! Library lib = (Library)loadFile(is); ! for (Object lo : lib.getLibObj()) { ! LibObjType lot = (LibObjType)lo; ! LibraryObj libo = internalizeLibraryObj(lot, map, xmls); ! libo.setFile(f); ! res.add(libo); ! } ! is.close(); ! } ! return res; ! } ! ! private static LibraryObj internalizeLibraryObj(LibObjType lot, Map map, Collection xmls) { ! LibraryObj lo = new LibraryObj(); ! lo.setAuthor(lot.getAuthor()); ! lo.setVersion(lot.getVersion()); ! lo.setName(lot.getName()); ! lo.setLocked(lot.isLocked()); ! lo.setSpace(internalizeSpace(null, lot.getSpace(), map, xmls)); ! return lo; ! } ! ! /** ! * Save the library to file ! * @throws Exception one of the java file exceptions ! */ ! public static void saveLibrary() throws Exception { ! FileOutputStream fos = new FileOutputStream(new File("library\\lib.bpl")); ! ! Library lib = externalizeLibrary(Project.getLibraryObjects()); ! saveFile(lib, fos); ! ! fos.flush(); ! fos.close(); ! } ! ! private static Library externalizeLibrary(Collection<LibraryObj> catalogObjects) { ! HashMap<Long, Object> map = new HashMap<Long, Object>(); ! Library lib = new LibraryImpl(); ! List libobjs = lib.getLibObj(); ! for (LibraryObj libo : catalogObjects) { ! libobjs.add(externalizeLibObj(libo, map)); ! } ! return lib; ! } ! ! private static LibObjType externalizeLibObj(LibraryObj libo, HashMap<Long, Object> map) { ! LibObjType libobj = new LibObjTypeImpl(); ! libobj.setLocked(libo.isLocked()); ! libobj.setAuthor(libo.getAuthor()); ! libobj.setName(libo.getName()); ! libobj.setSpace(externalizeSpace(libo.getSpace(), map)); ! libobj.setUseableLevels(libo.getUseLevel()); ! libobj.setVersion(libo.getVersion()); ! return libobj; } } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.140 retrieving revision 1.141 diff -C2 -d -r1.140 -r1.141 *** Project.java 12 Nov 2007 14:15:22 -0000 1.140 --- Project.java 12 Nov 2007 19:17:32 -0000 1.141 *************** *** 64,68 **** private static Collection<ClassificationType> classificationTypes; ! private static Collection<Space> library; /** The cameras */ --- 64,68 ---- private static Collection<ClassificationType> classificationTypes; ! private static Collection<LibraryObj> library; /** The cameras */ *************** *** 132,139 **** try { Object[] loaded = Persistence.loadDBK(new File("Classification.xml")); - library = Persistence.loadLibrary(); constructionClas = (Classification)loaded[0]; functionalClas = (Classification)loaded[1]; classificationTypes = (Collection<ClassificationType>)loaded[2]; /*Map<String, ClassificationType> typeMap = ClassificationFileReader.loadTypes(""); constructionClas = ClassificationFileReader.loadClassification(true, "", typeMap); --- 132,139 ---- try { Object[] loaded = Persistence.loadDBK(new File("Classification.xml")); constructionClas = (Classification)loaded[0]; functionalClas = (Classification)loaded[1]; classificationTypes = (Collection<ClassificationType>)loaded[2]; + library = Persistence.loadLibrary(); /*Map<String, ClassificationType> typeMap = ClassificationFileReader.loadTypes(""); constructionClas = ClassificationFileReader.loadClassification(true, "", typeMap); *************** *** 317,320 **** --- 317,321 ---- public void clear() { world.clear(); + getCatalogObjects().clear(); this.setActiveSpace(world); CoordinateSystem cs = new CoordinateSystem(new Vertex(1, 0, 0), *************** *** 1053,1057 **** */ public void addCalalogObject(LibraryObj lo) { ! catalog.add(lo); } } --- 1054,1069 ---- */ public void addCalalogObject(LibraryObj lo) { ! if (!catalog.contains(lo)) { ! catalog.add(lo); ! lo.getSpace().setOwner(this.world); ! } ! } ! ! /** ! * Return the program library objects ! * @return the lib objs ! */ ! public static Collection<LibraryObj> getLibraryObjects() { ! return library; } } |
From: rimestad <rim...@us...> - 2007-11-12 19:17:29
|
Update of /cvsroot/bprocessor/model/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11856/src/etc Modified Files: bprocessor.xsd Log Message: Progress on library, not working 100% yet Index: bprocessor.xsd =================================================================== RCS file: /cvsroot/bprocessor/model/src/etc/bprocessor.xsd,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** bprocessor.xsd 9 Nov 2007 08:04:41 -0000 1.37 --- bprocessor.xsd 12 Nov 2007 19:17:32 -0000 1.38 *************** *** 353,356 **** --- 353,367 ---- </xsd:complexType> + <xsd:complexType name="LibObjType"> + <xsd:sequence> + <xsd:element ref="space" maxOccurs="1" minOccurs="1"/> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required"/> + <xsd:attribute name="version" type="xsd:string" use="required"/> + <xsd:attribute name="author" type="xsd:string" use="required"/> + <xsd:attribute name="useableLevels" type="xsd:byte" use="required"/> + <xsd:attribute name="locked" type="xsd:boolean" use="required"/> + </xsd:complexType> + <!-- Element definitions --> <xsd:element name="space" type="SpaceType"/> *************** *** 378,382 **** <xsd:element name="camera" type="CameraType" maxOccurs="unbounded" minOccurs="0"/> <xsd:element name="global" type="MapElementType" maxOccurs="unbounded" minOccurs="0"/> ! <xsd:element name="catalogObjects" type="SpaceType" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> </xsd:complexType> --- 389,393 ---- <xsd:element name="camera" type="CameraType" maxOccurs="unbounded" minOccurs="0"/> <xsd:element name="global" type="MapElementType" maxOccurs="unbounded" minOccurs="0"/> ! <xsd:element name="catalogObjects" type="LibObjType" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> </xsd:complexType> *************** *** 386,390 **** <xsd:complexType> <xsd:sequence> ! <xsd:element ref="space" maxOccurs="unbounded" minOccurs="1"/> </xsd:sequence> </xsd:complexType> --- 397,401 ---- <xsd:complexType> <xsd:sequence> ! <xsd:element name="libObj" type="LibObjType" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> </xsd:complexType> |
From: rimestad <rim...@us...> - 2007-11-12 19:17:23
|
Update of /cvsroot/bprocessor/bprocessor/library In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11834/library Log Message: Directory /cvsroot/bprocessor/bprocessor/library added to the repository |
From: Michael L. <he...@us...> - 2007-11-12 14:47:33
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29873/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: active coordinate-system Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** AbstractPencil.java 20 Sep 2007 07:45:06 -0000 1.96 --- AbstractPencil.java 12 Nov 2007 14:47:36 -0000 1.97 *************** *** 196,199 **** --- 196,201 ---- } + normal = Project.getInstance().getActiveCoordinateSystem().getN(); + work = new Plane(normal.getX(), normal.getY(), *************** *** 204,208 **** } else { ! work = new Plane(0, 0, 1, 0); } } --- 206,210 ---- } else { ! work = Project.getInstance().getActiveCoordinateSystem().plane(); } } *************** *** 457,466 **** protected List computeConstructors() { List<Constructor> constructors = new LinkedList<Constructor>(); if (start != null) { ! constructors.add(new CoordinateSystem(start.vertex().copy())); } if (incident != null) { if (start == null || (!start.equalEps(incident))) { ! constructors.add(new CoordinateSystem(incident.vertex().copy())); } } --- 459,469 ---- protected List computeConstructors() { List<Constructor> constructors = new LinkedList<Constructor>(); + CoordinateSystem cs = Project.getInstance().getActiveCoordinateSystem(); if (start != null) { ! constructors.add(cs.copy(start.vertex().copy())); } if (incident != null) { if (start == null || (!start.equalEps(incident))) { ! constructors.add(cs.copy(incident.vertex().copy())); } } |
From: Michael L. <he...@us...> - 2007-11-12 14:45:53
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29052/src/net/sourceforge/bprocessor/model Modified Files: CoordinateSystem.java Log Message: active coordinate-system Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** CoordinateSystem.java 24 Oct 2007 16:04:54 -0000 1.60 --- CoordinateSystem.java 12 Nov 2007 14:45:47 -0000 1.61 *************** *** 734,737 **** --- 734,747 ---- return n; } + + /** + * Returns a copy of this CoordinateSystem placed + * at specified origin + * @param origin new origin + * @return copy placed at specified origin + */ + public CoordinateSystem copy(Vertex origin) { + return new CoordinateSystem(i, j, n, origin); + } /** |
From: rimestad <rim...@us...> - 2007-11-12 14:17:02
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17388/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: refactored draw(Space s... in two to get a draw mechanism for instances and spaces that aint instances Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** Display.java 9 Nov 2007 12:23:29 -0000 1.51 --- Display.java 12 Nov 2007 14:17:05 -0000 1.52 *************** *** 823,851 **** private static void draw(Space space, boolean inside) { if (space.isInstance()) { ! translateToCoordinatesystem(space); } ! if (space.isLocked() && USEDL) { if (selecting) { ! Integer index = displayListsSelecting.get(space); if (index != null) { gl.glCallList(index); return; } else { index = gl.glGenLists(1); ! displayListsSelecting.put(space, index); gl.glNewList(index, GL.GL_COMPILE_AND_EXECUTE); } } else { ! Integer index = displayLists.get(space); if (index != null) { gl.glCallList(index); return; } else { index = gl.glGenLists(1); ! displayLists.put(space, index); gl.glNewList(index, GL.GL_COMPILE_AND_EXECUTE); } } } Set<Geometric> hidden = new HashSet(); hidden.addAll(camera.getHiddenGeometrics()); --- 823,877 ---- private static void draw(Space space, boolean inside) { if (space.isInstance()) { ! drawInstance(space, inside); ! } else { ! drawSpace(space, inside); } ! } ! ! private static void drawInstance(Space space, boolean inside) { ! translateToCoordinatesystem(space); ! if (USEDL) { ! Space work = space.getProto(); if (selecting) { ! Integer index = displayListsSelecting.get(work); if (index != null) { gl.glCallList(index); + gl.glPopMatrix(); return; } else { index = gl.glGenLists(1); ! displayListsSelecting.put(work, index); gl.glNewList(index, GL.GL_COMPILE_AND_EXECUTE); } } else { ! Integer index = displayLists.get(work); if (index != null) { gl.glCallList(index); + gl.glPopMatrix(); return; } else { index = gl.glGenLists(1); ! displayLists.put(work, index); gl.glNewList(index, GL.GL_COMPILE_AND_EXECUTE); } } } + + if (selecting() && active == space.getOwner()) { + push(space); + } + drawSpace(space.getProto(), inside || active == space.getProto()); + if (selecting() && active == space.getOwner()) { + pop(); + } + + if (USEDL) { + //will only reach here if a displaylist are being generated + gl.glEndList(); + } + gl.glPopMatrix(); + } + + private static void drawSpace(Space space, boolean inside) { Set<Geometric> hidden = new HashSet(); hidden.addAll(camera.getHiddenGeometrics()); *************** *** 1053,1066 **** } } - if (space.isLocked() && USEDL) { - //will only reach here if a displaylist are being generated - gl.glEndList(); - } for (Space current : elements) { draw(current, inside || (current == active)); } - if (space.isInstance()) { - gl.glPopMatrix(); - } } --- 1079,1085 ---- |
From: rimestad <rim...@us...> - 2007-11-12 14:15:31
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16958/src/net/sourceforge/bprocessor/gui/treeview Modified Files: LibraryTreeView.java GenericTreeView.java SpaceTreeView.java Log Message: Removed lock from space, and created a LibraryObj to encapsulate the union spaces for the library. Made changes acording to that in the treeview. Index: LibraryTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/LibraryTreeView.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LibraryTreeView.java 6 Nov 2007 18:27:53 -0000 1.1 --- LibraryTreeView.java 12 Nov 2007 14:15:28 -0000 1.2 *************** *** 20,24 **** super(); root.removeAllChildren(); ! root.add(new CatalogContainer(Project.getInstance())); model.nodeStructureChanged(root); } --- 20,24 ---- super(); root.removeAllChildren(); ! root.add(new CatalogContainer("Unions", Project.getInstance().getCatalogObjects())); model.nodeStructureChanged(root); } *************** *** 27,31 **** @Override public void update() { ! ((GenericNode)root.getChildAt(0)).update(Project.getInstance()); } } --- 27,31 ---- @Override public void update() { ! ((GenericNode)root.getChildAt(0)).update(Project.getInstance().getCatalogObjects()); } } Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.119 retrieving revision 1.120 diff -C2 -d -r1.119 -r1.120 *** GenericTreeView.java 6 Nov 2007 18:27:53 -0000 1.119 --- GenericTreeView.java 12 Nov 2007 14:15:28 -0000 1.120 *************** *** 44,48 **** import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Camera; - import net.sourceforge.bprocessor.model.Command; import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.CoordinateSystem; --- 44,47 ---- *************** *** 50,53 **** --- 49,53 ---- import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Geometric; + import net.sourceforge.bprocessor.model.LibraryObj; import net.sourceforge.bprocessor.model.Material; import net.sourceforge.bprocessor.model.Observer; *************** *** 1161,1172 **** * CameraNode */ ! public class CatalogContainer extends ContainerNode { /** ! * Constructor for EdgeContainer ! * @param p The project */ ! public CatalogContainer(Project p) { ! super("Catalog", p.getCatalogObjects(), true); ! insertChildren(p.getCatalogObjects()); } --- 1161,1175 ---- * CameraNode */ ! public class CatalogContainer extends GenericNode { /** ! * Constructor for Catalog objects ! * @param name the name for the tree node ! * @param content the children for the node */ ! public CatalogContainer(String name, List<LibraryObj> content) { ! super(name); ! for (LibraryObj l : content) { ! this.add(new CatalogNode(l)); ! } } *************** *** 1176,1195 **** */ public void update(Object o) { ! if (o instanceof Project) { ! Project proj = (Project)o; ! if (proj == updated) { ! model.nodeChanged(this); } ! super.update(proj.getCatalogObjects()); ! } else { ! log.warn("Were a " + o + " not a Project"); } } - - /** {@inheritDoc} */ - public EntityNode nodeFor(Object entity) { - Space s = (Space) entity; - return new CatalogNode(s); - } } --- 1179,1190 ---- */ public void update(Object o) { ! if (o instanceof Collection) { ! this.removeAllChildren(); ! for (LibraryObj l : (Collection<LibraryObj>)o) { ! this.add(new CatalogNode(l)); } ! model.nodeStructureChanged(this); } } } *************** *** 1198,1211 **** * @author rimestad */ ! public class CatalogNode extends EntityNode { /** * Constructor ! * @param s The space that represent the catalog object */ ! public CatalogNode(Space s) { ! super(s); ! this.add(new SurfaceContainer("Surfaces", s.getSurfaces())); ! this.add(new EdgeContainer("Edges", s.getEdges(), true)); ! this.add(new VertexContainer("Vertices", s.getVertices(), true)); } --- 1193,1204 ---- * @author rimestad */ ! public class CatalogNode extends GenericNode { /** * Constructor ! * @param l The lib obj */ ! public CatalogNode(LibraryObj l) { ! super(l); ! Space s = l.getSpace(); } *************** *** 1213,1217 **** @Override public String toString() { ! return ((Space)getUserObject()).getName(); } --- 1206,1210 ---- @Override public String toString() { ! return ((LibraryObj)getUserObject()).getName(); } *************** *** 1219,1227 **** @Override public void update(Object o) { ! if (o instanceof Space) { ! Space s = (Space)o; ! ((GenericNode)this.getChildAt(0)).update(s.getSurfaces()); ! ((GenericNode)this.getChildAt(1)).update(s.getEdges()); ! ((GenericNode)this.getChildAt(2)).update(s.getVertices()); } } --- 1212,1221 ---- @Override public void update(Object o) { ! if (o instanceof LibraryObj) { ! LibraryObj lo = (LibraryObj)o; ! if (lo != userObject) { ! userObject = lo; ! model.nodeChanged(this); ! } } } *************** *** 1232,1246 **** JPopupMenu menu = new JPopupMenu(); Collection<Space> spaces = new LinkedList<Space>(); ! spaces.add((Space)getUserObject()); ! menu.add(new GeometricMenuAction(spaces, "Duplicate") { ! public void actionPerformed(ActionEvent e) { ! Command command = new Command.Duplicate((Space) entities.iterator().next()); ! AttributeView.instance().display(command); ! }; ! }); menu.add(new GeometricMenuAction(spaces, "Instanciate") { public void actionPerformed(ActionEvent e) { ! Command command = new Command.Instance((Space) entities.iterator().next()); ! AttributeView.instance().display(command); }; }); --- 1226,1243 ---- JPopupMenu menu = new JPopupMenu(); Collection<Space> spaces = new LinkedList<Space>(); ! spaces.add(((LibraryObj)getUserObject()).getSpace()); menu.add(new GeometricMenuAction(spaces, "Instanciate") { public void actionPerformed(ActionEvent e) { ! Project proj = Project.getInstance(); ! Space world = proj.getActiveSpace(); ! for (Geometric g : entities) { ! Space space = (Space)g; ! Space instance = new Space(space.getName() + " instance ", space.getType(), false); ! instance.setProto(space); ! space.setOwner(instance); ! world.add(instance); ! } ! proj.changed(world); ! proj.checkpoint(); }; }); Index: SpaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SpaceTreeView.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** SpaceTreeView.java 6 Nov 2007 08:06:12 -0000 1.26 --- SpaceTreeView.java 12 Nov 2007 14:15:28 -0000 1.27 *************** *** 38,42 **** root.add(new ParameterBlockNode("Globals", p.getGlobals())); root.add(new ConstructorContainer("Constructors", p.getConstructors())); ! root.add(new CatalogContainer(p)); model.nodeStructureChanged(root); --- 38,42 ---- root.add(new ParameterBlockNode("Globals", p.getGlobals())); root.add(new ConstructorContainer("Constructors", p.getConstructors())); ! root.add(new CatalogContainer("Catalog", p.getCatalogObjects())); model.nodeStructureChanged(root); *************** *** 56,60 **** ((GenericNode)root.getChildAt(4)).update(p.getGlobals()); ((GenericNode)root.getChildAt(5)).update(p.getConstructors()); ! ((GenericNode)root.getChildAt(6)).update(p); } catch (ArrayIndexOutOfBoundsException e) { log.error("There were a inconsistent number of nodes attached to " + --- 56,60 ---- ((GenericNode)root.getChildAt(4)).update(p.getGlobals()); ((GenericNode)root.getChildAt(5)).update(p.getConstructors()); ! ((GenericNode)root.getChildAt(6)).update(p.getCatalogObjects()); } catch (ArrayIndexOutOfBoundsException e) { log.error("There were a inconsistent number of nodes attached to " + |