bprocessor-commit Mailing List for B-processor (Page 66)
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: Nordholt <nor...@us...> - 2007-05-07 15:42:42
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31590/src/net/sourceforge/bprocessor/model Modified Files: Geometry.java Log Message: Made a method for moving vertices by untranslating them in to a local coordinate system Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** Geometry.java 7 May 2007 13:33:12 -0000 1.54 --- Geometry.java 7 May 2007 15:42:42 -0000 1.55 *************** *** 965,968 **** --- 965,989 ---- } } + } + + /** + * Untranslates all vertices of a set of geometry, and changes the + * coordinates of the vertices accordingly. Notice this is likely to + * move the geometry. + * @param geometry the geometry + * @param system the coordinate system to untranslate according to + */ + public static void unTranslateGeometry(Set 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(); + while (it.hasNext() && unTranslatedIt.hasNext()) { + Vertex v = (Vertex)it.next(); + Vertex vUnTranslated = (Vertex)unTranslatedIt.next(); + v.setX(vUnTranslated.getX()); + v.setY(vUnTranslated.getY()); + v.setZ(vUnTranslated.getZ()); + } } } |
|
From: Nordholt <nor...@us...> - 2007-05-07 15:41:37
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31204/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: commit added method to find runs of parrallel and connected edges Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** Edge.java 23 Apr 2007 14:47:59 -0000 1.87 --- Edge.java 7 May 2007 15:41:35 -0000 1.88 *************** *** 11,14 **** --- 11,15 ---- import java.util.ArrayList; import java.util.Collection; + import java.util.Collections; import java.util.HashMap; import java.util.HashSet; *************** *** 46,50 **** /** * Return the first vertex in a list of edges. ! * The first vertex is defined as the a vertex * in the first edge that are not shared with the * second edge --- 47,51 ---- /** * Return the first vertex in a list of edges. ! * The first vertex is defined as the vertex * in the first edge that are not shared with the * second edge *************** *** 1124,1126 **** --- 1125,1171 ---- move(delta.getX(), delta.getY(), delta.getZ()); } + + /** + * Finds the longest run of parrallel edges connected to this edge. + * @return a list of connected parrallel edges. The edges will be sorted so that + * the first edge is the furthest away from this edge in the to->from direction + */ + public List<Edge> parrallelRun() { + Edge currentEdge = this; + Vertex currentVertex = this.getTo(); + List<Edge> run = new LinkedList<Edge>(); + while (currentEdge != null) { + run.add(currentEdge); + currentVertex = currentEdge.otherVertex(currentVertex); + Set<Edge> edges = currentVertex.getEdges(); + Edge nextEdge = null; + for (Edge e : edges) { + if (e.parrallel(currentEdge) && + e != currentEdge) { + nextEdge = e; + break; + } + } + currentEdge = nextEdge; + } + Collections.reverse(run); + run.remove(this); + currentEdge = this; + currentVertex = this.getFrom(); + while (currentEdge != null) { + run.add(currentEdge); + currentVertex = currentEdge.otherVertex(currentVertex); + Set<Edge> edges = currentVertex.getEdges(); + Edge nextEdge = null; + for (Edge e : edges) { + if (e.parrallel(currentEdge) && + e != currentEdge) { + nextEdge = e; + break; + } + } + currentEdge = nextEdge; + } + return run; + } } |
|
From: Nordholt <nor...@us...> - 2007-05-07 15:41:08
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30731/src/net/sourceforge/bprocessor/model Modified Files: Classification.java Log Message: added some generics to classification Index: Classification.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Classification.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Classification.java 16 Apr 2007 15:55:22 -0000 1.12 --- Classification.java 7 May 2007 15:40:59 -0000 1.13 *************** *** 28,32 **** /** The children of this classification */ ! private Vector children = new Vector(); /** The parent of this classification */ --- 28,32 ---- /** The children of this classification */ ! private Vector<Classification> children = new Vector<Classification>(); /** The parent of this classification */ *************** *** 100,104 **** * @return the children */ ! public Vector getChildren() { return children; } --- 100,104 ---- * @return the children */ ! public Vector<Classification> getChildren() { return children; } |
|
From: Nordholt <nor...@us...> - 2007-05-07 15:40:09
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30363/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: quick fix to please compiler Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** GenericTreeView.java 7 May 2007 09:48:51 -0000 1.96 --- GenericTreeView.java 7 May 2007 15:40:09 -0000 1.97 *************** *** 410,414 **** * @param label The label for the container node */ ! public ContainerNode(Object label, Collection< ? extends Entity> object) { super(label); this.content = object; --- 410,414 ---- * @param label The label for the container node */ ! public ContainerNode(Object label, Collection object) { super(label); this.content = object; |
|
From: Nordholt <nor...@us...> - 2007-05-07 15:31:27
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26981/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: removed some printout Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.204 retrieving revision 1.205 diff -C2 -d -r1.204 -r1.205 *** View.java 7 May 2007 13:42:39 -0000 1.204 --- View.java 7 May 2007 15:31:27 -0000 1.205 *************** *** 3372,3376 **** */ public void update(Object entity) { - log.info("Change on " + entity + " class " + entity.getClass()); if (entity instanceof Space) { for (Surface s : ((Space)entity).getSurfaces()) { --- 3372,3375 ---- |
|
From: Nordholt <nor...@us...> - 2007-05-07 13:42:45
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15359/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: quick fix to make Jens' commit work Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.203 retrieving revision 1.204 diff -C2 -d -r1.203 -r1.204 *** View.java 7 May 2007 13:39:38 -0000 1.203 --- View.java 7 May 2007 13:42:39 -0000 1.204 *************** *** 738,742 **** log.error(e); //Maybe try to reset the gl setting ! Project.getInstance().resetCam(); Project.getInstance().changed(Project.getInstance().getCurrentCamera()); } --- 738,742 ---- log.error(e); //Maybe try to reset the gl setting ! //Project.getInstance().resetCam(); Project.getInstance().changed(Project.getInstance().getCurrentCamera()); } |
|
From: rimestad <rim...@us...> - 2007-05-07 13:40:21
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14531/src/net/sourceforge/bprocessor/model/modellor Modified Files: TileModellor.java ModelBathModellor.java Log Message: small changes to tile and bath modellor Index: TileModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/TileModellor.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TileModellor.java 4 May 2007 11:52:58 -0000 1.12 --- TileModellor.java 7 May 2007 13:40:18 -0000 1.13 *************** *** 108,112 **** log.info("Modellor update on " + entity); space.clear(); - updateNet(startPoint); space.add(net); int sign = 1; --- 108,111 ---- *************** *** 177,181 **** } surface.copyall(net); ! Collection<Edge> edges = new ArrayList<Edge>(net.getEdges()); Collection<Edge> horEdges = new LinkedList<Edge>(); Collection<Edge> vertEdges = new LinkedList<Edge>(); --- 176,183 ---- } surface.copyall(net); ! Collection<Edge> edges = new ArrayList<Edge>(surface.getEdges()); ! for (Surface s : surface.getHoles()) { ! edges.addAll(s.getEdges()); ! } Collection<Edge> horEdges = new LinkedList<Edge>(); Collection<Edge> vertEdges = new LinkedList<Edge>(); *************** *** 183,186 **** --- 185,190 ---- Collection<Vertex> otherVerts = new LinkedList<Vertex>(); + long before = System.currentTimeMillis(); + // insert horizontal edges if (height > 0) { *************** *** 189,193 **** Vertex localHori = new Vertex(0, tileSize.getHeight() / 1000.0 + jointSize / 1000.0, 0); Vertex horizontalAdd = cs.unTranslate(localHori).minus(cs.center()); ! Edge slider = new Edge(cs.center().copy().minus(horizontalAdd), cs.unTranslate(new Vertex(maxX, 0, 0)).minus(horizontalAdd)); findIntersectingEdges(cs, slider, maxX, maxY, minX, minY, --- 193,197 ---- Vertex localHori = new Vertex(0, tileSize.getHeight() / 1000.0 + jointSize / 1000.0, 0); Vertex horizontalAdd = cs.unTranslate(localHori).minus(cs.center()); ! Edge slider = new Edge(cs.unTranslate(new Vertex(minX, 0, 0)).minus(horizontalAdd), cs.unTranslate(new Vertex(maxX, 0, 0)).minus(horizontalAdd)); findIntersectingEdges(cs, slider, maxX, maxY, minX, minY, *************** *** 196,205 **** Vertex localVertical = new Vertex(tileSize.getWidth() / 1000.0 + jointSize / 1000.0, 0, 0); Vertex verticalAdd = cs.unTranslate(localVertical).minus(cs.center()); ! slider = new Edge(cs.center().copy().minus(verticalAdd), cs.unTranslate(new Vertex(0, maxY, 0)).minus(verticalAdd)); findIntersectingEdges(cs, slider, maxX, maxY, minX, minY, edges, vertEdges, otherVerts, verticalAdd); ! ! Collection<Vertex> extras = new LinkedList<Vertex>(); for (Edge e1 : vertEdges) { for (Edge e2 : horEdges) { --- 200,210 ---- Vertex localVertical = new Vertex(tileSize.getWidth() / 1000.0 + jointSize / 1000.0, 0, 0); Vertex verticalAdd = cs.unTranslate(localVertical).minus(cs.center()); ! slider = new Edge(cs.unTranslate(new Vertex(0, minY, 0)).minus(verticalAdd), 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) { *************** *** 227,236 **** v = net.insert(v); } SurfaceAnalysis sa = new SurfaceAnalysis(); ! Collection<CoordinateSystem> cons = sa.planeAnalysis(net); ! for (CoordinateSystem coors : cons) { ! net.add(coors); ! } ! sa.surfaceAnalysis(net); } --- 232,241 ---- v = net.insert(v); } + long time1 = System.currentTimeMillis(); + log.info("Edge insertsion time : " + (time1 - before)); SurfaceAnalysis sa = new SurfaceAnalysis(); ! sa.surfaceAnalysis(net, startPoint, net.getEdges()); ! long time2 = System.currentTimeMillis(); ! log.info("Surface analysis time : " + (time2 - time1)); } *************** *** 351,368 **** } a = attributes.get("Surface"); ! if (a != null && a.getValue() != null) { ! Surface chosen = null; ! for (Surface cur : space.getEnvelope()) { ! if (cur.getName().equalsIgnoreCase((String)a.getValue())) { ! chosen = cur; } - } - if (chosen != null) { - surface = chosen; - space.getOwner().remove(startPoint); - startPoint = surface.coordinateSystem(); - space.getOwner().add(startPoint); - startPoint.relate(surface); - updateNet = true; } } --- 356,376 ---- } a = attributes.get("Surface"); ! if (a != null) { ! if (a.getValue() instanceof String) { ! String txt = (String)a.getValue(); ! Surface chosen = null; ! for (Surface cur : space.getEnvelope()) { ! if (cur.getName().equalsIgnoreCase(txt)) { ! chosen = cur; ! } ! } ! if (chosen != null && chosen != surface) { ! surface = chosen; ! space.getOwner().remove(startPoint); ! startPoint = surface.coordinateSystem(); ! space.getOwner().insert(startPoint); ! startPoint.relate(surface); ! updateNet = true; } } } *************** *** 379,382 **** --- 387,391 ---- } update(this); + Project.getInstance().changed(this); } Index: ModelBathModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/ModelBathModellor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ModelBathModellor.java 16 Apr 2007 15:54:42 -0000 1.2 --- ModelBathModellor.java 7 May 2007 13:40:18 -0000 1.3 *************** *** 69,76 **** Collection<Surface> horizontal = new HashSet<Surface>(); Collection<Surface> surs = s.getEnvelope(); - if (surs.size() != 6) { - log.info("Have to be a square box with 6 sides 4 vertical and 2 horizontal"); - return; - } Vertex up = new Vertex(0, 0, 1); for (Surface sur : surs) { --- 69,72 ---- *************** *** 114,119 **** */ private void generate() { Surface making = makeFloor(); ! Space wallSystem = new Space("Vægsystem", Space.CONSTRUCTION, Space.ELEMENT_LEVEL, true); space.add(wallSystem); making.setBackDomain(wallSystem); --- 110,116 ---- */ private void generate() { + space.setUnion(true); Surface making = makeFloor(); ! Space wallSystem = new Space("Vægsystem", Space.CONSTRUCTION, Space.SPACE_LEVEL, true); space.add(wallSystem); making.setBackDomain(wallSystem); *************** *** 131,135 **** Geometry.holeAnalysis(room); ! Space badkabine = new Space("Badekabine", Space.FUNCTIONAL, Space.ELEMENT_LEVEL, true); space.add(badkabine); room.setBackDomain(badkabine); --- 128,132 ---- Geometry.holeAnalysis(room); ! Space badkabine = new Space("Bathcabin", Space.FUNCTIONAL, Space.SPACE_LEVEL, true); space.add(badkabine); room.setBackDomain(badkabine); *************** *** 142,146 **** space.addAll(sides); space.addAll(tops); ! Space ceiling = new Space("Ceiling", Space.CONSTRUCTION, Space.ELEMENT_LEVEL, true); space.add(ceiling); for (Surface s : tops) { --- 139,143 ---- space.addAll(sides); space.addAll(tops); ! Space ceiling = new Space("Ceiling", Space.CONSTRUCTION, Space.SPACE_LEVEL, true); space.add(ceiling); for (Surface s : tops) { *************** *** 150,153 **** --- 147,153 ---- sides.add(top.extrusion(ceilingThickness / 1000, sides)); space.addAll(sides); + + //find surfacesed parting wall and bath cabin + } } |
|
From: rimestad <rim...@us...> - 2007-05-07 13:39:39
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14127/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: added displaylists on surfaces and forward update call from glView to view to clear these in a consdervative manner. Better performance. Made drawGeneralEdge use drawEdge method with EdgeAttribute as well, seem to work, but look out for edge flaws :-D Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.202 retrieving revision 1.203 diff -C2 -d -r1.202 -r1.203 *** View.java 4 May 2007 11:59:26 -0000 1.202 --- View.java 7 May 2007 13:39:38 -0000 1.203 *************** *** 344,357 **** /** Temporary constructors. Will be drawn but not put in database */ ! private Set tempConstructors; /** Temporary edges. Will be drawn but not put in database */ ! private Set tempEdges; /** Temporary surfaces. Will be drawn but not put in database */ ! private Set tempSurfaces; /** Temporary verticies. Will be drawn but not put in database */ ! private Set tempVertices; /** Maps entities to a color */ --- 344,357 ---- /** Temporary constructors. Will be drawn but not put in database */ ! private Set<Constructor> tempConstructors; /** Temporary edges. Will be drawn but not put in database */ ! private Set<Edge> tempEdges; /** Temporary surfaces. Will be drawn but not put in database */ ! private Set<Surface> tempSurfaces; /** Temporary verticies. Will be drawn but not put in database */ ! private Set<Vertex> tempVertices; /** Maps entities to a color */ *************** *** 367,371 **** * FIXME this should be a list to be able to control ordering. */ ! private Set glObjects3D; /** --- 367,371 ---- * FIXME this should be a list to be able to control ordering. */ ! private Set<GlObject> glObjects3D; /** *************** *** 381,384 **** --- 381,386 ---- private HashMap<Surface, Integer> displayLists = new HashMap<Surface, Integer>(); + private List<Integer> deletedLists = new LinkedList<Integer>(); + static { setTransparency(100); *************** *** 591,595 **** Edge e2 = new Edge(v2, v3); Edge e3 = new Edge(v3, v1); ! List edges = new LinkedList(); edges.add(e1); edges.add(e2); --- 593,597 ---- Edge e2 = new Edge(v2, v3); Edge e3 = new Edge(v3, v1); ! List<Edge> edges = new LinkedList<Edge>(); edges.add(e1); edges.add(e2); *************** *** 618,621 **** --- 620,628 ---- } } + if (attributes.getDrawVertices()) { + gl.glPointSize(10.0f); + } else { + gl.glPointSize(1.0f); + } } } *************** *** 626,726 **** */ public void display(GLAutoDrawable gld) { ! gl = gld.getGL(); ! glu = new GLU(); ! ! boolean hitdetection = false; ! ! gl.glClearColor(bgColor[0], bgColor[1], bgColor[2], bgColor[3]); ! gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); ! ! if (picking > 0) { ! selectBuffer = BufferUtil.newIntBuffer(selectionLength); ! gl.glSelectBuffer(selectionLength, selectBuffer); ! gl.glRenderMode(GL.GL_SELECT); ! hitdetection = true; ! } ! ! initCamera(); ! gl.glPushMatrix(); ! picking = 0; ! ! enableClipplanes(); ! ! gl.glColor3fv(lineColor, 0); ! gl.glLineWidth(1.0f); ! ! drawAll(hitdetection); ! ! gl.glEnable(GL.GL_DEPTH_TEST); ! ! disableClipplanes(); ! ! //draw the clipping planes ! Collection<ClippingPlane> clips ! = Project.getInstance().getCurrentCamera().getClipplanes(); ! ! for (ClippingPlane current : clips) { ! Collection selection = Selection.primary(); ! if (current == target) { ! drawObject(current); ! } else { ! if (selection.contains(current)) { ! gl.glColor3fv(SELECTED_COLOR, 0); } else { ! gl.glColor3fv(CLIP_PLANE_COLOR, 0); } - drawClipplane(current); } ! } ! ! ! gl.glMatrixMode(GL.GL_PROJECTION); ! gl.glDisable(GL.GL_DEPTH_TEST); ! gl.glPushMatrix(); ! gl.glLoadIdentity(); ! if (hitdetection) { ! int[] viewport = new int[] {0, 0, (int)width, (int)height}; ! glu.gluPickMatrix(x, viewport[3] - y, 5, 5, viewport, 0); ! } ! glu.gluOrtho2D(0, width, 0, height); ! gl.glMatrixMode(GL.GL_MODELVIEW); ! gl.glPushMatrix(); ! gl.glLoadIdentity(); ! ! if (glv.getTool() instanceof SpaceTool) { ! labelSelection(hitdetection); ! } ! ! ! drawSpacePath(hitdetection); ! ! for (Widget widget : widgets) { ! widget.display(gl, glu, hitdetection); ! } ! ! gl.glMatrixMode(GL.GL_PROJECTION); ! gl.glPopMatrix(); ! gl.glMatrixMode(GL.GL_MODELVIEW); ! gl.glPopMatrix(); ! ! ! gl.glPopMatrix(); ! if (hitdetection) { ! gl.glFlush(); ! hits = gl.glRenderMode(GL.GL_RENDER); ! if (hits < 0) { ! // There were overflow in the selctionBuffer double the buffer and try again ! selectionLength *= 2; ! picking = 10; ! glv.repaint(true); } ! if (log.isDebugEnabled()) { ! log.debug("Hits: " + hits); } ! } else { ! gld.swapBuffers(); } } ! /** * disable all clipping planes --- 633,746 ---- */ public void display(GLAutoDrawable gld) { ! try { ! gl = gld.getGL(); ! glu = new GLU(); ! ! // remove old displayLists ! for (Integer i : deletedLists) { ! gl.glDeleteLists(i, i); ! } ! deletedLists.clear(); ! ! boolean hitdetection = false; ! ! gl.glClearColor(bgColor[0], bgColor[1], bgColor[2], bgColor[3]); ! gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); ! ! if (picking > 0) { ! selectBuffer = BufferUtil.newIntBuffer(selectionLength); ! gl.glSelectBuffer(selectionLength, selectBuffer); ! gl.glRenderMode(GL.GL_SELECT); ! hitdetection = true; ! } ! ! initCamera(); ! gl.glPushMatrix(); ! picking = 0; ! ! enableClipplanes(); ! ! gl.glColor3fv(lineColor, 0); ! gl.glLineWidth(1.0f); ! ! drawAll(hitdetection); ! ! gl.glEnable(GL.GL_DEPTH_TEST); ! ! disableClipplanes(); ! ! //draw the clipping planes ! Collection<ClippingPlane> clips ! = Project.getInstance().getCurrentCamera().getClipplanes(); ! ! for (ClippingPlane current : clips) { ! Collection selection = Selection.primary(); ! if (current == target) { ! drawObject(current); } else { ! if (selection.contains(current)) { ! gl.glColor3fv(SELECTED_COLOR, 0); ! } else { ! gl.glColor3fv(CLIP_PLANE_COLOR, 0); ! } ! drawClipplane(current); } } ! ! ! gl.glMatrixMode(GL.GL_PROJECTION); ! gl.glDisable(GL.GL_DEPTH_TEST); ! gl.glPushMatrix(); ! gl.glLoadIdentity(); ! if (hitdetection) { ! int[] viewport = new int[] {0, 0, (int)width, (int)height}; ! glu.gluPickMatrix(x, viewport[3] - y, 5, 5, viewport, 0); } ! glu.gluOrtho2D(0, width, 0, height); ! gl.glMatrixMode(GL.GL_MODELVIEW); ! gl.glPushMatrix(); ! gl.glLoadIdentity(); ! ! if (glv.getTool() instanceof SpaceTool) { ! labelSelection(hitdetection); } ! ! ! drawSpacePath(hitdetection); ! ! for (Widget widget : widgets) { ! widget.display(gl, glu, hitdetection); ! } ! ! gl.glMatrixMode(GL.GL_PROJECTION); ! gl.glPopMatrix(); ! gl.glMatrixMode(GL.GL_MODELVIEW); ! gl.glPopMatrix(); ! ! ! gl.glPopMatrix(); ! if (hitdetection) { ! gl.glFlush(); ! hits = gl.glRenderMode(GL.GL_RENDER); ! if (hits < 0) { ! // There were overflow in the selctionBuffer double the buffer and try again ! selectionLength *= 2; ! picking = 10; ! glv.repaint(true); ! } ! if (log.isDebugEnabled()) { ! log.debug("Hits: " + hits); ! } ! } else { ! gld.swapBuffers(); ! } ! } catch (Exception e) { ! log.error(e); ! //Maybe try to reset the gl setting ! Project.getInstance().resetCam(); ! Project.getInstance().changed(Project.getInstance().getCurrentCamera()); } } ! /** * disable all clipping planes *************** *** 862,867 **** * @return Supporting edges */ ! public Collection collectSupportingEdges(Space active) { ! Collection edges = new HashSet(); if (active != Project.getInstance().world()) { Space current = active; --- 882,887 ---- * @return Supporting edges */ ! public Collection<Edge> collectSupportingEdges(Space active) { ! Collection<Edge> edges = new HashSet<Edge>(); if (active != Project.getInstance().world()) { Space current = active; *************** *** 1108,1118 **** gl.glPolygonOffset(0.5f, 0.5f); gl.glEnable(GL.GL_CULL_FACE); ! gl.glCullFace(GL.GL_BACK); drawSurfaces(surfaces, FRONT); ! gl.glCullFace(GL.GL_FRONT); drawSurfaces(surfaces, BACK); ! gl.glDisable(GL.GL_CULL_FACE); gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); --- 1128,1138 ---- gl.glPolygonOffset(0.5f, 0.5f); gl.glEnable(GL.GL_CULL_FACE); ! gl.glCullFace(GL.GL_BACK); drawSurfaces(surfaces, FRONT); ! gl.glCullFace(GL.GL_FRONT); drawSurfaces(surfaces, BACK); ! gl.glDisable(GL.GL_CULL_FACE); gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); *************** *** 1137,1145 **** drawGeneralEdges(space.getEdges(), !active); } Collection elements = space.getElements(); Iterator iter = elements.iterator(); while (iter.hasNext()) { Space current = (Space) iter.next(); ! drawSpace(current, active, selected); } gl.glPopMatrix(); --- 1157,1168 ---- drawGeneralEdges(space.getEdges(), !active); } + Collection elements = space.getElements(); Iterator iter = elements.iterator(); while (iter.hasNext()) { Space current = (Space) iter.next(); ! if (!(current instanceof Net)) { ! drawSpace(current, active, selected); ! } } gl.glPopMatrix(); *************** *** 1517,1545 **** public void drawGeneralEdges(Collection<Edge> edges, boolean dodge) { Collection selection = Selection.primary(); - gl.glLineWidth(1.0f); for (Edge current : edges) { ! float[] color = lineColor; ! if (selection.contains(current)) { ! color = SELECTED_COLOR; ! gl.glLineWidth(1.5f); } else { float[] individualColor = (float[])colorMap.get(current); if (individualColor != null) { ! color = individualColor; } else { if (current.getStrippled()) { ! color = constructorColor; } else if (dodge) { ! color = GREY_LINE_COLOR; } } } ! gl.glColor3fv(color, 0); ! if (current.getStrippled()) { ! drawConstructor(current); ! } else { ! drawEdge(current); ! } gl.glColor3fv(lineColor, 0); } --- 1540,1567 ---- public void drawGeneralEdges(Collection<Edge> edges, boolean dodge) { Collection selection = Selection.primary(); for (Edge current : edges) { ! EdgeAttributes style = new EdgeAttributes(); if (selection.contains(current)) { ! style.setColor(SELECTED_COLOR); ! style.setLineWidth(1.5f); ! } else if (current.getOwner() instanceof Net) { ! style.setColor(constructorColor); ! style.setLineWidth(2.0f); ! style.setStipple(true); ! style.setDrawVertices(true); } else { float[] individualColor = (float[])colorMap.get(current); if (individualColor != null) { ! style.setColor(individualColor); } else { if (current.getStrippled()) { ! style.setColor(constructorColor); ! style.setStipple(true); } else if (dodge) { ! style.setColor(GREY_LINE_COLOR); } } } ! drawEdge(current, style); gl.glColor3fv(lineColor, 0); } *************** *** 1626,1640 **** Integer list = displayLists.get(s); if (list == null) { ! //list = gl.glGenLists(1); ! //displayLists.put(s, list); ! //gl.glNewList(list, GL.GL_COMPILE); //begining the polygon, we are not using userdata for now (hence the null) glu.gluTessBeginPolygon(tess, null); //light stuff ! if (drawMode == LIGHTING_MODE) { ! Vertex norm = s.normal(); ! if (norm != null) { ! gl.glNormal3d(norm.getX(), norm.getY(), norm.getZ()); ! } } --- 1648,1660 ---- Integer list = displayLists.get(s); if (list == null) { ! list = gl.glGenLists(1); ! displayLists.put(s, list); ! gl.glNewList(list, GL.GL_COMPILE); //begining the polygon, we are not using userdata for now (hence the null) glu.gluTessBeginPolygon(tess, null); //light stuff ! Vertex norm = s.normal(); ! if (norm != null) { ! gl.glNormal3d(norm.getX(), norm.getY(), norm.getZ()); } *************** *** 1648,1652 **** while (innerIt.hasNext()) { Surface surface = (Surface)innerIt.next(); ! if (hit) { if (surface.getOwner() == s.getOwner()) { drawContour(surface, tess); --- 1668,1676 ---- while (innerIt.hasNext()) { Surface surface = (Surface)innerIt.next(); ! if (surface.getOwner() == s.getOwner()) { ! drawContour(surface, tess); ! } ! /*if (hit) { ! // Meant to prevent selecting inner geometry in a space if (surface.getOwner() == s.getOwner()) { drawContour(surface, tess); *************** *** 1654,1664 **** } else { drawContour(surface, tess); ! } } } glu.gluTessEndPolygon(tess); ! //gl.glEndList(); } ! //gl.glCallList(list); } --- 1678,1688 ---- } else { drawContour(surface, tess); ! }*/ } } glu.gluTessEndPolygon(tess); ! gl.glEndList(); } ! gl.glCallList(list); } *************** *** 1941,1945 **** private void drawSelectionMode() { Space space = Project.getInstance().getActiveSpace(); ! Collection surfaces = new LinkedList(); surfaces.addAll(space.getSurfaces()); --- 1965,1969 ---- private void drawSelectionMode() { Space space = Project.getInstance().getActiveSpace(); ! Collection<Surface> surfaces = new LinkedList<Surface>(); surfaces.addAll(space.getSurfaces()); *************** *** 1958,1969 **** edges.addAll(Surface.edges(surfaces)); edges.addAll(tempEdges); ! Collection vertices = new LinkedList(); vertices.addAll(space.getVertices()); vertices.addAll(tempVertices); if (selectionMode != OBJECTS) { ! Collection envelopeEdges = collectSupportingEdges(space); edges.addAll(envelopeEdges); ! Collection envelopeVertices = Edge.vertices(envelopeEdges); vertices.addAll(envelopeVertices); } --- 1982,1993 ---- edges.addAll(Surface.edges(surfaces)); edges.addAll(tempEdges); ! Collection<Vertex> vertices = new LinkedList<Vertex>(); vertices.addAll(space.getVertices()); vertices.addAll(tempVertices); if (selectionMode != OBJECTS) { ! Collection<Edge> envelopeEdges = collectSupportingEdges(space); edges.addAll(envelopeEdges); ! Collection<Vertex> envelopeVertices = Edge.vertices(envelopeEdges); vertices.addAll(envelopeVertices); } *************** *** 2063,2067 **** Camera camera = Project.getInstance().getCurrentCamera(); ! Collection all = new LinkedList(); all.addAll(space.getConstructors()); all.addAll(tempConstructors); --- 2087,2091 ---- Camera camera = Project.getInstance().getCurrentCamera(); ! Collection<Constructor> all = new LinkedList<Constructor>(); all.addAll(space.getConstructors()); all.addAll(tempConstructors); *************** *** 2213,2219 **** } } ! ! ! /** * FIXME edge-drawing --- 2237,2241 ---- } } ! /** * FIXME edge-drawing *************** *** 2246,2250 **** --- 2268,2277 ---- apply(attributes); drawEdge(edge); + if (attributes.getDrawVertices()) { + drawVertexHit(edge.getFrom()); + drawVertexHit(edge.getTo()); + } } + private void drawEdges(Collection<Edge> edges, EdgeAttributes attributes) { apply(attributes); *************** *** 2265,2269 **** gl.glPointSize(1.0f); } ! /** * --- 2292,2296 ---- gl.glPointSize(1.0f); } ! /** * *************** *** 3339,3341 **** --- 3366,3412 ---- widgets.remove(widget); } + + /** + * The changed entity + * @param entity the changed entity + */ + public void update(Object entity) { + log.info("Change on " + entity + " class " + entity.getClass()); + if (entity instanceof Space) { + for (Surface s : ((Space)entity).getSurfaces()) { + Integer which = displayLists.remove(s); + if (which != null) { + deletedLists.add(which); + } + } + } else if (entity instanceof Surface) { + Integer which = displayLists.remove((Surface)entity); + if (which != null) { + deletedLists.add(which); + } + } else if (entity instanceof Geometric) { + Geometric g = (Geometric)entity; + Space sp = g.getOwner(); + for (Surface s : sp.getSurfaces()) { + Integer which = displayLists.remove(s); + if (which != null) { + deletedLists.add(which); + } + } + } else if (entity instanceof Project) { + deletedLists.addAll(displayLists.values()); + displayLists.clear(); + } else if (entity instanceof Selection) { + /*for (Geometric g : (Selection)entity) { + if (g instanceof Surface) { + Integer which = displayLists.remove((Surface)g); + if (which != null) { + deletedLists.add(which); + } + } + }*/ + } else { + log.warn("There were a update event on a undecided entity " + entity.getClass()); + } + } } |
|
From: rimestad <rim...@us...> - 2007-05-07 13:39:39
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14127/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: added displaylists on surfaces and forward update call from glView to view to clear these in a consdervative manner. Better performance. Made drawGeneralEdge use drawEdge method with EdgeAttribute as well, seem to work, but look out for edge flaws :-D Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** GLView.java 7 May 2007 13:19:07 -0000 1.58 --- GLView.java 7 May 2007 13:39:39 -0000 1.59 *************** *** 427,435 **** */ public void update(Object entity) { ! if (entity == Selection.primary()) { ! repaint(); ! } else { ! repaint(); ! } } } --- 427,432 ---- */ public void update(Object entity) { ! getView().update(entity); ! repaint(); } } |
|
From: rimestad <rim...@us...> - 2007-05-07 13:39:39
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14127/src/net/sourceforge/bprocessor/gl/model Modified Files: EdgeAttributes.java Log Message: added displaylists on surfaces and forward update call from glView to view to clear these in a consdervative manner. Better performance. Made drawGeneralEdge use drawEdge method with EdgeAttribute as well, seem to work, but look out for edge flaws :-D Index: EdgeAttributes.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model/EdgeAttributes.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EdgeAttributes.java 7 Feb 2007 10:00:03 -0000 1.1 --- EdgeAttributes.java 7 May 2007 13:39:39 -0000 1.2 *************** *** 16,23 **** private boolean stipple; private float lineWidth; /** ! * Create default EdgeAttributes: black, nonstippled, and width of 1 */ public EdgeAttributes() { --- 16,24 ---- private boolean stipple; private float lineWidth; + private boolean drawVertices; /** ! * Create default EdgeAttributes: black, nonstippled, and width of 1 no vertex drawing */ public EdgeAttributes() { *************** *** 25,28 **** --- 26,30 ---- this.stipple = false; this.lineWidth = 1; + this.drawVertices = false; } *************** *** 72,75 **** --- 74,91 ---- return lineWidth; } + + /** + * @param b set the vertices to be drawn + */ + public void setDrawVertices(boolean b) { + this.drawVertices = b; + } + /** + * + * @return the drawVertices attribute + */ + public boolean getDrawVertices() { + return this.drawVertices; + } } |
|
From: rimestad <rim...@us...> - 2007-05-07 13:34:18
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12187/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: generics Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** Space.java 24 Apr 2007 12:51:17 -0000 1.137 --- Space.java 7 May 2007 13:34:18 -0000 1.138 *************** *** 519,527 **** * @return The constructors */ ! public Collection getConstructors() { if (this.isContainer()) { return constructors.values(); } else { ! return Collections.EMPTY_LIST; } } --- 519,527 ---- * @return The constructors */ ! public Collection<Constructor> getConstructors() { if (this.isContainer()) { return constructors.values(); } else { ! return Collections.emptyList(); } } *************** *** 708,712 **** tmp.add(tempedge); } else { ! log.info("Edge were very short " + edge); } } --- 708,712 ---- tmp.add(tempedge); } else { ! log.warn("Edge were very short " + edge); } } *************** *** 1608,1615 **** } if (getOwner() != null && getOwner().getModellor() != null) { - log.info("owner has modellor"); Parametric parameters = getOwner().getModellor().get(this); if (parameters != null) { - log.info("owner has parameters"); res.add(new Attribute(parameters.getGeneralName(), parameters)); } --- 1608,1613 ---- *************** *** 2422,2426 **** * @param extrusion Collection of surfaces */ ! public void removeProtected(Collection extrusion) { Iterator surfaces = extrusion.iterator(); while (surfaces.hasNext()) { --- 2420,2424 ---- * @param extrusion Collection of surfaces */ ! public void removeProtected(Collection<Surface> extrusion) { Iterator surfaces = extrusion.iterator(); while (surfaces.hasNext()) { *************** *** 2453,2456 **** --- 2451,2455 ---- } } + Project.getInstance().changed(this); } *************** *** 2459,2463 **** * @param extrusion Collection of surfaces */ ! public void addProtected(Collection extrusion) { Iterator surfaces = extrusion.iterator(); while (surfaces.hasNext()) { --- 2458,2462 ---- * @param extrusion Collection of surfaces */ ! public void addProtected(Collection<Surface> extrusion) { Iterator surfaces = extrusion.iterator(); while (surfaces.hasNext()) { |
|
From: rimestad <rim...@us...> - 2007-05-07 13:33:19
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11806/src/net/sourceforge/bprocessor/model Modified Files: Geometry.java Log Message: changed cahnge event to be on affected space and not world Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** Geometry.java 23 Apr 2007 14:57:26 -0000 1.53 --- Geometry.java 7 May 2007 13:33:12 -0000 1.54 *************** *** 434,438 **** space.insert(mesh); ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); return result; --- 434,438 ---- space.insert(mesh); ! Project.getInstance().changed(Project.getInstance().getActiveSpace()); Project.getInstance().checkpoint(); return result; |
|
From: rimestad <rim...@us...> - 2007-05-07 13:32:05
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11205/src/net/sourceforge/bprocessor/model Modified Files: CoordinateSystem.java Log Message: generics Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** CoordinateSystem.java 16 Apr 2007 15:55:22 -0000 1.50 --- CoordinateSystem.java 7 May 2007 13:32:05 -0000 1.51 *************** *** 692,697 **** * @return List of handles */ ! public List handles(double distance) { ! List list = new LinkedList(); list.add(new Tip(i, distance)); list.add(new Tip(j, distance)); --- 692,697 ---- * @return List of handles */ ! public List<Vertex> handles(double distance) { ! List<Vertex> list = new LinkedList<Vertex>(); list.add(new Tip(i, distance)); list.add(new Tip(j, distance)); |
|
From: rimestad <rim...@us...> - 2007-05-07 13:31:10
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10921/src/net/sourceforge/bprocessor/model Modified Files: ClippingPlane.java Log Message: generics Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClippingPlane.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ClippingPlane.java 16 Apr 2007 15:55:22 -0000 1.19 --- ClippingPlane.java 7 May 2007 13:31:09 -0000 1.20 *************** *** 36,43 **** /** The corners */ ! private ArrayList corners; /** The silluet */ ! private ArrayList silluet; /** The edge map */ --- 36,43 ---- /** The corners */ ! private ArrayList<Vertex> corners; /** The silluet */ ! private ArrayList<Edge> silluet; /** The edge map */ *************** *** 61,66 **** this.isActive = true; this.plane = cs.plane(); ! this.silluet = new ArrayList(); ! this.corners = new ArrayList(); this.toModel = new HashMap(); Project.getInstance().addObserver(this); --- 61,66 ---- this.isActive = true; this.plane = cs.plane(); ! this.silluet = new ArrayList<Edge>(); ! this.corners = new ArrayList<Vertex>(); this.toModel = new HashMap(); Project.getInstance().addObserver(this); *************** *** 139,143 **** * @return The corners */ ! public Collection getCorners() { if (corners.isEmpty()) { update(); --- 139,143 ---- * @return The corners */ ! public Collection<Vertex> getCorners() { if (corners.isEmpty()) { update(); *************** *** 150,155 **** * @return the set of vertices */ ! public Set collect() { ! Set result = new HashSet(); result.add(center()); return result; --- 150,155 ---- * @return the set of vertices */ ! public Set<Vertex> collect() { ! Set<Vertex> result = new HashSet<Vertex>(); result.add(center()); return result; *************** *** 178,182 **** * @return The intersection edges */ ! public Collection getLines() { return silluet; } --- 178,182 ---- * @return The intersection edges */ ! public Collection<Edge> getLines() { return silluet; } *************** *** 189,198 **** * @return The set of all intersection vertices */ ! public Collection findIntersections() { toModel.clear(); Space space = Project.getInstance().getActiveSpace(); Collection edges = Geometry.getActiveEdges(space); silluet.clear(); ! Collection res = new ArrayList(); Plane plan = cs.plane(); Iterator it = edges.iterator(); --- 189,198 ---- * @return The set of all intersection vertices */ ! public Collection<Vertex> findIntersections() { toModel.clear(); Space space = Project.getInstance().getActiveSpace(); Collection edges = Geometry.getActiveEdges(space); silluet.clear(); ! Collection<Vertex> res = new ArrayList<Vertex>(); Plane plan = cs.plane(); Iterator it = edges.iterator(); *************** *** 260,264 **** Vertex v4 = system.translate((Vertex)corners.get(3)); v4.setZ(0); ! corners = new ArrayList(); corners.add(system.unTranslate(v1)); corners.add(system.unTranslate(v2)); --- 260,264 ---- Vertex v4 = system.translate((Vertex)corners.get(3)); v4.setZ(0); ! corners = new ArrayList<Vertex>(); corners.add(system.unTranslate(v1)); corners.add(system.unTranslate(v2)); *************** *** 296,300 **** v3 = system.unTranslate(v3); v4 = system.unTranslate(v4); ! corners = new ArrayList(); corners.add(v1); corners.add(v2); --- 296,300 ---- v3 = system.unTranslate(v3); v4 = system.unTranslate(v4); ! corners = new ArrayList<Vertex>(); corners.add(v1); corners.add(v2); |
|
From: rimestad <rim...@us...> - 2007-05-07 13:30:25
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10370/src/net/sourceforge/bprocessor/gl/tool Modified Files: ClipplaneTool.java Log Message: made it possible to drag the clipplane to a "better" place when placing Index: ClipplaneTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ClipplaneTool.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ClipplaneTool.java 7 Nov 2006 10:51:19 -0000 1.10 --- ClipplaneTool.java 7 May 2007 13:30:20 -0000 1.11 *************** *** 8,13 **** --- 8,17 ---- import net.sourceforge.bprocessor.gl.GLView; + import net.sourceforge.bprocessor.gl.view.Transformation; + import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.model.ClippingPlane; import net.sourceforge.bprocessor.model.CoordinateSystem; + import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Surface; *************** *** 26,29 **** --- 30,36 ---- /** The logger */ private static Logger log = Logger.getLogger(ClipplaneTool.class); + private ClippingPlane cp; + private Vertex previous; + private Plane dragplane; /** *************** *** 56,60 **** system = new CoordinateSystem(i, j, n, o); ! ClippingPlane cp = new ClippingPlane(system); if (Project.getInstance().getCurrentCamera().getClipplanes().size() < glv.getView().getMaxClipPlanes()) { --- 63,67 ---- system = new CoordinateSystem(i, j, n, o); ! cp = new ClippingPlane(system); if (Project.getInstance().getCurrentCamera().getClipplanes().size() < glv.getView().getMaxClipPlanes()) { *************** *** 62,65 **** --- 69,83 ---- Project.getInstance().changed(Project.getInstance().getCurrentCamera()); } + + View view = glv.getView(); + previous = view.toPlaneCoords(e.getX(), e.getY(), cp.getPlane()); + Transformation trans = view.transformation(); + double x = e.getX(); + double y = View.getHeight() - e.getY(); + Vertex near = new Vertex(x, y, 0.0); + Vertex far = new Vertex(x, y, 1.0); + Edge ray = new Edge(near, far); + ray = trans.unProject(ray); + dragplane = surface.plane().orthogonalPlane(ray); } } *************** *** 82,86 **** */ protected void dragged(MouseEvent e) { ! } --- 100,109 ---- */ protected void dragged(MouseEvent e) { ! if (cp != null) { ! Vertex to = glv.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); ! Vertex delta = to.minus(previous); ! cp.move(delta.getX(), delta.getY(), delta.getZ()); ! previous = to; ! } } *************** *** 89,93 **** */ protected void released(MouseEvent e) { ! } } --- 112,116 ---- */ protected void released(MouseEvent e) { ! cp = null; } } |
|
From: rimestad <rim...@us...> - 2007-05-07 13:29:56
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9942/src/net/sourceforge/bprocessor/gl/tool Modified Files: RelationTool.java SpaceTool.java ExtrusionTool.java AltMoveTool.java AbstractPencil.java Protractor.java ArcTool.java EdgeMoveTool.java Log Message: Made all tools implement onvertex to make them act on length field input Index: RelationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RelationTool.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RelationTool.java 13 Mar 2007 14:37:37 -0000 1.4 --- RelationTool.java 7 May 2007 13:29:48 -0000 1.5 *************** *** 81,85 **** */ protected void pressed(MouseEvent e) { ! onVertex(e); moved(e); } --- 81,85 ---- */ protected void pressed(MouseEvent e) { ! onVertex(); moved(e); } *************** *** 94,103 **** source = null; } - /** ! * Current vertex is pressed ! * @param e The event that resulted in this call */ ! public void onVertex(MouseEvent e) { if (source == null) { if (target != null) { --- 94,102 ---- source = null; } /** ! * {@inheritDoc} */ ! @Override ! public void onVertex() { if (source == null) { if (target != null) { Index: ArcTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ArcTool.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ArcTool.java 10 Oct 2006 15:00:26 -0000 1.14 --- ArcTool.java 7 May 2007 13:29:48 -0000 1.15 *************** *** 31,34 **** --- 31,36 ---- /** Radius of the current arc */ private double radius = 0; + + private Intersection first; /** *************** *** 37,44 **** */ protected void updateFeedback() { ! if (start != null) { if (end != null) { ! Edge e1 = new Edge(start.vertex(), current.vertex()); Edge e2 = new Edge(current.vertex(), end.vertex()); Collection edges = new LinkedList(); --- 39,46 ---- */ protected void updateFeedback() { ! if (first != null) { if (end != null) { ! Edge e1 = new Edge(first.vertex(), current.vertex()); Edge e2 = new Edge(current.vertex(), end.vertex()); Collection edges = new LinkedList(); *************** *** 46,52 **** edges.add(e2); ! feedback(createArc(start.vertex(), current.vertex(), end.vertex(), false)); } else { ! Edge edge = new Edge(start.vertex(), current.vertex()); Collection edges = new LinkedList(); edges.add(edge); --- 48,54 ---- edges.add(e2); ! feedback(createArc(first.vertex(), current.vertex(), end.vertex(), false)); } else { ! Edge edge = new Edge(first.vertex(), current.vertex()); Collection edges = new LinkedList(); edges.add(edge); *************** *** 182,200 **** /** * @param e MouseEvent */ protected void pressed(MouseEvent e) { if (current != null) { ! if (start == null) { ! start = current; active = true; } else { if (end == null) { end = current; } else { ! Geometry.insertEdges(createArc(start.vertex(), current.vertex(), end.vertex(), false)); ! start = null; ! end = null; ! active = false; } } --- 184,214 ---- /** + * {@inheritDoc} + */ + @Override + public void onVertex() { + Geometry.insertEdges(createArc(first.vertex(), current.vertex(), end.vertex(), false)); + first = null; + end = null; + active = false; + cleanUp(); + } + + /** * @param e MouseEvent */ protected void pressed(MouseEvent e) { if (current != null) { ! if (first == null) { ! first = current; active = true; } else { if (end == null) { end = current; + Vertex between = end.vertex().minus(first.vertex()); + between.scale(0.5); + start = new Intersection(first.vertex().add(between), Intersection.VERTEX, null); } else { ! onVertex(); } } *************** *** 220,223 **** --- 234,238 ---- public void cleanUp() { super.cleanUp(); + first = null; end = null; } Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** ExtrusionTool.java 7 May 2007 13:19:07 -0000 1.55 --- ExtrusionTool.java 7 May 2007 13:29:48 -0000 1.56 *************** *** 416,419 **** --- 416,427 ---- /** + * {@inheritDoc} + */ + @Override + public void onVertex() { + + } + + /** * Apply current tool with specified length value * @param length The lengthfield value Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** AbstractPencil.java 7 May 2007 13:19:07 -0000 1.75 --- AbstractPencil.java 7 May 2007 13:29:48 -0000 1.76 *************** *** 25,28 **** --- 25,29 ---- import net.sourceforge.bprocessor.gl.view.Transformation; import net.sourceforge.bprocessor.gl.view.View; + import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.CoordinateSystem; *************** *** 666,672 **** * onVertex - current vertex is pressed */ ! public void onVertex() { ! log.info("onVertex"); ! } /** --- 667,671 ---- * onVertex - current vertex is pressed */ ! public abstract void onVertex(); /** *************** *** 675,679 **** */ public void apply(double length) { - log.info("general-apply(" + length + ")"); if (current != null) { Vertex before = null; --- 674,677 ---- *************** *** 693,696 **** --- 691,696 ---- } } + } else { + GUI.getInstance().alert("No action to apply the given length on"); } } Index: EdgeMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/EdgeMoveTool.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EdgeMoveTool.java 23 Mar 2007 15:27:23 -0000 1.2 --- EdgeMoveTool.java 7 May 2007 13:29:49 -0000 1.3 *************** *** 56,60 **** } ! private void move(Vertex to) { --- 56,68 ---- } ! /** ! * {@inheritDoc} ! */ ! @Override ! public void onVertex() { ! move(current.vertex()); ! start = null; ! cleanUp(); ! } private void move(Vertex to) { Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** SpaceTool.java 14 Apr 2007 15:00:52 -0000 1.72 --- SpaceTool.java 7 May 2007 13:29:48 -0000 1.73 *************** *** 9,12 **** --- 9,13 ---- import java.awt.Cursor; + import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; *************** *** 26,30 **** --- 27,33 ---- import javax.swing.JMenu; import javax.swing.JMenuItem; + import javax.swing.JPanel; import javax.swing.JPopupMenu; + import javax.swing.JScrollPane; import org.apache.log4j.Logger; *************** *** 324,328 **** glv.getView().makeTarget(null); Selection.primary().set(space); - Project.getInstance().changed(Project.getInstance()); } } --- 327,330 ---- *************** *** 336,340 **** glv.getView().makeTarget(null); space.edit(); - Project.getInstance().changed(Project.getInstance()); } } --- 338,341 ---- *************** *** 347,350 **** --- 348,352 ---- Selection.primary().set(spaceCopy); glv.changeTool(Tool.MOVE_TOOL); + space.getOwner().changed(); } } *************** *** 374,397 **** JMenu funcMenu = new JMenu("Functional " + category + "s"); JMenu constMenu = new JMenu("Construction " + category + "s"); ! if (domains != null) { Iterator domIt = domains.iterator(); while (domIt.hasNext()) { Space domain = (Space)domIt.next(); ! if (domain instanceof Space) { ! JMenuItem domainItem = new JMenuItem(domain.getDisplayName()); ! ActionListener ml = new DomainPopupListener(domain, ! surface, ! side.equals("front")); ! domainItem.addActionListener(ml); ! if (domain.isFunctionalSpace()) { ! funcMenu.add(domainItem); ! } else { ! constMenu.add(domainItem); ! } } } } funcMenu.addSeparator(); funcMenu.add(createFuncItem); --- 376,408 ---- JMenu funcMenu = new JMenu("Functional " + category + "s"); + JPanel funcs = new JPanel(); + JScrollPane funcScroll = new JScrollPane(funcs, + JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, + JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); + funcScroll.setSize(new Dimension(150, 400)); + funcScroll.setPreferredSize(new Dimension(150, 400)); JMenu constMenu = new JMenu("Construction " + category + "s"); ! JScrollPane constScroll = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, ! JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); ! constScroll.setSize(new Dimension(150, 400)); ! constScroll.setPreferredSize(new Dimension(150, 400)); if (domains != null) { Iterator domIt = domains.iterator(); while (domIt.hasNext()) { Space domain = (Space)domIt.next(); ! JMenuItem domainItem = new JMenuItem(domain.getDisplayName()); ! ActionListener ml = new DomainPopupListener(domain, ! surface, ! side.equals("front")); ! domainItem.addActionListener(ml); ! if (domain.isFunctionalSpace()) { ! funcs.add(domainItem); ! } else { ! constMenu.add(domainItem); } + domainItem.setFocusTraversalPolicyProvider(false); } } + funcMenu.add(funcScroll); funcMenu.addSeparator(); funcMenu.add(createFuncItem); Index: AltMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AltMoveTool.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** AltMoveTool.java 21 Apr 2007 13:35:59 -0000 1.10 --- AltMoveTool.java 7 May 2007 13:29:48 -0000 1.11 *************** *** 50,54 **** } ! private void move(Vertex to) { --- 50,60 ---- } ! /** ! * {@inheritDoc} ! */ ! @Override ! public void onVertex() { ! ! } private void move(Vertex to) { Index: Protractor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Protractor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Protractor.java 7 Sep 2006 11:38:41 -0000 1.5 --- Protractor.java 7 May 2007 13:29:48 -0000 1.6 *************** *** 72,75 **** --- 72,85 ---- /** + * {@inheritDoc} + */ + @Override + public void onVertex() { + Line l = createConstructor(start.vertex(), current.vertex()); + Geometry.insertConstructor(l); + start = null; + } + + /** * @param e MouseEven */ *************** *** 78,84 **** start = current; } else { ! Line l = createConstructor(start.vertex(), current.vertex()); ! Geometry.insertConstructor(l); ! start = null; } updateFeedback(); --- 88,92 ---- start = current; } else { ! onVertex(); } updateFeedback(); |
|
From: Michael L. <he...@us...> - 2007-05-07 13:19:09
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5467/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: length related small time fixes Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** GLView.java 3 May 2007 11:18:17 -0000 1.57 --- GLView.java 7 May 2007 13:19:07 -0000 1.58 *************** *** 213,224 **** } } - - /** - * Set the length in the lengthField display - * @param length The new length - */ - public void setLength(double length) { - lengthField.setText(length); - } /** --- 213,216 ---- *************** *** 229,240 **** lengthField.setText(value); } - - /** - * Get the length - * @return The length - */ - public double getLength() { - return lengthField.getDouble(); - } /** --- 221,224 ---- |
|
From: Michael L. <he...@us...> - 2007-05-07 13:19:08
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5467/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java ExtrusionTool.java AbstractPencil.java Log Message: length related small time fixes Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** ExtrusionTool.java 29 Mar 2007 12:38:20 -0000 1.54 --- ExtrusionTool.java 7 May 2007 13:19:07 -0000 1.55 *************** *** 452,460 **** value = -value; } ! this.setLength(value); } else if (extrudeEdges != null) { ! this.setLength(distance); } else { ! glv.setLengthValue(""); } } --- 452,460 ---- value = -value; } ! setLength(value); } else if (extrudeEdges != null) { ! setLength(distance); } else { ! clearLength(); } } Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** AbstractPencil.java 23 Mar 2007 15:27:23 -0000 1.74 --- AbstractPencil.java 7 May 2007 13:19:07 -0000 1.75 *************** *** 484,488 **** setLength(edge.getLength()); } else { ! glv.setLengthValue(""); } } --- 484,488 ---- setLength(edge.getLength()); } else { ! clearLength(); } } *************** *** 715,719 **** try { double d = Double.parseDouble(number); ! glv.setLength(d / 1000); } catch (NumberFormatException exp) { log.warn(exp); --- 715,719 ---- try { double d = Double.parseDouble(number); ! setLength(d / 1000); } catch (NumberFormatException exp) { log.warn(exp); *************** *** 781,785 **** try { double d = Double.parseDouble(number); ! glv.setLength(d / 1000); } catch (NumberFormatException exp) { log.warn(exp); --- 781,785 ---- try { double d = Double.parseDouble(number); ! setLength(d / 1000); } catch (NumberFormatException exp) { log.warn(exp); Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.115 retrieving revision 1.116 diff -C2 -d -r1.115 -r1.116 *** AbstractTool.java 14 Apr 2007 15:00:52 -0000 1.115 --- AbstractTool.java 7 May 2007 13:19:07 -0000 1.116 *************** *** 217,220 **** --- 217,227 ---- /** + * + */ + public void clearLength() { + glv.setLengthValue(""); + } + + /** * See if surface has become a hole in a surface in * the project. *************** *** 562,566 **** */ public void cleanUp() { ! glv.setLengthValue(""); typing = false; } --- 569,573 ---- */ public void cleanUp() { ! clearLength(); typing = false; } |
|
From: Michael L. <he...@us...> - 2007-05-07 09:48:59
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16942/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: A little progress on surface sorting Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** GenericTreeView.java 14 Apr 2007 15:00:42 -0000 1.95 --- GenericTreeView.java 7 May 2007 09:48:51 -0000 1.96 *************** *** 509,513 **** int[] ins = new int[sorted.size()]; int i = 0; ! for (Object current : entities) { this.add(nodeFor(current)); ins[i] = this.getChildCount() - 1; --- 509,513 ---- int[] ins = new int[sorted.size()]; int i = 0; ! for (Object current : sorted) { this.add(nodeFor(current)); ins[i] = this.getChildCount() - 1; |
|
From: Michael L. <he...@us...> - 2007-05-07 09:48:54
|
Update of /cvsroot/bprocessor/test/src/net/sourceforge/bprocessor/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16929/src/net/sourceforge/bprocessor/test Modified Files: SurfaceAngles.java Log Message: A little progress on surface sorting Index: SurfaceAngles.java =================================================================== RCS file: /cvsroot/bprocessor/test/src/net/sourceforge/bprocessor/test/SurfaceAngles.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SurfaceAngles.java 19 Apr 2007 13:38:50 -0000 1.1 --- SurfaceAngles.java 7 May 2007 09:48:47 -0000 1.2 *************** *** 10,13 **** --- 10,14 ---- import java.io.File; import java.util.Collection; + import java.util.Collections; import java.util.LinkedList; import java.util.List; *************** *** 18,21 **** --- 19,23 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Surface; + import net.sourceforge.bprocessor.model.SurfaceSorter; import net.sourceforge.bprocessor.model.Vertex; *************** *** 45,55 **** private static void printEdge(Edge edge) { Collection<Surface> surfaces = edge.getSurfaces(); ! List<Surface> sorted = new LinkedList(surfaces); ! Entity.sort(sorted); ! Vertex direction = edge.getDirection(); ! System.out.println("" + edge.getId() + " direction: " + direction); ! for (Surface surface : sorted) { ! Vertex normal = surface.normal(); ! System.out.println(" " + surface.getId() + " normal: " + normal); } } --- 47,62 ---- private static void printEdge(Edge edge) { Collection<Surface> surfaces = edge.getSurfaces(); ! if (surfaces.size() > 1) { ! List<Surface> sorted = new LinkedList(surfaces); ! Collections.shuffle(sorted); ! SurfaceSorter sorter = new SurfaceSorter(edge); ! System.out.println("sorting " + sorted); ! sorted = sorter.sort(sorted); ! Vertex direction = edge.getDirection(); ! System.out.println("" + edge.getId() + " direction: " + direction); ! for (Surface surface : sorted) { ! Vertex normal = surface.normal(); ! System.out.println(" " + surface.getId() + " normal: " + normal); ! } } } |
|
From: Michael L. <he...@us...> - 2007-05-07 09:48:51
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16915/src/net/sourceforge/bprocessor/model Modified Files: SurfaceSorter.java Sorter.java Log Message: A little progress on surface sorting Index: SurfaceSorter.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SurfaceSorter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SurfaceSorter.java 3 May 2007 09:40:38 -0000 1.1 --- SurfaceSorter.java 7 May 2007 09:48:44 -0000 1.2 *************** *** 27,31 **** Vertex normal = surface.normal(); Vertex direction = edge.getDirection(); ! return null; } } --- 27,31 ---- Vertex normal = surface.normal(); Vertex direction = edge.getDirection(); ! return new Entry(surface, 0 , 1); } } Index: Sorter.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Sorter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Sorter.java 3 May 2007 09:40:38 -0000 1.3 --- Sorter.java 7 May 2007 09:48:44 -0000 1.4 *************** *** 65,79 **** /** * Sort a list of edges around some vertex ! * @param edges List of edges ! * @return Sorted list of edges */ ! public List<T> sort(List<T> edges) { List result = new LinkedList(); ! if (!edges.isEmpty()) { { List left = new LinkedList(); List right = new LinkedList(); ! for (T current : edges) { Entry entry = entryFor(current); if (entry.dx == 0) { --- 65,79 ---- /** * Sort a list of edges around some vertex ! * @param objects List of objects to sort ! * @return Sorted list of objects */ ! public List<T> sort(List<T> objects) { List result = new LinkedList(); ! if (!objects.isEmpty()) { { List left = new LinkedList(); List right = new LinkedList(); ! for (T current : objects) { Entry entry = entryFor(current); if (entry.dx == 0) { |
|
From: rimestad <rim...@us...> - 2007-05-04 11:59:39
|
Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19172/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: made tesslator init a single time event should be faster, and tried to use displayLists for cashing of tesslation, seems to work fine, there just have to be introduced some kind og time stamp for geometry to know when to remake the way to draw. There have to be found a settlement for how small displaylist there are reasonable Index: View.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.201 retrieving revision 1.202 diff -C2 -d -r1.201 -r1.202 *** View.java 15 Apr 2007 10:43:08 -0000 1.201 --- View.java 4 May 2007 11:59:26 -0000 1.202 *************** *** 377,380 **** --- 377,384 ---- private int maxClippingPlanes; + private GLUtessellator tess; + + private HashMap<Surface, Integer> displayLists = new HashMap<Surface, Integer>(); + static { setTransparency(100); *************** *** 506,510 **** bg.add(but); but.setToolTipText("Wireframe"); ! but.setMnemonic(KeyEvent.VK_F7); } --- 510,514 ---- bg.add(but); but.setToolTipText("Wireframe"); ! but.setMnemonic(KeyEvent.VK_F7); } *************** *** 538,542 **** gld.setGL(new DebugGL(gld.getGL())); glu = new GLU(); ! int[] maxplanes = new int[1]; gl.glGetIntegerv(GL.GL_MAX_CLIP_PLANES, maxplanes, 0); --- 542,556 ---- gld.setGL(new DebugGL(gld.getGL())); glu = new GLU(); ! ! //INITIALIZE TESSELATOR ! tess = glu.gluNewTess(); ! GLUtessellatorCallback cb = new Callback(); ! //Setting callbacks ! glu.gluTessCallback(tess, GLU.GLU_TESS_BEGIN, cb); ! glu.gluTessCallback(tess, GLU.GLU_TESS_END, cb); ! glu.gluTessCallback(tess, GLU.GLU_TESS_VERTEX, cb); ! //Contours contained in an even number of contours are filled ! glu.gluTessProperty(tess, GLU.GLU_TESS_WINDING_RULE, GLU.GLU_TESS_WINDING_ODD); ! int[] maxplanes = new int[1]; gl.glGetIntegerv(GL.GL_MAX_CLIP_PLANES, maxplanes, 0); *************** *** 1601,1605 **** } } ! } } --- 1615,1619 ---- } } ! } } *************** *** 1610,1654 **** */ private void drawSurface(Surface s, boolean hit) { ! GLUtessellator tess = glu.gluNewTess(); ! GLUtessellatorCallback cb = new Callback(); ! ! //Setting callbacks ! glu.gluTessCallback(tess, GLU.GLU_TESS_BEGIN, cb); ! glu.gluTessCallback(tess, GLU.GLU_TESS_END, cb); ! glu.gluTessCallback(tess, GLU.GLU_TESS_VERTEX, cb); ! ! //Contours contained in an even number of contours are filled ! glu.gluTessProperty(tess, GLU.GLU_TESS_WINDING_RULE, GLU.GLU_TESS_WINDING_ODD); ! ! //begining the polygon, we are not using userdata for now (hence the null) ! glu.gluTessBeginPolygon(tess, null); ! //light stuff ! if (drawMode == LIGHTING_MODE) { ! Vertex norm = s.normal(); ! if (norm != null) { ! gl.glNormal3d(norm.getX(), norm.getY(), norm.getZ()); } - } ! //drawing the outer contour ! drawContour(s, tess); ! //drawing the inner conturs ! Collection innerSurfaces = s.getHoles(); ! if (innerSurfaces != null) { ! Iterator innerIt = innerSurfaces.iterator(); ! while (innerIt.hasNext()) { ! Surface surface = (Surface)innerIt.next(); ! if (hit) { ! if (surface.getOwner() == s.getOwner()) { drawContour(surface, tess); } - } else { - drawContour(surface, tess); } } } ! glu.gluTessEndPolygon(tess); ! glu.gluDeleteTess(tess); } --- 1624,1664 ---- */ private void drawSurface(Surface s, boolean hit) { ! Integer list = displayLists.get(s); ! if (list == null) { ! //list = gl.glGenLists(1); ! //displayLists.put(s, list); ! //gl.glNewList(list, GL.GL_COMPILE); ! //begining the polygon, we are not using userdata for now (hence the null) ! glu.gluTessBeginPolygon(tess, null); ! //light stuff ! if (drawMode == LIGHTING_MODE) { ! Vertex norm = s.normal(); ! if (norm != null) { ! gl.glNormal3d(norm.getX(), norm.getY(), norm.getZ()); ! } } ! //drawing the outer contour ! drawContour(s, tess); ! //drawing the inner conturs ! Collection innerSurfaces = s.getHoles(); ! if (innerSurfaces != null) { ! Iterator innerIt = innerSurfaces.iterator(); ! while (innerIt.hasNext()) { ! Surface surface = (Surface)innerIt.next(); ! if (hit) { ! if (surface.getOwner() == s.getOwner()) { ! drawContour(surface, tess); ! } ! } else { drawContour(surface, tess); } } } + glu.gluTessEndPolygon(tess); + //gl.glEndList(); } ! //gl.glCallList(list); } |
|
From: rimestad <rim...@us...> - 2007-05-04 11:53:17
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16270/src/net/sourceforge/bprocessor/model/modellor Modified Files: TileModellor.java Log Message: some minor changes to the tile modellor Index: TileModellor.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/modellor/TileModellor.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TileModellor.java 24 Apr 2007 12:51:17 -0000 1.11 --- TileModellor.java 4 May 2007 11:52:58 -0000 1.12 *************** *** 12,18 **** --- 12,20 ---- import java.util.Collections; import java.util.Comparator; + import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; + import java.util.Set; import org.apache.log4j.Logger; *************** *** 23,26 **** --- 25,29 ---- import net.sourceforge.bprocessor.model.Material; import net.sourceforge.bprocessor.model.Net; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; *************** *** 82,85 **** --- 85,89 ---- space.add(tileColor); updateNet(startPoint); + Project.getInstance().addObserver(this); } } *************** *** 106,112 **** updateNet(startPoint); space.add(net); //generate the tiles from the net ! /*Surface outer = surface.copyall(space); Collection<Surface> surs = net.getSurfaces(); int lvl = space.getLevel() + 1; --- 110,120 ---- updateNet(startPoint); space.add(net); + int sign = 1; + if (surface.getBackDomain() == space) { + sign = -1; + } //generate the tiles from the net ! Surface outer = surface.copyall(space); Collection<Surface> surs = net.getSurfaces(); int lvl = space.getLevel() + 1; *************** *** 118,134 **** space.addAll(newS); Space sp = new Space("Tile", Space.CONSTRUCTION, lvl, true); ! newS.setBackDomain(sp); ! newS.setFrontMaterial(tileColor); space.add(sp); } Space joint = new Space("Tile", Space.CONSTRUCTION, lvl, true); ! outer.setBackDomain(joint); ! outer.setFrontMaterial(jointMatetrial); Collection<Surface> tmp = new LinkedList<Surface>(); Set<Surface> tmp2 = new HashSet<Surface>(); ! tmp.add(outer.extrusionall(-((double)tileThickness / 1000), tmp, tmp2)); space.addAll(tmp); ! space.addAll(tmp2);*/ } --- 126,152 ---- 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); } Space joint = new Space("Tile", Space.CONSTRUCTION, lvl, true); ! if (sign == -1) { ! outer.setBackDomain(joint); ! outer.setFrontMaterial(jointMatetrial); ! } else { ! outer.setFrontDomain(joint); ! outer.setBackMaterial(jointMatetrial); ! } Collection<Surface> tmp = new LinkedList<Surface>(); Set<Surface> tmp2 = new HashSet<Surface>(); ! tmp.add(outer.extrusionall(sign * ((double)tileThickness / 1000), tmp, tmp2)); space.addAll(tmp); ! space.addAll(tmp2); } *************** *** 333,345 **** } a = attributes.get("Surface"); ! if (a != null) { ! Surface tmp = (Surface)a.getValue(); ! if (space.getEnvelope().contains(tmp)) { ! if (!tmp.equals(surface)) { ! surface = tmp; ! startPoint = surface.coordinateSystem(); ! updateNet = true; } } } a = attributes.get("Setting height"); --- 351,369 ---- } a = attributes.get("Surface"); ! if (a != null && a.getValue() != null) { ! Surface chosen = null; ! for (Surface cur : space.getEnvelope()) { ! if (cur.getName().equalsIgnoreCase((String)a.getValue())) { ! chosen = cur; } } + if (chosen != null) { + surface = chosen; + space.getOwner().remove(startPoint); + startPoint = surface.coordinateSystem(); + space.getOwner().add(startPoint); + startPoint.relate(surface); + updateNet = true; + } } a = attributes.get("Setting height"); *************** *** 414,417 **** --- 438,442 ---- height = (Integer)o; } + Project.getInstance().addObserver(this); } |
|
From: Michael L. <he...@us...> - 2007-05-03 11:18:24
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32103/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: re enabled the focus request Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** GLView.java 3 May 2007 09:59:18 -0000 1.56 --- GLView.java 3 May 2007 11:18:17 -0000 1.57 *************** *** 428,432 **** */ public void mouseEntered(MouseEvent arg0) { ! //glc.requestFocusInWindow(); } --- 428,432 ---- */ public void mouseEntered(MouseEvent arg0) { ! glc.requestFocusInWindow(); } |
|
From: Michael L. <he...@us...> - 2007-05-03 09:59:18
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv409/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: Tja Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** GLView.java 3 May 2007 09:40:42 -0000 1.55 --- GLView.java 3 May 2007 09:59:18 -0000 1.56 *************** *** 70,73 **** --- 70,75 ---- public GLView() { GLCapabilities glCap = new GLCapabilities(); + glCap.setDoubleBuffered(true); + glCap.setHardwareAccelerated(true); glc = new GLCanvas(glCap); log.info("Using JOGL version official"); *************** *** 75,80 **** Project.getInstance().addStaticObserver(this); - glCap.setDoubleBuffered(true); - glCap.setHardwareAccelerated(true); GUI.getInstance().incrementPB(); --- 77,80 ---- |