bprocessor-commit Mailing List for B-processor (Page 148)
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...> - 2005-12-11 17:27:27
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31544/src/net/sourceforge/bprocessor/model/xml Modified Files: PersistenceManager.java Log Message: Removed part and element Index: PersistenceManager.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/xml/PersistenceManager.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PersistenceManager.java 29 Nov 2005 19:05:26 -0000 1.12 --- PersistenceManager.java 11 Dec 2005 17:27:19 -0000 1.13 *************** *** 15,21 **** import net.sourceforge.bprocessor.model.xml.impl.ConstructionspaceImpl; import net.sourceforge.bprocessor.model.xml.impl.EdgeImpl; - import net.sourceforge.bprocessor.model.xml.impl.ElementImpl; import net.sourceforge.bprocessor.model.xml.impl.FunctionalspaceImpl; - import net.sourceforge.bprocessor.model.xml.impl.PartImpl; import net.sourceforge.bprocessor.model.xml.impl.SurfaceImpl; import net.sourceforge.bprocessor.model.xml.impl.VertexImpl; --- 15,19 ---- *************** *** 95,100 **** loadConstructionSpace(bp.getConstructionspace()); loadFunctionalSpace(bp.getFunctionalspace()); - loadElement(bp.getElement()); - loadPart(bp.getPart()); loadSurface(bp.getSurface()); loadEdge(bp.getEdge()); --- 93,96 ---- *************** *** 104,109 **** loadRefConstructionSpace(bp.getConstructionspace(), attribs); loadRefFunctionalSpace(bp.getFunctionalspace(), attribs); - loadRefElement(bp.getElement(), attribs); - loadRefPart(bp.getPart(), attribs); loadRefSurface(bp.getSurface(), attribs); loadRefEdge(bp.getEdge(), attribs); --- 100,103 ---- *************** *** 170,211 **** /** - * Load element - * @param l The list - */ - private static void loadElement(List l) { - Iterator it = l.iterator(); - while (it.hasNext()) { - net.sourceforge.bprocessor.model.xml.Element e = - (net.sourceforge.bprocessor.model.xml.Element)it.next(); - - net.sourceforge.bprocessor.model.Element em = - new net.sourceforge.bprocessor.model.Element(e.getName()); - - Project.getInstance().intern(em); - - mapper.put(new Long(e.getId()), em.getId()); - } - } - - /** - * Load part - * @param l The list - */ - private static void loadPart(List l) { - Iterator it = l.iterator(); - while (it.hasNext()) { - net.sourceforge.bprocessor.model.xml.Part p = - (net.sourceforge.bprocessor.model.xml.Part)it.next(); - - net.sourceforge.bprocessor.model.Part pm = - new net.sourceforge.bprocessor.model.Part(p.getName()); - - Project.getInstance().intern(pm); - - mapper.put(new Long(p.getId()), pm.getId()); - } - } - - /** * Load surface * @param l The list --- 164,167 ---- *************** *** 313,328 **** csm.setSurfaces(sr); } - List es = cs.getElementref(); - if (es != null && es.size() > 0) { - Set er = new HashSet(); - Iterator ies = es.iterator(); - while (ies.hasNext()) { - Long eid = (Long)mapper.get((Long)ies.next()); - net.sourceforge.bprocessor.model.Element e = - Project.getInstance().findElementById(eid); - er.add(e); - } - csm.setElements(er); - } Project.getInstance().update(csm); } --- 269,272 ---- *************** *** 367,382 **** fsm.setSurfaces(sr); } - List es = fs.getElementref(); - if (es != null && es.size() > 0) { - Set er = new HashSet(); - Iterator ies = es.iterator(); - while (ies.hasNext()) { - Long eid = (Long)mapper.get((Long)ies.next()); - net.sourceforge.bprocessor.model.Element e = - Project.getInstance().findElementById(eid); - er.add(e); - } - fsm.setElements(er); - } Project.getInstance().update(fsm); } --- 311,314 ---- *************** *** 388,489 **** * @param attribs The attributes */ - private static void loadRefElement(List l, Map attribs) { - Iterator it = l.iterator(); - while (it.hasNext()) { - net.sourceforge.bprocessor.model.xml.Element e = - (net.sourceforge.bprocessor.model.xml.Element)it.next(); - - Long id = (Long)mapper.get(new Long(e.getId())); - net.sourceforge.bprocessor.model.Element em = - Project.getInstance().findElementById(id); - - List as = e.getAttributeref(); - if (as != null && as.size() > 0) { - Set ar = new HashSet(); - Iterator ias = as.iterator(); - while (ias.hasNext()) { - Long aid = (Long)mapper.get((Long)ias.next()); - net.sourceforge.bprocessor.model.Attribute a = - (net.sourceforge.bprocessor.model.Attribute)attribs.get(aid); - ar.add(a); - } - em.setAttributes(ar); - } - List ss = e.getSurfaceref(); - if (ss != null && ss.size() > 0) { - Set sr = new HashSet(); - Iterator iss = ss.iterator(); - while (iss.hasNext()) { - Long sid = (Long)mapper.get((Long)iss.next()); - net.sourceforge.bprocessor.model.Surface s = - Project.getInstance().findSurfaceById(sid); - sr.add(s); - } - em.setSurfaces(sr); - } - List ps = e.getPartref(); - if (ps != null && ps.size() > 0) { - Set pr = new HashSet(); - Iterator ips = ps.iterator(); - while (ips.hasNext()) { - Long pid = (Long)mapper.get((Long)ips.next()); - net.sourceforge.bprocessor.model.Part p = - Project.getInstance().findPartById(pid); - pr.add(p); - } - em.setParts(pr); - } - Project.getInstance().update(em); - } - } - - /** - * Create the references - * @param l The list - * @param attribs The attributes - */ - private static void loadRefPart(List l, Map attribs) { - Iterator it = l.iterator(); - while (it.hasNext()) { - net.sourceforge.bprocessor.model.xml.Part p = - (net.sourceforge.bprocessor.model.xml.Part)it.next(); - - Long id = (Long)mapper.get(new Long(p.getId())); - net.sourceforge.bprocessor.model.Part pm = - Project.getInstance().findPartById(id); - - List as = p.getAttributeref(); - if (as != null && as.size() > 0) { - Set ar = new HashSet(); - Iterator ias = as.iterator(); - while (ias.hasNext()) { - Long aid = (Long)mapper.get((Long)ias.next()); - net.sourceforge.bprocessor.model.Attribute a = - (net.sourceforge.bprocessor.model.Attribute)attribs.get(aid); - ar.add(a); - } - pm.setAttributes(ar); - } - List ss = p.getSurfaceref(); - if (ss != null && ss.size() > 0) { - Set sr = new HashSet(); - Iterator iss = ss.iterator(); - while (iss.hasNext()) { - Long sid = (Long)mapper.get((Long)iss.next()); - net.sourceforge.bprocessor.model.Surface s = - Project.getInstance().findSurfaceById(sid); - sr.add(s); - } - pm.setSurfaces(sr); - } - Project.getInstance().update(pm); - } - } - - /** - * Create the references - * @param l The list - * @param attribs The attributes - */ private static void loadRefSurface(List l, Map attribs) { Iterator it = l.iterator(); --- 320,323 ---- *************** *** 613,619 **** saveConstructionSpace(bp, project.getConstructionSpaces()); saveEdge(bp, project.getEdges()); - saveElement(bp, project.getElements()); saveFunctionalSpace(bp, project.getFunctionalSpaces()); - savePart(bp, project.getParts()); saveSurface(bp, project.getSurfaces()); saveVertex(bp, project.getVertices()); --- 447,451 ---- *************** *** 623,629 **** saveRefConstructionSpace(bp, project.getConstructionSpaces()); saveRefEdge(bp, project.getEdges()); - saveRefElement(bp, project.getElements()); saveRefFunctionalSpace(bp, project.getFunctionalSpaces()); - saveRefPart(bp, project.getParts()); saveRefSurface(bp, project.getSurfaces()); saveRefVertex(bp, project.getVertices()); --- 455,459 ---- *************** *** 720,789 **** /** - * Save the element - * @param bp The BProcessor document - * @param es The elements - */ - private static void saveElement(Bprocessor bp, Set es) { - Iterator i = es.iterator(); - while (i.hasNext()) { - net.sourceforge.bprocessor.model.Element e = - (net.sourceforge.bprocessor.model.Element)i.next(); - net.sourceforge.bprocessor.model.xml.Element ex = new ElementImpl(); - - ex.setId(counter++); - ex.setName(e.getName()); - - Set data = e.getAttributes(); - Iterator it = data.iterator(); - while (it.hasNext()) { - net.sourceforge.bprocessor.model.Attribute a = - (net.sourceforge.bprocessor.model.Attribute)it.next(); - - Long aid = saveAttribute(bp, a); - - ex.getAttributeref().add(aid); - } - - Map em = (Map)mapper.get(KEY_ELEMENT); - em.put(e.getId(), new Long(ex.getId())); - - bp.getElement().add(ex); - } - } - - /** - * Save the part - * @param bp The BProcessor document - * @param ps The parts - */ - private static void savePart(Bprocessor bp, Set ps) { - Iterator i = ps.iterator(); - while (i.hasNext()) { - net.sourceforge.bprocessor.model.Part p = - (net.sourceforge.bprocessor.model.Part)i.next(); - net.sourceforge.bprocessor.model.xml.Part px = new PartImpl(); - - px.setId(counter++); - px.setName(p.getName()); - - Set data = p.getAttributes(); - Iterator it = data.iterator(); - while (it.hasNext()) { - net.sourceforge.bprocessor.model.Attribute a = - (net.sourceforge.bprocessor.model.Attribute)it.next(); - - Long aid = saveAttribute(bp, a); - - px.getAttributeref().add(aid); - } - - Map pm = (Map)mapper.get(KEY_PART); - pm.put(p.getId(), new Long(px.getId())); - - bp.getPart().add(px); - } - } - - /** * Save the surface * @param bp The BProcessor document --- 550,553 ---- *************** *** 878,894 **** csx.getSurfaceref().add(m.get(s.getId())); } - - data = cs.getElements(); - if (data != null) { - it = data.iterator(); - while (it.hasNext()) { - net.sourceforge.bprocessor.model.Element e = - (net.sourceforge.bprocessor.model.Element)it.next(); - - Map m = (Map)mapper.get(KEY_ELEMENT); - - csx.getElementref().add(m.get(e.getId())); - } - } } } --- 642,645 ---- *************** *** 935,949 **** fsx.getSurfaceref().add(m.get(s.getId())); } - - data = fs.getElements(); - it = data.iterator(); - while (it.hasNext()) { - net.sourceforge.bprocessor.model.Element e = - (net.sourceforge.bprocessor.model.Element)it.next(); - - Map m = (Map)mapper.get(KEY_ELEMENT); - - fsx.getElementref().add(m.get(e.getId())); - } } } --- 686,689 ---- *************** *** 968,1079 **** return null; } ! ! /** ! * Save the element references ! * @param bp The BProcessor document ! * @param es The elements ! */ ! private static void saveRefElement(Bprocessor bp, Set es) { ! Iterator i = es.iterator(); ! while (i.hasNext()) { ! net.sourceforge.bprocessor.model.Element e = ! (net.sourceforge.bprocessor.model.Element)i.next(); ! net.sourceforge.bprocessor.model.xml.Element ex = findElement(bp, e); ! ! Set data = e.getSurfaces(); ! Iterator it = data.iterator(); ! while (it.hasNext()) { ! net.sourceforge.bprocessor.model.Surface s = ! (net.sourceforge.bprocessor.model.Surface)it.next(); ! ! Map m = (Map)mapper.get(KEY_SURFACE); ! ! ex.getSurfaceref().add(m.get(s.getId())); ! } ! ! data = e.getParts(); ! it = data.iterator(); ! while (it.hasNext()) { ! net.sourceforge.bprocessor.model.Part p = ! (net.sourceforge.bprocessor.model.Part)it.next(); ! ! Map m = (Map)mapper.get(KEY_PART); ! ! ex.getPartref().add(m.get(p.getId())); ! } ! } ! } ! ! /** ! * Find the element ! * @param bp The BProcessor document ! * @param e The element ! * @return The element ! */ ! private static net.sourceforge.bprocessor.model.xml.Element ! findElement(Bprocessor bp, net.sourceforge.bprocessor.model.Element e) { ! ! Map m = (Map)mapper.get(KEY_ELEMENT); ! Long id = (Long)m.get(e.getId()); ! ! Iterator it = bp.getElement().iterator(); ! while (it.hasNext()) { ! net.sourceforge.bprocessor.model.xml.Element ex = ! (net.sourceforge.bprocessor.model.xml.Element)it.next(); ! if (ex.getId() == id.longValue()) { ! return ex; ! } ! } ! return null; ! } ! ! /** ! * Save the part references ! * @param bp The BProcessor document ! * @param ps The parts ! */ ! private static void saveRefPart(Bprocessor bp, Set ps) { ! Iterator i = ps.iterator(); ! while (i.hasNext()) { ! net.sourceforge.bprocessor.model.Part p = ! (net.sourceforge.bprocessor.model.Part)i.next(); ! net.sourceforge.bprocessor.model.xml.Part px = findPart(bp, p); ! ! Set data = p.getSurfaces(); ! Iterator it = data.iterator(); ! while (it.hasNext()) { ! net.sourceforge.bprocessor.model.Surface s = ! (net.sourceforge.bprocessor.model.Surface)it.next(); ! ! Map m = (Map)mapper.get(KEY_SURFACE); ! ! px.getSurfaceref().add(m.get(s.getId())); ! } ! } ! } ! ! /** ! * Find the part ! * @param bp The BProcessor document ! * @param p The part ! * @return The part ! */ ! private static net.sourceforge.bprocessor.model.xml.Part ! findPart(Bprocessor bp, net.sourceforge.bprocessor.model.Part p) { ! ! Map m = (Map)mapper.get(KEY_PART); ! Long id = (Long)m.get(p.getId()); ! ! Iterator it = bp.getPart().iterator(); ! while (it.hasNext()) { ! net.sourceforge.bprocessor.model.xml.Part px = ! (net.sourceforge.bprocessor.model.xml.Part)it.next(); ! if (px.getId() == id.longValue()) { ! return px; ! } ! } ! return null; ! } ! /** * Save the surface references --- 708,712 ---- return null; } ! /** * Save the surface references |
|
From: Michael L. <he...@us...> - 2005-12-11 13:33:26
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24069/src/net/sourceforge/bprocessor/gl/tool Modified Files: PencilTool.java Log Message: Less constructors in pencil Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** PencilTool.java 9 Dec 2005 15:39:17 -0000 1.47 --- PencilTool.java 11 Dec 2005 13:33:14 -0000 1.48 *************** *** 647,651 **** if (target instanceof Vertex) { Vertex vertex = (Vertex) target; ! setSnapVertex(vertex); } } --- 647,653 ---- if (target instanceof Vertex) { Vertex vertex = (Vertex) target; ! if (vertex.getId() != null) { ! setSnapVertex(vertex); ! } } } |
|
From: Michael L. <he...@us...> - 2005-12-11 13:06:52
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19771/src/net/sourceforge/bprocessor/gl/view Modified Files: AbstractView.java View3D.java Log Message: Different Hit-Detection Index: AbstractView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/AbstractView.java,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** AbstractView.java 6 Dec 2005 16:53:54 -0000 1.71 --- AbstractView.java 11 Dec 2005 13:06:41 -0000 1.72 *************** *** 930,934 **** Surface s = (Surface)it.next(); pushName(gl, s); ! drawSurface(s, false); popName(gl); } --- 930,934 ---- Surface s = (Surface)it.next(); pushName(gl, s); ! drawSurface(s); popName(gl); } *************** *** 937,941 **** Surface s = (Surface)tempSurfaceIt.next(); pushName(gl, s); ! drawSurface(s, false); popName(gl); } --- 937,941 ---- Surface s = (Surface)tempSurfaceIt.next(); pushName(gl, s); ! drawSurface(s); popName(gl); } *************** *** 1050,1054 **** gl.glPolygonStipple(highlight); Surface s = (Surface) o; ! drawSurface(s, false); gl.glDisable(GL.GL_POLYGON_STIPPLE); } --- 1050,1054 ---- gl.glPolygonStipple(highlight); Surface s = (Surface) o; ! drawSurface(s); gl.glDisable(GL.GL_POLYGON_STIPPLE); } *************** *** 1058,1064 **** * Draw a surface * @param s The surface to draw - * @param flip Flip the surface */ ! private void drawSurface(Surface s, boolean flip) { GLUtesselator tess = glu.gluNewTess(); GLUtesselatorCallback cb = new Callback(); --- 1058,1063 ---- * Draw a surface * @param s The surface to draw */ ! private void drawSurface(Surface s) { GLUtesselator tess = glu.gluNewTess(); GLUtesselatorCallback cb = new Callback(); *************** *** 1079,1095 **** if (norm != null) { norm.scale(1 / norm.length()); ! if (flip) { ! gl.glNormal3d(-norm.getX(), -norm.getY(), -norm.getZ()); ! } else { ! gl.glNormal3d(norm.getX(), norm.getY(), norm.getZ()); ! } } } //drawing the outer contour ! if (flip) { ! drawContourReverse(s, tess); ! } else { ! drawContour(s, tess); ! } //drawing the inner conturs Set innerSurfaces = s.getInnerSurfaces(); --- 1078,1086 ---- if (norm != null) { norm.scale(1 / norm.length()); ! gl.glNormal3d(norm.getX(), norm.getY(), norm.getZ()); } } //drawing the outer contour ! drawContour(s, tess); //drawing the inner conturs Set innerSurfaces = s.getInnerSurfaces(); *************** *** 1196,1200 **** */ private void drawVertexHit(Vertex v) { ! gl.glPointSize(7.0f); gl.glBegin(GL.GL_POINTS); gl.glVertex3d(v.getX(), v.getY(), v.getZ()); --- 1187,1191 ---- */ private void drawVertexHit(Vertex v) { ! gl.glPointSize(10.0f); gl.glBegin(GL.GL_POINTS); gl.glVertex3d(v.getX(), v.getY(), v.getZ()); *************** *** 1275,1300 **** if (isVisible(s)) { if (side == FRONT) { - // TODO check if a surface has a color assigned to - // the front and use that. - - // Where are drawing the front of the surface, so - // we should use the color of the Space associated with the - // back. - Domain back = s.getBackDomain(); gl.glColor3fv(getSpaceColor(back)); } if (side == BACK) { - // TODO check if a surface has a color assigned to - // the back and use that. - - // Where are drawing the back of the surface, so - // we should use the color of the Space associated with the - // front. - Domain front = s.getFrontDomain(); gl.glColor3fv(getSpaceColor(front)); } ! drawSurface(s, false); } } --- 1266,1277 ---- if (isVisible(s)) { if (side == FRONT) { Domain back = s.getBackDomain(); gl.glColor3fv(getSpaceColor(back)); } if (side == BACK) { Domain front = s.getFrontDomain(); gl.glColor3fv(getSpaceColor(front)); } ! drawSurface(s); } } *************** *** 1364,1372 **** } }; - // Iterator iter = surfaces.iterator(); - // while (iter.hasNext()) { - // Surface current = (Surface) iter.next(); - // drawSurface(current); - // } } } --- 1341,1344 ---- *************** *** 1490,1528 **** } - - /** - * Processes the select buffer - * @return the ID of the closest hit and -1 if no hit. - */ - private int processSelectSimple() { - //Processing hits - int bufferOffset = 0; - int names = 0; - long zMax = 0xFFFFFFFFL; - double nearest = 1.0; - int id = -1; - for (int i = 0; i < hits; i++) { - names = selectBuffer.get(bufferOffset); - if (names > 0) { - bufferOffset++; - long z1 = 0xFFFFFFFFL & selectBuffer.get(bufferOffset); - long z2 = 0xFFFFFFFFL & selectBuffer.get(bufferOffset + 1); - double near = (double) z1 / (double) zMax; - double far = (double) z2 / (double) zMax; - - bufferOffset += 2; - if (near < nearest) { - nearest = near; - id = selectBuffer.get(bufferOffset); - } - bufferOffset += names; - } else { - bufferOffset += 3; - } - } - - return id; - } - /** * Processes the select buffer --- 1462,1465 ---- *************** *** 1535,1545 **** --- 1472,1487 ---- long zMax = 0xFFFFFFFFL; double nearest = 1.0; + double nearestConstructor = 1.0; int id = -1; + Edge closestConstructor = null; Object closest = null; Object current = null; + Object candidate = null; Set vertices = new HashSet(); Set edges = new HashSet(); + Set constructors = new HashSet(); + for (int i = 0; i < hits; i++) { names = selectBuffer.get(bufferOffset); *************** *** 1554,1565 **** id = selectBuffer.get(bufferOffset); current = getName(id); if (current instanceof Vertex) { vertices.add(current); } else if (current instanceof Edge) { ! edges.add(current); } ! if (near < nearest) { ! nearest = near; ! closest = current; } bufferOffset += names; --- 1496,1521 ---- id = selectBuffer.get(bufferOffset); current = getName(id); + boolean isConstructor = false; if (current instanceof Vertex) { vertices.add(current); } else if (current instanceof Edge) { ! Edge e = (Edge) current; ! if (e.getConstructor()) { ! isConstructor = true; ! constructors.add(e); ! } else { ! edges.add(current); ! } } ! if (isConstructor) { ! if (near < nearestConstructor) { ! nearestConstructor = near; ! closestConstructor = (Edge) current; ! } ! } else { ! if (near < nearest) { ! nearest = near; ! closest = current; ! } } bufferOffset += names; *************** *** 1568,1603 **** } } if (closest instanceof Surface) { Surface surface = (Surface) closest; CoordinateSystem system = surface.coordinateSystem(); ! // Look for a Vertex { Iterator iter = vertices.iterator(); ! while (iter.hasNext()) { ! // TODO Find the clost point measured as XY distance in ! // the closest surface Vertex v = (Vertex) iter.next(); - // Test if v is in the same plane as the closest surface Vertex vLocal = system.translate(v); if (Math.abs(vLocal.getZ()) < 0.0000000001) { ! selection.add(v); ! return selection; } } } - // Look for an Edge { Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! // TODO Find the two closest edges measured as XY distance in ! // the closest surface Edge e = (Edge) iter.next(); Vertex from = e.getFrom(); Vertex to = e.getTo(); - // Test if from and to are in the same plane as the closest surface Vertex fromLocal = system.translate(from); Vertex toLocal = system.translate(to); --- 1524,1557 ---- } } + + if (closest instanceof ClippingPlane) { + selection.add(closest); + return selection; + } + if (closest instanceof Surface) { Surface surface = (Surface) closest; CoordinateSystem system = surface.coordinateSystem(); ! { Iterator iter = vertices.iterator(); ! while (iter.hasNext() && (candidate == null)) { Vertex v = (Vertex) iter.next(); Vertex vLocal = system.translate(v); if (Math.abs(vLocal.getZ()) < 0.0000000001) { ! candidate = v; } } } { Iterator iter = edges.iterator(); ! while (iter.hasNext() && (candidate == null)) { Edge e = (Edge) iter.next(); Vertex from = e.getFrom(); Vertex to = e.getTo(); Vertex fromLocal = system.translate(from); Vertex toLocal = system.translate(to); *************** *** 1606,1651 **** if (fromIn && vertices.contains(from)) { ! selection.add(from); ! return selection; } if (toIn && vertices.contains(to)) { ! selection.add(to); ! return selection; } if (fromIn && toIn) { ! selection.add(e); } } } - if (!selection.isEmpty()) { - return selection; - } } if (closest instanceof Edge) { Edge edge = (Edge) closest; if (vertices.contains(edge.getFrom())) { ! selection.add(edge.getFrom()); ! return selection; } if (vertices.contains(edge.getTo())) { ! selection.add(edge.getTo()); ! return selection; } ! selection.add(edge); ! Iterator iter = edges.iterator(); while (iter.hasNext()) { ! Object o = iter.next(); ! if (o != edge) { ! selection.add(o); } } return selection; } - if (closest instanceof ClippingPlane) { - ClippingPlane cp = (ClippingPlane) closest; - } - selection.add(closest); - return selection; } --- 1560,1654 ---- if (fromIn && vertices.contains(from)) { ! candidate = from; ! break; } if (toIn && vertices.contains(to)) { ! candidate = to; ! break; } if (fromIn && toIn) { ! candidate = e; ! break; } } } } if (closest instanceof Edge) { Edge edge = (Edge) closest; if (vertices.contains(edge.getFrom())) { ! candidate = edge.getFrom(); } if (vertices.contains(edge.getTo())) { ! candidate = edge.getTo(); } ! } ! if (candidate != null) { ! closest = candidate; ! } ! ! if (closest == null) { ! selection.add(closestConstructor); ! Iterator iter = constructors.iterator(); while (iter.hasNext()) { ! Edge c = (Edge) iter.next(); ! if (c != closestConstructor) { ! selection.add(c); } } return selection; + } else { + if (closest instanceof Edge) { + selection.add(closest); + if (closestConstructor != null) { + selection.add(closestConstructor); + Iterator iter = constructors.iterator(); + while (iter.hasNext()) { + Edge c = (Edge) iter.next(); + if (c != closestConstructor) { + selection.add(c); + } + } + } + return selection; + } + if (closest instanceof Surface) { + if (nearestConstructor < nearest) { + if (closestConstructor != null) { + selection.add(closestConstructor); + Iterator iter = constructors.iterator(); + while (iter.hasNext()) { + Edge c = (Edge) iter.next(); + if (c != closestConstructor) { + selection.add(c); + } + } + return selection; + } + } else { + Surface surface = (Surface) closest; + CoordinateSystem system = surface.coordinateSystem(); + Iterator iter = constructors.iterator(); + while (iter.hasNext()) { + Edge e = (Edge) iter.next(); + Vertex from = e.getFrom(); + Vertex to = e.getTo(); + Vertex fromLocal = system.translate(from); + Vertex toLocal = system.translate(to); + boolean fromIn = (Math.abs(fromLocal.getZ()) < 0.0000000001); + boolean toIn = (Math.abs(toLocal.getZ()) < 0.0000000001); + + if (fromIn && toIn) { + selection.add(e); + } + } + if (!selection.isEmpty()) { + return selection; + } + } + } + selection.add(closest); + return selection; } } *************** *** 1661,1668 **** this.y = y; - // indicating that I am trying to pick picking = 10; selectMode = ALL; - //repainting to get selection buffer glv.repaint(true); --- 1664,1669 ---- Index: View3D.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View3D.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** View3D.java 1 Dec 2005 10:10:02 -0000 1.24 --- View3D.java 11 Dec 2005 13:06:41 -0000 1.25 *************** *** 85,89 **** if (picking > 0) { int[] viewport = new int[] {0, 0, (int)width, (int)height}; ! glu.gluPickMatrix(x, viewport[3] - y, 5, 5, viewport); } --- 85,89 ---- if (picking > 0) { int[] viewport = new int[] {0, 0, (int)width, (int)height}; ! glu.gluPickMatrix(x, viewport[3] - y, 10, 10, viewport); } |
|
From: Michael L. <he...@us...> - 2005-12-09 15:42:19
|
Update of /cvsroot/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28121 Modified Files: .classpath Log Message: Removed hibernate as required library in Eclipse .classpath Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/model/.classpath,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .classpath 29 Sep 2005 09:28:33 -0000 1.2 --- .classpath 9 Dec 2005 15:42:10 -0000 1.3 *************** *** 5,9 **** <classpathentry kind="lib" path="lib/log4j.jar"/> <classpathentry kind="lib" path="lib/jaxb.jar"/> - <classpathentry kind="lib" path="lib/hibernate3.jar"/> <classpathentry kind="src" path="/kernel"/> <classpathentry kind="lib" path="build/code"/> --- 5,8 ---- |
|
From: Michael L. <he...@us...> - 2005-12-09 15:39:30
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27479/src/net/sourceforge/bprocessor/gl/tool Modified Files: PencilTool.java Log Message: Small fix in PencilTool - avoid interning vertices when clicking on constructor.. Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** PencilTool.java 8 Dec 2005 10:33:36 -0000 1.46 --- PencilTool.java 9 Dec 2005 15:39:17 -0000 1.47 *************** *** 347,355 **** Set es = Project.getInstance().findEdge(vertex); if (es.size() > 0) { - intern(vertex); Iterator iter = es.iterator(); while (iter.hasNext()) { Edge e = (Edge) iter.next(); ! e.split(vertex); } } --- 347,357 ---- Set es = Project.getInstance().findEdge(vertex); if (es.size() > 0) { Iterator iter = es.iterator(); while (iter.hasNext()) { Edge e = (Edge) iter.next(); ! if (!e.getConstructor()) { ! intern(vertex); ! e.split(vertex); ! } } } |
|
From: Michael L. <he...@us...> - 2005-12-08 23:21:59
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27518/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Removed some superfluous updating Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** Surface.java 5 Dec 2005 07:53:46 -0000 1.51 --- Surface.java 8 Dec 2005 23:21:48 -0000 1.52 *************** *** 683,694 **** */ public void setBackDomain(Domain back) { ! if (backDomain != null) { ! backDomain.removeSurface(this); ! } ! backDomain = back; ! if (backDomain != null) { ! backDomain.addSurface(this); } - Project.getInstance().update(this); } --- 683,696 ---- */ public void setBackDomain(Domain back) { ! if (backDomain != back) { ! if (backDomain != null) { ! backDomain.removeSurface(this); ! } ! backDomain = back; ! if (backDomain != null) { ! backDomain.addSurface(this); ! } ! Project.getInstance().update(this); } } *************** *** 708,719 **** */ public void setFrontDomain(Domain front) { ! if (frontDomain != null) { ! frontDomain.removeSurface(this); ! } ! frontDomain = front; ! if (frontDomain != null) { ! frontDomain.addSurface(this); } - Project.getInstance().update(this); } --- 710,723 ---- */ public void setFrontDomain(Domain front) { ! if (frontDomain != front) { ! if (frontDomain != null) { ! frontDomain.removeSurface(this); ! } ! frontDomain = front; ! if (frontDomain != null) { ! frontDomain.addSurface(this); ! } ! Project.getInstance().update(this); } } |
|
From: Michael L. <he...@us...> - 2005-12-08 10:33:44
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9547/src/net/sourceforge/bprocessor/gl/tool Modified Files: PencilTool.java Log Message: Fix of edge-splitting in PencilTool Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** PencilTool.java 6 Dec 2005 16:51:25 -0000 1.45 --- PencilTool.java 8 Dec 2005 10:33:36 -0000 1.46 *************** *** 344,360 **** } if (active == null) { edges = new ArrayList(); intern(vertex); - if (splitE1 != null) { - if (!splitE1.getConstructor()) { - splitE1.split(vertex); - } - } - if (splitE2 != null) { - if (!splitE2.getConstructor()) { - splitE2.split(vertex); - } - } from = vertex; to = new Vertex("Mouse", vertex.getX(), vertex.getY(), vertex.getZ()); --- 344,362 ---- } + { + Set es = Project.getInstance().findEdge(vertex); + if (es.size() > 0) { + intern(vertex); + Iterator iter = es.iterator(); + while (iter.hasNext()) { + Edge e = (Edge) iter.next(); + e.split(vertex); + } + } + } + if (active == null) { edges = new ArrayList(); intern(vertex); from = vertex; to = new Vertex("Mouse", vertex.getX(), vertex.getY(), vertex.getZ()); *************** *** 362,379 **** glv.getView().setActiveEdge(active); } else { - // The following lines of code are there to make sure - // that a Surface is finished when clicking an edge.. - if (splitE1 != null) { - if (!splitE1.getConstructor()) { - intern(vertex); - splitE1.split(vertex); - } - } - if (splitE2 != null) { - if (!splitE2.getConstructor()) { - intern(vertex); - splitE2.split(vertex); - } - } if (vertex.getId() == null) { intern(vertex); --- 364,367 ---- |
|
From: Nordholt <nor...@us...> - 2005-12-06 16:56:20
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5677 Modified Files: GLView.java Log Message: added call to tools cleanUp() method before changing tool Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** GLView.java 3 Dec 2005 12:27:21 -0000 1.27 --- GLView.java 6 Dec 2005 16:56:13 -0000 1.28 *************** *** 101,104 **** --- 101,106 ---- JMenuItem lineItem = new JMenuItem("Line Color"); lineItem.addActionListener(colorMenuListener); + JMenuItem constructorItem = new JMenuItem("Constructor Line Color"); + constructorItem.addActionListener(colorMenuListener); JMenuItem bgItem = new JMenuItem("Background Color"); bgItem.addActionListener(colorMenuListener); *************** *** 110,113 **** --- 112,116 ---- colorMenu.add(gridItem); colorMenu.add(lineItem); + colorMenu.add(constructorItem); colorMenu.add(bgItem); colorMenu.add(noneItem); *************** *** 138,142 **** * @param mode The new tool */ ! public void changeTool(int mode) { glc.removeMouseListener(tool); glc.removeMouseMotionListener(tool); --- 141,147 ---- * @param mode The new tool */ ! public void changeTool(int mode) { ! tool.cleanUp(); ! this.repaint(true); glc.removeMouseListener(tool); glc.removeMouseMotionListener(tool); |
|
From: Nordholt <nor...@us...> - 2005-12-06 16:55:35
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5511 Modified Files: GLColorMenuActionListener.java Log Message: made color of construction lines customizable Index: GLColorMenuActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLColorMenuActionListener.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GLColorMenuActionListener.java 3 Dec 2005 12:27:21 -0000 1.3 --- GLColorMenuActionListener.java 6 Dec 2005 16:55:25 -0000 1.4 *************** *** 53,66 **** public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("Grid Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), "Grid Color", Color.white); view.setGridColor(newColor.getRGBComponents(null)); } else if (e.getActionCommand().equals("Line Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), "Line Color", Color.white); view.setLineColor(newColor.getRGBComponents(null)); } else if (e.getActionCommand().equals("Background Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), "Background Color", Color.white); view.setBGColor(newColor.getRGBComponents(null)); } else if (e.getActionCommand().equals("None Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), "None Color", Color.white); view.setNoneColor(newColor.getRGBComponents(null)); } else if (e.getActionCommand().equals("Default")) { --- 53,79 ---- public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("Grid Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), ! "Grid Color", ! Color.white); view.setGridColor(newColor.getRGBComponents(null)); } else if (e.getActionCommand().equals("Line Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), ! "Line Color", ! Color.white); view.setLineColor(newColor.getRGBComponents(null)); + } else if (e.getActionCommand().equals("Constructor Line Color")) { + Color newColor = JColorChooser.showDialog(GUI.getInstance(), + "Constructor Line Color", + Color.white); + view.setConstructorColor(newColor.getRGBComponents(null)); } else if (e.getActionCommand().equals("Background Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), ! "Background Color", ! Color.white); view.setBGColor(newColor.getRGBComponents(null)); } else if (e.getActionCommand().equals("None Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), ! "None Color", ! Color.white); view.setNoneColor(newColor.getRGBComponents(null)); } else if (e.getActionCommand().equals("Default")) { |
|
From: Nordholt <nor...@us...> - 2005-12-06 16:54:03
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5259 Modified Files: AbstractView.java View.java Log Message: made the color of construction lines seperate from other lines, had to rearrange drawAll a bit because it got to long (damn checkstyle) Index: AbstractView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/AbstractView.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** AbstractView.java 5 Dec 2005 17:37:53 -0000 1.70 --- AbstractView.java 6 Dec 2005 16:53:54 -0000 1.71 *************** *** 74,79 **** private static final int BACK = 2; - - /** The width of the window */ protected static double width; --- 74,77 ---- *************** *** 106,109 **** --- 104,110 ---- protected static float[] gridColor; + /** The current constructor color */ + protected static float[] constructorColor; + /** Front color for surfaces */ protected static float[] frontCcolor = new float[] {0.96f, 0.87f, 0.70f}; *************** *** 265,268 **** --- 266,270 ---- lineColor = STD_LINE_COLOR; gridColor = GRID_COLOR; + constructorColor = CONSTRUCTOR_COLOR; tempEdges = new HashSet(); tempSurfaces = new HashSet(); *************** *** 770,774 **** } } ! // Draw edges if (doDrawEdges) { gl.glLineWidth(1.0f); --- 772,776 ---- } } ! //Draw edges if (doDrawEdges) { gl.glLineWidth(1.0f); *************** *** 778,782 **** while (eit.hasNext()) { Edge e = (Edge)eit.next(); ! drawEdge(e); } //draw all temporary edges. --- 780,790 ---- while (eit.hasNext()) { Edge e = (Edge)eit.next(); ! if (e.getConstructor()) { ! gl.glColor3fv(constructorColor); ! drawEdge(e); ! gl.glColor3fv(lineColor); ! } else { ! drawEdge(e); ! } } //draw all temporary edges. *************** *** 784,788 **** while (tempEdgeIt.hasNext()) { Edge e = (Edge)tempEdgeIt.next(); ! drawEdge(e); } } --- 792,802 ---- while (tempEdgeIt.hasNext()) { Edge e = (Edge)tempEdgeIt.next(); ! if (e.getConstructor()) { ! gl.glColor3fv(constructorColor); ! drawEdge(e); ! gl.glColor3fv(lineColor); ! } else { ! drawEdge(e); ! } } } *************** *** 864,932 **** } } else { ! // HERE STARTS SELECTION MODE DRAWING ! if (selectMode == VERTICES || selectMode == ALL) { ! Iterator it = vertices.iterator(); ! gl.glColor3fv(lineColor); ! while (it.hasNext()) { ! Vertex v = (Vertex)it.next(); ! pushName(gl, v); ! drawVertexHit(v); ! popName(gl); ! } ! Iterator tempVerticesIt = tempVertices.iterator(); ! while (tempVerticesIt.hasNext()) { ! Vertex v = (Vertex)tempVerticesIt.next(); ! pushName(gl, v); ! drawVertexHit(v); ! popName(gl); ! } } ! if (selectMode == EDGES || selectMode == ALL) { ! Iterator it = edges.iterator(); ! gl.glColor3fv(lineColor); ! while (it.hasNext()) { ! Edge e = (Edge)it.next(); ! pushName(gl, e); ! drawEdge(e); ! popName(gl); ! } ! Iterator tempEdgeIt = tempEdges.iterator(); ! while (tempEdgeIt.hasNext()) { ! Edge e = (Edge)tempEdgeIt.next(); ! pushName(gl, e); ! drawEdge(e); ! popName(gl); ! } } ! if (selectMode == SURFACES || selectMode == ALL) { ! Iterator it = surfaces.iterator(); ! gl.glColor3fv(SURFACE_COLOR); ! while (it.hasNext()) { ! Surface s = (Surface)it.next(); ! pushName(gl, s); ! drawSurface(s, false); ! popName(gl); ! } ! Iterator tempSurfaceIt = tempSurfaces.iterator(); ! while (tempSurfaceIt.hasNext()) { ! Surface s = (Surface)tempSurfaceIt.next(); ! pushName(gl, s); ! drawSurface(s, false); ! popName(gl); ! } } ! if (selectMode == CLIPPLANES || selectMode == ALL) { ! Iterator it = clippingPlanes.iterator(); ! while (it.hasNext()) { ! ClippingPlane cp = (ClippingPlane)it.next(); ! gl.glDisable(GL.GL_CLIP_PLANE0 + cp.getNumber()); ! pushName(gl, cp); ! drawClipplaneFrame(cp); ! popName(gl); ! } } } } ! /** * Draw the frame of a clippingplane --- 878,956 ---- } } else { ! drawSelectionMode(vertices, edges, surfaces); ! } ! } ! ! /** ! * Draws the objects for selection ! * @param vertices the set of vertices that should be selectable ! * @param edges the set of edges that should be selectable ! * @param surfaces the set of surfaces that should be selectable ! */ ! private void drawSelectionMode(Set vertices, Set edges, Set surfaces) { ! // HERE STARTS SELECTION MODE DRAWING ! if (selectMode == VERTICES || selectMode == ALL) { ! Iterator it = vertices.iterator(); ! gl.glColor3fv(lineColor); ! while (it.hasNext()) { ! Vertex v = (Vertex)it.next(); ! pushName(gl, v); ! drawVertexHit(v); ! popName(gl); } ! Iterator tempVerticesIt = tempVertices.iterator(); ! while (tempVerticesIt.hasNext()) { ! Vertex v = (Vertex)tempVerticesIt.next(); ! pushName(gl, v); ! drawVertexHit(v); ! popName(gl); } ! } ! if (selectMode == EDGES || selectMode == ALL) { ! Iterator it = edges.iterator(); ! gl.glColor3fv(lineColor); ! while (it.hasNext()) { ! Edge e = (Edge)it.next(); ! pushName(gl, e); ! drawEdge(e); ! popName(gl); } ! Iterator tempEdgeIt = tempEdges.iterator(); ! while (tempEdgeIt.hasNext()) { ! Edge e = (Edge)tempEdgeIt.next(); ! pushName(gl, e); ! drawEdge(e); ! popName(gl); ! } ! } ! if (selectMode == SURFACES || selectMode == ALL) { ! Iterator it = surfaces.iterator(); ! gl.glColor3fv(SURFACE_COLOR); ! while (it.hasNext()) { ! Surface s = (Surface)it.next(); ! pushName(gl, s); ! drawSurface(s, false); ! popName(gl); ! } ! Iterator tempSurfaceIt = tempSurfaces.iterator(); ! while (tempSurfaceIt.hasNext()) { ! Surface s = (Surface)tempSurfaceIt.next(); ! pushName(gl, s); ! drawSurface(s, false); ! popName(gl); ! } ! } ! if (selectMode == CLIPPLANES || selectMode == ALL) { ! Iterator it = clippingPlanes.iterator(); ! while (it.hasNext()) { ! ClippingPlane cp = (ClippingPlane)it.next(); ! gl.glDisable(GL.GL_CLIP_PLANE0 + cp.getNumber()); ! pushName(gl, cp); ! drawClipplaneFrame(cp); ! popName(gl); } } } ! /** * Draw the frame of a clippingplane *************** *** 1902,1905 **** --- 1926,1937 ---- noneColor = color; } + + /** + * Sets the color of constructors. + * @param color the color + */ + public void setConstructorColor(float[] color) { + constructorColor = color; + } /** Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** View.java 3 Dec 2005 12:27:21 -0000 1.26 --- View.java 6 Dec 2005 16:53:54 -0000 1.27 *************** *** 66,69 **** --- 66,72 ---- /** Used for target objects */ public static final float[] TARGET_COLOR = new float[] {0.8f, 0.8f, 0.1f}; + + /** Used for constructor objects */ + public static final float [] CONSTRUCTOR_COLOR = new float[] {0.8f, 0.7f, 0.6f, 0.50f}; /** Can be used for setting wireframe mode */ *************** *** 298,301 **** --- 301,310 ---- /** + * Sets the color of constructors. + * @param color the color + */ + public void setConstructorColor(float[] color); + + /** * Adds a temporary surface to be drawn. * @param s the surface |
|
From: Nordholt <nor...@us...> - 2005-12-06 16:51:36
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4690 Modified Files: PencilTool.java Log Message: Added construction lines on the snapvertex, construction lines on alignvertex are now aligned to last edge, changed how to make constructor lines and implemented clean up method to clean up any temporary constructor lines Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** PencilTool.java 5 Dec 2005 19:25:38 -0000 1.44 --- PencilTool.java 6 Dec 2005 16:51:25 -0000 1.45 *************** *** 13,16 **** --- 13,17 ---- import java.util.List; import java.util.Set; + import java.util.HashSet; import net.sourceforge.bprocessor.gl.GLView; *************** *** 46,57 **** private Edge zAxis = new Edge("z", new Vertex("", 0, 0, -50), new Vertex("", 0, 0, 50)); ! /**The x axis constructor*/ ! private Edge xConstructor; ! ! /**The y axis constructor*/ ! private Edge yConstructor; ! /**The z axis constructor*/ ! private Edge zConstructor; /** The active */ --- 47,55 ---- private Edge zAxis = new Edge("z", new Vertex("", 0, 0, -50), new Vertex("", 0, 0, 50)); ! /** The constructors from the current vertex */ ! private Set currentConstructors; ! /** The constructors from the snap vertex */ ! private Set snapConstructors; /** The active */ *************** *** 70,73 **** --- 68,74 ---- protected Vertex alignVertex = null; + /** The last align */ + protected Vertex lastAlignVertex = null; + /** The snap vertex */ protected Vertex snapVertex = null; *************** *** 76,80 **** protected Surface exterior = null; - /** The candidates are the Set of surfaces that could be the exterior * for a hole being defined. --- 77,80 ---- *************** *** 166,173 **** */ protected void setAlignVertex(Vertex vertex) { alignVertex = vertex; ! clearXYZConstructors(); if (vertex != null) { ! makeXYZConstructors(vertex); } } --- 166,175 ---- */ protected void setAlignVertex(Vertex vertex) { + lastAlignVertex = alignVertex; alignVertex = vertex; ! clearConstructors(currentConstructors); ! currentConstructors = null; if (vertex != null) { ! currentConstructors = makeXYZConstructors(vertex); } } *************** *** 179,187 **** protected void setSnapVertex(Vertex vertex) { if (vertex != alignVertex) { ! snapVertex = vertex; ! glv.getView().setSnapVertex(vertex); } } /** --- 181,198 ---- protected void setSnapVertex(Vertex vertex) { if (vertex != alignVertex) { ! if (vertex == null || alignVertex == null || ! !(Math.abs(vertex.getX() - alignVertex.getX()) < 0.00001 && ! Math.abs(vertex.getY() - alignVertex.getY()) < 0.00001 && ! Math.abs(vertex.getZ() - alignVertex.getZ()) < 0.00001)) { ! snapVertex = vertex; ! glv.getView().setSnapVertex(vertex); ! clearConstructors(snapConstructors); ! snapConstructors = makeXYZConstructors(vertex); ! } } } + + /** *************** *** 199,236 **** * from a vertex. * @param v the vertex */ ! private void makeXYZConstructors(Vertex v) { ! xConstructor = new Edge("xconst", ! xAxis.getFrom().add(v), ! xAxis.getTo().add(v)); ! xConstructor.setConstructor(true); ! yConstructor = new Edge("yconst", ! yAxis.getFrom().add(v), ! yAxis.getTo().add(v)); ! yConstructor.setConstructor(true); ! zConstructor = new Edge("zconst", ! zAxis.getFrom().add(v), ! zAxis.getTo().add(v)); ! zConstructor.setConstructor(true); ! glv.getView().addTempEdge(xConstructor); ! glv.getView().addTempEdge(yConstructor); ! glv.getView().addTempEdge(zConstructor); } ! /** ! * Removes constructors parralel to the x y and z-axis. */ ! private void clearXYZConstructors() { ! if (xConstructor != null) { ! glv.getView().removeTempEdge(xConstructor); ! xConstructor = null; ! } ! if (yConstructor != null) { ! glv.getView().removeTempEdge(yConstructor); ! yConstructor = null; } ! if (zConstructor != null) { ! glv.getView().removeTempEdge(zConstructor); ! zConstructor = null; } } --- 210,323 ---- * from a vertex. * @param v the vertex + * @return a set of XYZ constructors. */ ! private Set makeXYZConstructors(Vertex v) { ! if (v != null) { ! Edge x = new Edge("xconst", ! xAxis.getFrom().add(v), ! xAxis.getTo().add(v)); ! x.setConstructor(true); ! Edge y = new Edge("yconst", ! yAxis.getFrom().add(v), ! yAxis.getTo().add(v)); ! y.setConstructor(true); ! Edge z = new Edge("zconst", ! zAxis.getFrom().add(v), ! zAxis.getTo().add(v)); ! z.setConstructor(true); ! Set constructors = new HashSet(); ! constructors.add(x); ! constructors.add(y); ! constructors.add(z); ! glv.getView().addTempEdge(x); ! glv.getView().addTempEdge(y); ! glv.getView().addTempEdge(z); ! return constructors; ! } ! return null; } ! /** ! * Makes a set of three constructors where one is aligned with the given edge ! * and all constructors are orthogonal. ! * @param v the vertex ! * @param e the edge ! * @return a set of constructors */ ! private Set makeAlignedConstructors(Vertex v, Edge e) { ! if (v != null && e != null) { ! Vertex minus = e.getTo().minus(e.getFrom()); ! minus.scale(1 / minus.length()); ! minus.scale(50); ! Vertex firstFrom = minus.copy(); ! minus.scale(-1); ! Vertex firstTo = minus.copy(); ! Edge first = new Edge("first", firstFrom, firstTo); ! minus.scale(1 / minus.length()); ! Vertex ortho = new Vertex("ortho", 0, 0, 0); ! if (minus.getX() != 0) { ! if (minus.getY() != 0) { ! if (minus.getX() != 0) { ! ortho.setX(1); ! ortho.setY(-minus.getX() / minus.getY()); ! ortho.setZ(0); ! } else { ! ortho.setZ(1); ! } ! } else { ! ortho.setY(1); ! } ! } else { ! ortho.setX(1); ! } ! ! ortho.scale(1 / ortho.length()); ! ortho.scale(50); ! Vertex secondFrom = ortho.copy(); ! ortho.scale(-1); ! Vertex secondTo = ortho.copy(); ! Edge second = new Edge("second", secondFrom, secondTo); ! ortho.scale(1 / ortho.length()); ! ! Vertex cross = ortho.cross(minus); ! cross.scale(1 / cross.length()); ! cross.scale(50); ! Vertex thirdFrom = cross.copy(); ! cross.scale(-1); ! Vertex thirdTo = cross.copy(); ! Edge third = new Edge("third", thirdFrom, thirdTo); ! ! first.setTo(first.getTo().add(v)); ! first.setFrom(first.getFrom().add(v)); ! second.setTo(second.getTo().add(v)); ! second.setFrom(second.getFrom().add(v)); ! third.setTo(third.getTo().add(v)); ! third.setFrom(third.getFrom().add(v)); ! first.setConstructor(true); ! second.setConstructor(true); ! third.setConstructor(true); ! Set constructors = new HashSet(); ! constructors.add(first); ! constructors.add(second); ! constructors.add(third); ! glv.getView().addTempEdge(first); ! glv.getView().addTempEdge(second); ! glv.getView().addTempEdge(third); ! return constructors; } ! return null; ! } ! ! /** ! * Removes a set of constructors. ! * @param constructors a set of constructors. ! */ ! private void clearConstructors(Set constructors) { ! if (constructors != null) { ! Iterator it = constructors.iterator(); ! while (it.hasNext()) { ! Edge constructor = (Edge)it.next(); ! glv.getView().removeTempEdge(constructor); ! } } } *************** *** 293,296 **** --- 380,386 ---- active.setTo(vertex); intern(active); + + clearConstructors(currentConstructors); + currentConstructors = makeAlignedConstructors(vertex, active); from = vertex; *************** *** 566,570 **** if (target != null) { if (target instanceof Vertex) { ! setSnapVertex((Vertex) target); } } --- 656,661 ---- if (target != null) { if (target instanceof Vertex) { ! Vertex vertex = (Vertex) target; ! setSnapVertex(vertex); } } *************** *** 749,751 **** --- 840,850 ---- return null; } + + /** + * Cleans up any temporary construction lines. + */ + public void cleanUp() { + clearConstructors(currentConstructors); + clearConstructors(snapConstructors); + } } |
|
From: Nordholt <nor...@us...> - 2005-12-06 16:49:26
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4144 Modified Files: AbstractTool.java Tool.java Log Message: added a clean up method for tool Index: Tool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Tool.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Tool.java 29 Nov 2005 19:01:12 -0000 1.13 --- Tool.java 6 Dec 2005 16:49:19 -0000 1.14 *************** *** 35,39 **** public static final int TAPE_MEASURE_TOOL = 6; - /** * Return the current selection --- 35,38 ---- *************** *** 48,51 **** public Cursor getCursor(); ! } --- 47,53 ---- public Cursor getCursor(); ! /** ! * Lets the tool clean up after it self before changing tool. ! */ ! public void cleanUp(); } Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** AbstractTool.java 1 Dec 2005 10:10:02 -0000 1.33 --- AbstractTool.java 6 Dec 2005 16:49:19 -0000 1.34 *************** *** 546,548 **** --- 546,555 ---- } } + + /** + * Lets the tool clean up after itself before changing tool. + */ + public void cleanUp() { + return; + } } |
|
From: Michael L. <he...@us...> - 2005-12-05 21:00:33
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10548/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: All Hibernate related code has been factored out and placed in a separate repository location Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** GUI.java 23 Nov 2005 19:06:31 -0000 1.13 --- GUI.java 5 Dec 2005 21:00:24 -0000 1.14 *************** *** 21,25 **** import net.sourceforge.bprocessor.gui.actions.ToolsJoinActionListener; import net.sourceforge.bprocessor.gui.attrview.AttributeView; - import net.sourceforge.bprocessor.gui.properties.Settings; import net.sourceforge.bprocessor.gui.splash.SplashWindow; import net.sourceforge.bprocessor.gui.treeview.SpacesTreeView; --- 21,24 ---- *************** *** 338,345 **** public void start() { plash = new SplashWindow("splash.png", null); - - Settings settings = Settings.getInstance(); - settings.load(); - setSize(800, 600); } --- 337,340 ---- |
|
From: Michael L. <he...@us...> - 2005-12-05 21:00:32
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10548/src/net/sourceforge/bprocessor/gui/actions Modified Files: FilePropertiesActionListener.java FileExitActionListener.java Log Message: All Hibernate related code has been factored out and placed in a separate repository location Index: FileExitActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileExitActionListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FileExitActionListener.java 4 Aug 2005 06:07:10 -0000 1.2 --- FileExitActionListener.java 5 Dec 2005 21:00:24 -0000 1.3 *************** *** 7,12 **** package net.sourceforge.bprocessor.gui.actions; - import net.sourceforge.bprocessor.gui.properties.Settings; - import java.awt.event.ActionEvent; import java.awt.event.ActionListener; --- 7,10 ---- *************** *** 32,36 **** */ public void actionPerformed(ActionEvent e) { - Settings.getInstance().save(); System.exit(0); } --- 30,33 ---- Index: FilePropertiesActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FilePropertiesActionListener.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FilePropertiesActionListener.java 23 Aug 2005 10:49:45 -0000 1.1 --- FilePropertiesActionListener.java 5 Dec 2005 21:00:24 -0000 1.2 *************** *** 7,11 **** package net.sourceforge.bprocessor.gui.actions; - import net.sourceforge.bprocessor.gui.properties.PropertiesDialog; import java.awt.event.ActionEvent; --- 7,10 ---- *************** *** 32,37 **** */ public void actionPerformed(ActionEvent e) { - PropertiesDialog pd = new PropertiesDialog(); - pd.show(); } } --- 31,34 ---- |
|
From: Michael L. <he...@us...> - 2005-12-05 21:00:32
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/properties In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10548/src/net/sourceforge/bprocessor/gui/properties Removed Files: package.html PostgreSQL.java HSQLDB.java GenericDatabase.java Settings.java VisualDatabase.java PropertiesDialog.java Log Message: All Hibernate related code has been factored out and placed in a separate repository location --- PropertiesDialog.java DELETED --- --- HSQLDB.java DELETED --- --- Settings.java DELETED --- --- GenericDatabase.java DELETED --- --- package.html DELETED --- --- PostgreSQL.java DELETED --- --- VisualDatabase.java DELETED --- |
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10206/src/net/sourceforge/bprocessor/model/db Removed Files: DatabaseFactory.java PostgreSQL.java Database.java package.html HSQLDB.java AbstractDatabase.java HibernateUtil.java Log Message: All Hibernate related code has been factored out and placed in a separate repository location --- AbstractDatabase.java DELETED --- --- PostgreSQL.java DELETED --- --- Database.java DELETED --- --- package.html DELETED --- --- HSQLDB.java DELETED --- --- DatabaseFactory.java DELETED --- --- HibernateUtil.java DELETED --- |
|
From: Michael L. <he...@us...> - 2005-12-05 20:59:52
|
Update of /cvsroot/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10206 Modified Files: build.xml Log Message: All Hibernate related code has been factored out and placed in a separate repository location Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/model/build.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** build.xml 18 Oct 2005 08:17:07 -0000 1.9 --- build.xml 5 Dec 2005 20:59:44 -0000 1.10 *************** *** 63,71 **** </copy> <copy todir="${lib.dir}"> - <fileset dir="${tools.dir}/hibernate"> - <include name="**/*.jar"/> - </fileset> - </copy> - <copy todir="${lib.dir}"> <fileset dir="${kernel.dir}/dist"> <include name="**/kernel.jar"/> --- 63,66 ---- *************** *** 101,129 **** </target> ! <target name="xdoclet" depends="copylib"> ! <taskdef ! name="hibernatedoclet" ! classname="xdoclet.modules.hibernate.HibernateDocletTask"> ! <classpath> ! <fileset dir="${tools.dir}/xdoclet"> ! <include name="**/*.jar"/> ! </fileset> ! </classpath> ! </taskdef> ! ! <hibernatedoclet ! destdir="${build.code.dir}" ! mergedir="${conf.dir}" ! excludedtags="@version,@author,@todo,@see" ! force="true" ! verbose="false"> ! ! <fileset dir="${src.dir}"> ! <include name="**/*.java"/> ! </fileset> ! ! <hibernate version="3.0"/> ! </hibernatedoclet> ! </target> <target name="checkstyle" depends="prepare"> --- 96,100 ---- </target> ! <target name="checkstyle" depends="prepare"> *************** *** 141,145 **** </target> ! <target name="compile" depends="checkstyle,copylib,compile-xml,xdoclet"> <ant dir="src" target="compile"/> </target> --- 112,116 ---- </target> ! <target name="compile" depends="checkstyle,copylib,compile-xml"> <ant dir="src" target="compile"/> </target> |
|
From: Michael L. <he...@us...> - 2005-12-05 20:59:51
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10206/src/net/sourceforge/bprocessor/model Removed Files: DomainFacade.java AttributeFacade.java SQLFacade.java PartFacade.java ConstructionSpaceFacade.java EdgeFacade.java ElementFacade.java VertexFacade.java SurfaceFacade.java FunctionalSpaceFacade.java Log Message: All Hibernate related code has been factored out and placed in a separate repository location --- ConstructionSpaceFacade.java DELETED --- --- ElementFacade.java DELETED --- --- AttributeFacade.java DELETED --- --- DomainFacade.java DELETED --- --- SurfaceFacade.java DELETED --- --- VertexFacade.java DELETED --- --- PartFacade.java DELETED --- --- EdgeFacade.java DELETED --- --- SQLFacade.java DELETED --- --- FunctionalSpaceFacade.java DELETED --- |
|
From: Michael L. <he...@us...> - 2005-12-05 19:25:49
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24114/src/net/sourceforge/bprocessor/gl/tool Modified Files: PencilTool.java Log Message: Small penciltool constructor fix. Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** PencilTool.java 5 Dec 2005 17:25:20 -0000 1.43 --- PencilTool.java 5 Dec 2005 19:25:38 -0000 1.44 *************** *** 166,170 **** */ protected void setAlignVertex(Vertex vertex) { ! alignVertex = vertex; } --- 166,174 ---- */ protected void setAlignVertex(Vertex vertex) { ! alignVertex = vertex; ! clearXYZConstructors(); ! if (vertex != null) { ! makeXYZConstructors(vertex); ! } } *************** *** 218,224 **** */ private void clearXYZConstructors() { ! glv.getView().removeTempEdge(xConstructor); ! glv.getView().removeTempEdge(yConstructor); ! glv.getView().removeTempEdge(zConstructor); } --- 222,237 ---- */ private void clearXYZConstructors() { ! if (xConstructor != null) { ! glv.getView().removeTempEdge(xConstructor); ! xConstructor = null; ! } ! if (yConstructor != null) { ! glv.getView().removeTempEdge(yConstructor); ! yConstructor = null; ! } ! if (zConstructor != null) { ! glv.getView().removeTempEdge(zConstructor); ! zConstructor = null; ! } } *************** *** 235,240 **** setSnapVertex(null); number = ""; - clearXYZConstructors(); - makeXYZConstructors(vertex); { --- 248,251 ---- |
|
From: Nordholt <nor...@us...> - 2005-12-05 17:38:00
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29108 Modified Files: AbstractView.java Log Message: fixing conflict Index: AbstractView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/AbstractView.java,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** AbstractView.java 5 Dec 2005 17:27:41 -0000 1.69 --- AbstractView.java 5 Dec 2005 17:37:53 -0000 1.70 *************** *** 912,916 **** Surface s = (Surface)tempSurfaceIt.next(); pushName(gl, s); ! drawSurface(s); popName(gl); } --- 912,916 ---- Surface s = (Surface)tempSurfaceIt.next(); pushName(gl, s); ! drawSurface(s, false); popName(gl); } |
|
From: Nordholt <nor...@us...> - 2005-12-05 17:27:53
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27144 Modified Files: AbstractView.java Log Message: temporary edges, surfaces and vertices are also in selection now Index: AbstractView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/AbstractView.java,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** AbstractView.java 5 Dec 2005 07:56:50 -0000 1.68 --- AbstractView.java 5 Dec 2005 17:27:41 -0000 1.69 *************** *** 874,877 **** --- 874,884 ---- popName(gl); } + Iterator tempVerticesIt = tempVertices.iterator(); + while (tempVerticesIt.hasNext()) { + Vertex v = (Vertex)tempVerticesIt.next(); + pushName(gl, v); + drawVertexHit(v); + popName(gl); + } } if (selectMode == EDGES || selectMode == ALL) { *************** *** 884,887 **** --- 891,901 ---- popName(gl); } + Iterator tempEdgeIt = tempEdges.iterator(); + while (tempEdgeIt.hasNext()) { + Edge e = (Edge)tempEdgeIt.next(); + pushName(gl, e); + drawEdge(e); + popName(gl); + } } if (selectMode == SURFACES || selectMode == ALL) { *************** *** 894,897 **** --- 908,918 ---- popName(gl); } + Iterator tempSurfaceIt = tempSurfaces.iterator(); + while (tempSurfaceIt.hasNext()) { + Surface s = (Surface)tempSurfaceIt.next(); + pushName(gl, s); + drawSurface(s); + popName(gl); + } } if (selectMode == CLIPPLANES || selectMode == ALL) { |
|
From: Nordholt <nor...@us...> - 2005-12-05 17:26:48
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27028 Modified Files: TapeMeasureTool.java Log Message: typing in a length ends measurement when pressing enter. X, Y and Z axis can be clicked now Index: TapeMeasureTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasureTool.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TapeMeasureTool.java 30 Nov 2005 15:39:59 -0000 1.2 --- TapeMeasureTool.java 5 Dec 2005 17:26:37 -0000 1.3 *************** *** 30,33 **** --- 30,42 ---- private static Logger log = Logger.getLogger(TapeMeasureTool.class); + /** The x axis */ + private Edge xAxis = new Edge("x", new Vertex("", -50, 0, 0), new Vertex("", 50, 0, 0)); + + /** The y axis */ + private Edge yAxis = new Edge("y", new Vertex("", 0, -50, 0), new Vertex("", 0, 50, 0)); + + /**The z axis */ + private Edge zAxis = new Edge("z", new Vertex("", 0, 0, -50), new Vertex("", 0, 0, 50)); + /** The current edge */ private Edge currentEdge; *************** *** 54,57 **** --- 63,68 ---- private String number; + /** Tells if the tool is currently measuring or not */ + private boolean measuring; /** * Constructor *************** *** 61,64 **** --- 72,76 ---- public TapeMeasureTool(GLView glv, Cursor cursor) { super(glv, cursor); + measuring = false; } *************** *** 70,84 **** if (currentEdge != null) { if (movePlane == null) { ! findTarget(e); ! if (target instanceof Surface) { ! Surface targetSurface = (Surface)target; ! if (currentEdge.getSurfaces().contains(targetSurface)) { ! number = ""; ! glv.getView().makeTarget(target); ! movePlane = targetSurface.plane(); ! Vertex edgeDirection = currentEdge.getTo().minus(currentEdge.getFrom()); ! Vertex surfaceNormal = targetSurface.normal(); ! edgeNormal = edgeDirection.cross(surfaceNormal); ! move(e); } } --- 82,110 ---- if (currentEdge != null) { if (movePlane == null) { ! if (currentEdge.equals(xAxis)) { ! movePlane = new Plane(0, 0, 1, 0); ! edgeNormal = new Vertex("", 0, 1, 0); ! move(e); ! } else if (currentEdge.equals(yAxis)) { ! movePlane = new Plane(0, 0, 1, 0); ! edgeNormal = new Vertex("", 1, 0, 0); ! move(e); ! } else if (currentEdge.equals(zAxis)) { ! movePlane = new Plane(0, 1, 0, 0); ! edgeNormal = new Vertex("", 1, 0, 0); ! move(e); ! } else { ! findTarget(e); ! if (target instanceof Surface) { ! Surface targetSurface = (Surface)target; ! if (currentEdge.getSurfaces().contains(targetSurface)) { ! number = ""; ! glv.getView().makeTarget(target); ! movePlane = targetSurface.plane(); ! Vertex edgeDirection = currentEdge.getTo().minus(currentEdge.getFrom()); ! Vertex surfaceNormal = targetSurface.normal(); ! edgeNormal = edgeDirection.cross(surfaceNormal); ! move(e); ! } } } *************** *** 127,135 **** */ protected void pressed(MouseEvent e) { findTarget(e); ! if (currentEdge == null) { if (target instanceof Edge) { currentEdge = (Edge)target; ! Vertex minus = currentEdge.getTo().minus(currentEdge.getFrom()); minus.scale(1 / minus.length()); --- 153,165 ---- */ protected void pressed(MouseEvent e) { + View v = glv.getView(); + v.addTempEdge(xAxis); + v.addTempEdge(yAxis); + v.addTempEdge(zAxis); findTarget(e); ! if (!measuring) { if (target instanceof Edge) { currentEdge = (Edge)target; ! measuring = true; Vertex minus = currentEdge.getTo().minus(currentEdge.getFrom()); minus.scale(1 / minus.length()); *************** *** 151,155 **** double x = e.getX(); double y = AbstractView.getHeight() - e.getY(); - View v = glv.getView(); Transformation transformation = v.transformation(); Vertex near = new Vertex("near", x, y, 0.0); --- 181,184 ---- *************** *** 167,181 **** } } else { ! View v = glv.getView(); ! v.removeTempEdge(edgeToConstruction); ! v.removeTempVertex(edgePoint); ! v.removeTempVertex(constructionPoint); ! currentEdge = null; ! currentConstruction = null; ! movePlane = null; ! edgeToConstruction = null; ! removeVertex(edgePoint); ! removeVertex(constructionPoint); } } --- 196,205 ---- } } else { ! endTapeMeasure(); } + v.removeTempEdge(xAxis); + v.removeTempEdge(yAxis); + v.removeTempEdge(zAxis); + } *************** *** 236,239 **** --- 260,264 ---- edgeNormal.getY() * delta, edgeNormal.getZ() * delta); + endTapeMeasure(); glv.repaint(); } *************** *** 257,260 **** super.keyPressed(e); } ! } --- 282,303 ---- super.keyPressed(e); } ! ! /** ! * Ends one tape measure ! */ ! private void endTapeMeasure() { ! if (measuring) { ! View v = glv.getView(); ! v.removeTempEdge(edgeToConstruction); ! v.removeTempVertex(edgePoint); ! v.removeTempVertex(constructionPoint); ! currentEdge = null; ! currentConstruction = null; ! movePlane = null; ! edgeToConstruction = null; ! removeVertex(edgePoint); ! removeVertex(constructionPoint); ! measuring = false; ! } ! } } |
|
From: Nordholt <nor...@us...> - 2005-12-05 17:25:31
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26621 Modified Files: PencilTool.java Log Message: added construction lines when drawing Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** PencilTool.java 5 Dec 2005 07:56:50 -0000 1.42 --- PencilTool.java 5 Dec 2005 17:25:20 -0000 1.43 *************** *** 37,40 **** --- 37,58 ---- private static Logger log = Logger.getLogger(PencilTool.class); + /** The x axis */ + private Edge xAxis = new Edge("x", new Vertex("", -50, 0, 0), new Vertex("", 50, 0, 0)); + + /** The y axis */ + private Edge yAxis = new Edge("y", new Vertex("", 0, -50, 0), new Vertex("", 0, 50, 0)); + + /**The z axis */ + private Edge zAxis = new Edge("z", new Vertex("", 0, 0, -50), new Vertex("", 0, 0, 50)); + + /**The x axis constructor*/ + private Edge xConstructor; + + /**The y axis constructor*/ + private Edge yConstructor; + + /**The z axis constructor*/ + private Edge zConstructor; + /** The active */ protected Edge active = null; *************** *** 53,57 **** /** The snap vertex */ - protected Vertex snapVertex = null; --- 71,74 ---- *************** *** 173,176 **** --- 190,225 ---- } } + + /** + * Makes constructors parralel to the x y and z-axis, originating + * from a vertex. + * @param v the vertex + */ + private void makeXYZConstructors(Vertex v) { + xConstructor = new Edge("xconst", + xAxis.getFrom().add(v), + xAxis.getTo().add(v)); + xConstructor.setConstructor(true); + yConstructor = new Edge("yconst", + yAxis.getFrom().add(v), + yAxis.getTo().add(v)); + yConstructor.setConstructor(true); + zConstructor = new Edge("zconst", + zAxis.getFrom().add(v), + zAxis.getTo().add(v)); + zConstructor.setConstructor(true); + glv.getView().addTempEdge(xConstructor); + glv.getView().addTempEdge(yConstructor); + glv.getView().addTempEdge(zConstructor); + } + + /** + * Removes constructors parralel to the x y and z-axis. + */ + private void clearXYZConstructors() { + glv.getView().removeTempEdge(xConstructor); + glv.getView().removeTempEdge(yConstructor); + glv.getView().removeTempEdge(zConstructor); + } /** *************** *** 186,190 **** setSnapVertex(null); number = ""; ! { Set vertices = Project.getInstance().findByLocation --- 235,241 ---- setSnapVertex(null); number = ""; ! clearXYZConstructors(); ! makeXYZConstructors(vertex); ! { Set vertices = Project.getInstance().findByLocation *************** *** 466,474 **** Vertex n = new Vertex("", 0, 0, 1); system = new CoordinateSystem(i, j, n, origin); ! snapInSystem(system, current); } else { if (legal) { if (system != null) { ! snapInSystem(system, current); } } --- 517,525 ---- Vertex n = new Vertex("", 0, 0, 1); system = new CoordinateSystem(i, j, n, origin); ! //snapInSystem(system, current); } else { if (legal) { if (system != null) { ! //snapInSystem(system, current); } } |
|
From: Michael L. <he...@us...> - 2005-12-05 07:56:58
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10503/src/net/sourceforge/bprocessor/gl/tool Modified Files: PencilTool.java ToolFactory.java Added Files: ExtrudeTool.java Log Message: - Colors depend on space-assignment - Space assigned when making holes - Improved pencils usage of constructor lines - Started refactoring of extrusion --- NEW FILE: ExtrudeTool.java --- //--------------------------------------------------------------------------------- // $Id: ExtrudeTool.java,v 1.1 2005/12/05 07:56:50 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gl.tool; import java.awt.Cursor; import java.awt.event.MouseEvent; import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.view.AbstractView; import net.sourceforge.bprocessor.gl.view.Transformation; import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; /** * The ExtrudeTool */ public class ExtrudeTool extends SelectTool { /** The dragSurface */ private Surface dragSurface; /** The extrudeSurface */ private Surface extrudeSurface; /** The dragplane */ private Plane dragplane; /** The previous x-coordinate */ private double prevX; /** The previous y-coordinate */ private double prevY; /** current distance from start along normal t */ private double t = 0; /** * Direction (1 or -1) */ private int direction = 0; /** * Constructor * @param glv THe GLCanvas * @param cursor The cursor */ public ExtrudeTool(GLView glv, Cursor cursor) { super(glv, cursor); } /** * Invoked when a mouse button has been pressed on a component. * @param e The MouseEvent object */ protected void pressed(MouseEvent e) { t = 0.0; prevX = e.getX(); prevY = e.getY(); super.pressed(e); if (target instanceof Surface) { extrudeSurface = (Surface) target; View view = glv.getView(); Transformation trans = view.transformation(); double x = prevX; double y = AbstractView.getHeight() - prevY; Vertex near = new Vertex("near", x, y, 0.0); Vertex far = new Vertex("far", x, y, 1.0); Edge ray = new Edge("ray", near, far); ray = trans.unProject(ray); dragplane = extrudeSurface.plane().orthogonalPlane(ray); } } /** * Moves the extrusion a given offset in the direction of the normal. * @param delta the offset. */ private void move(double delta) { if (dragSurface != null) { Vertex normal = dragSurface.normal(); normal.scale(1 / normal.length()); normal.scale(delta / (normal.length() * normal.length())); dragSurface.move(normal.getX(), normal.getY(), normal.getZ()); } } /** * Move to to * @param to A distance a long the normal */ private void moveTo(double to) { if (direction > 0) { if (to < 0) { to = 0; } } else { if (to > 0) { to = 0; } } double delta = to - t; move(delta); t = to; } /** * Invoked when the mouse is held pressed and moved * @param e The MouseEvent object */ protected void dragged(MouseEvent e) { if (extrudeSurface != null) { Vertex normal; if (dragSurface == null) { normal = extrudeSurface.normal(); } else { normal = dragSurface.normal(); } normal.scale(1 / normal.length()); View view = glv.getView(); Vertex from = view.toPlaneCoords(new double[] {prevX, prevY}, dragplane); Vertex to = view.toPlaneCoords(new double[] {e.getX(), e.getY()}, dragplane); Vertex delta = to.minus(from); double normDotDelta = normal.dot(delta); double x = e.getX(); double y = e.getY(); if (dragSurface == null) { if (x * x + y * y > 16) { dragSurface = extrudeSurface.extrude(normDotDelta); t = -normDotDelta; if (t > 0) { direction = 1; } else { direction = -1; } } } else { moveTo(normDotDelta); } } } /** * Invoked when a mouse button has been released on a component. * @param e The MouseEvent */ protected void released(MouseEvent e) { super.released(e); dragplane = null; dragSurface = null; } } Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ToolFactory.java 1 Dec 2005 10:10:02 -0000 1.17 --- ToolFactory.java 5 Dec 2005 07:56:50 -0000 1.18 *************** *** 41,45 **** /** extrusion tool */ ! private ExtrusionTool extrusion; /** pencil tool */ --- 41,45 ---- /** extrusion tool */ ! private SelectTool extrusion; /** pencil tool */ Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** PencilTool.java 1 Dec 2005 10:10:02 -0000 1.41 --- PencilTool.java 5 Dec 2005 07:56:50 -0000 1.42 *************** *** 108,114 **** target = e1; } else { ! target = intersect.getFrom(); ! splitE1 = e1; ! splitE2 = e2; } } else { --- 108,118 ---- target = e1; } else { ! if (intersect.getLength() > 0.0000001) { ! target = e1; ! } else { ! target = intersect.getFrom(); ! splitE1 = e1; ! splitE2 = e2; ! } } } else { *************** *** 182,186 **** setSnapVertex(null); number = ""; ! if (active == null) { edges = new ArrayList(); --- 186,198 ---- setSnapVertex(null); number = ""; ! ! { ! Set vertices = Project.getInstance().findByLocation ! (vertex.getX(), vertex.getY(), vertex.getZ(), 0.0000001); ! if (!vertices.isEmpty()) { ! vertex = (Vertex) vertices.iterator().next(); ! } ! } ! if (active == null) { edges = new ArrayList(); *************** *** 216,220 **** } if (vertex.getId() == null) { - //log.info("ID was null on " + vertex); intern(vertex); active.setTo(vertex); --- 228,231 ---- *************** *** 237,241 **** --- 248,267 ---- if (from == to) { Surface surface = new Surface("S" + surfaceNum++, edges); + + + Set surfaces = Project.getInstance().getSurfaces(); + Iterator iter = surfaces.iterator(); + while (iter.hasNext()) { + Surface current = (Surface) iter.next(); + if (current.surrounds(surface)) { + current.addHole(surface); + } else if (surface.surrounds(current)) { + surface.addHole(current); + } + } intern(surface); + + exterior = null; + if (exterior != null) { exterior.addHole(surface); *************** *** 244,258 **** } - // Do automation with spaces - Space sp = findSpace(surface); - if (sp != null) { - sp.addSurface(surface); - surface.setFrontDomain(sp); - surface.setBackDomain(sp); - Project.getInstance().update(surface); - Project.getInstance().update(sp); - } else { - //log.warn("No space was found"); - } } else { Geometry.insert(edges); --- 270,273 ---- *************** *** 434,438 **** snap = true; if (vertex != null) { ! vertex.setName("current"); current = vertex; } else { --- 449,456 ---- snap = true; if (vertex != null) { ! // FIXME The plane intersection should take care ! // of the following round off ! vertex.setZ(0.0); ! vertex.setName("xy-plane"); current = vertex; } else { |
|
From: Michael L. <he...@us...> - 2005-12-05 07:56:57
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10503/src/net/sourceforge/bprocessor/gl/view Modified Files: AbstractView.java Log Message: - Colors depend on space-assignment - Space assigned when making holes - Improved pencils usage of constructor lines - Started refactoring of extrusion Index: AbstractView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/AbstractView.java,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** AbstractView.java 3 Dec 2005 12:27:21 -0000 1.67 --- AbstractView.java 5 Dec 2005 07:56:50 -0000 1.68 *************** *** 703,723 **** } ! // Draw edges ! if (doDrawEdges) { ! gl.glLineWidth(1.0f); ! gl.glColor3fv(lineColor); ! // draw all the edges in the model ! Iterator eit = edges.iterator(); ! while (eit.hasNext()) { ! Edge e = (Edge)eit.next(); ! drawEdge(e); ! } ! //draw all temporary edges. ! Iterator tempEdgeIt = tempEdges.iterator(); ! while (tempEdgeIt.hasNext()) { ! Edge e = (Edge)tempEdgeIt.next(); ! drawEdge(e); ! } ! } // Draw any Vertex that are not part of an edge --- 703,707 ---- } ! // Draw any Vertex that are not part of an edge *************** *** 786,790 **** } } ! drawSpaces(gld); --- 770,790 ---- } } ! // Draw edges ! if (doDrawEdges) { ! gl.glLineWidth(1.0f); ! gl.glColor3fv(lineColor); ! // draw all the edges in the model ! Iterator eit = edges.iterator(); ! while (eit.hasNext()) { ! Edge e = (Edge)eit.next(); ! drawEdge(e); ! } ! //draw all temporary edges. ! Iterator tempEdgeIt = tempEdges.iterator(); ! while (tempEdgeIt.hasNext()) { ! Edge e = (Edge)tempEdgeIt.next(); ! drawEdge(e); ! } ! } drawSpaces(gld); |