bprocessor-commit Mailing List for B-processor (Page 166)
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: Jesper P. <je...@us...> - 2005-08-22 08:46:52
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22982 Modified Files: Domain.java Element.java Space.java Surface.java Log Message: Do deletes on application level for now Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Surface.java 16 Aug 2005 11:45:03 -0000 1.10 --- Surface.java 22 Aug 2005 08:46:44 -0000 1.11 *************** *** 111,115 **** * @return The edges * @hibernate.list - * cascade="delete" * lazy="false" * @hibernate.key --- 111,114 ---- Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Space.java 4 Aug 2005 11:11:49 -0000 1.3 --- Space.java 22 Aug 2005 08:46:44 -0000 1.4 *************** *** 58,62 **** * @return The elements * @hibernate.set - * cascade="delete" * lazy="false" * @hibernate.key --- 58,61 ---- Index: Element.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Element.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Element.java 4 Aug 2005 11:11:49 -0000 1.3 --- Element.java 22 Aug 2005 08:46:44 -0000 1.4 *************** *** 68,72 **** * @return The parts * @hibernate.set - * cascade="delete" * lazy="false" * @hibernate.key --- 68,71 ---- Index: Domain.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Domain.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Domain.java 16 Aug 2005 11:45:03 -0000 1.4 --- Domain.java 22 Aug 2005 08:46:44 -0000 1.5 *************** *** 105,109 **** * @return The surfaces * @hibernate.set - * cascade="delete" * lazy="false" * @hibernate.key --- 105,108 ---- |
From: Nordholt <nor...@us...> - 2005-08-19 10:31:39
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19875 Modified Files: ExtrusionTool.java Log Message: added support for 3D Extrusion Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ExtrusionTool.java 5 Aug 2005 11:25:18 -0000 1.2 --- ExtrusionTool.java 19 Aug 2005 10:31:29 -0000 1.3 *************** *** 8,11 **** --- 8,12 ---- import net.sourceforge.bprocessor.gl.GLView; + import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.kernel.notification.Notification; *************** *** 57,78 **** } if (dragSurface != null) { ! Vertex normal = dragSurface.normal(); ! if (normal != null) { ! double[] second = glv.getView().toCanvasCoords(new double[] {e.getX(), e.getY()}); normal.scale(1 / normal.length()); ! Vertex proj = dragSurface.projection(second); ! List l = Util.traverse(dragSurface); for (int count = 0; l != null && count < l.size(); count++) { Vertex v = (Vertex)l.get(count); ! updateVertex(v, new double[] {v.getX() + proj.getX(), ! v.getY() + proj.getY(), ! v.getZ() + proj.getZ()}); } } } } } /** * Checks if a surface is extrudeable --- 58,99 ---- } if (dragSurface != null) { ! if (viewType != View.VIEW_3D) { ! Vertex normal = dragSurface.normal(); ! if (normal != null) { ! double[] second = glv.getView().toCanvasCoords(new double[] {e.getX(), e.getY()}); ! normal.scale(1 / normal.length()); ! Vertex proj = dragSurface.projection(second); ! ! List l = Util.traverse(dragSurface); ! for (int count = 0; l != null && count < l.size(); count++) { ! Vertex v = (Vertex)l.get(count); ! updateVertex(v, new double[] {v.getX() + proj.getX(), ! v.getY() + proj.getY(), ! v.getZ() + proj.getZ()}); ! } ! } ! } else { ! double dX = pressPos[0] - e.getX(); ! double dY = pressPos[1] - e.getY(); ! double delta = (dX - dY) / 60; ! Vertex normal = dragSurface.normal(); normal.scale(1 / normal.length()); ! normal.scale(delta); List l = Util.traverse(dragSurface); + //moving the dragged surface along its normal vector for (int count = 0; l != null && count < l.size(); count++) { Vertex v = (Vertex)l.get(count); ! updateVertex(v, new double[] {v.getX() + normal.getX(), ! v.getY() + normal.getY(), ! v.getZ() + normal.getZ()}); } } } + pressPos[0] = e.getX(); + pressPos[1] = e.getY(); } } + /** * Checks if a surface is extrudeable *************** *** 126,130 **** /** ! * Do alle the initial extrusion stuff */ private void createExtension() { --- 147,151 ---- /** ! * Do all the initial extrusion stuff */ private void createExtension() { |
From: Nordholt <nor...@us...> - 2005-08-19 09:50:52
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12419 Modified Files: MoveTool.java Log Message: added support for 3D movement Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MoveTool.java 5 Aug 2005 11:25:18 -0000 1.2 --- MoveTool.java 19 Aug 2005 09:50:44 -0000 1.3 *************** *** 13,16 **** --- 13,17 ---- import java.awt.event.MouseEvent; + import java.awt.event.KeyEvent; import java.util.List; *************** *** 21,26 **** --- 22,40 ---- */ public class MoveTool extends SelectTool { + /** The logger */ private static Logger log = Logger.getLogger(MoveTool.class); + + /** XY move mode for 3D view */ + private static final int XY = 0; + + /** XZ move mode for 3D view */ + private static final int XZ = 1; + + /** The speed of moving in 3D view */ + private int moveSpeed = 60; + + /** The the moving mode in 3D view */ + private int moveMode = XY; /** *************** *** 37,40 **** --- 51,100 ---- */ protected void dragged(MouseEvent e) { + if (viewType == View.VIEW_3D) { + int x = e.getX(); + int y = e.getY(); + double deltaX = x - pressPos[0]; + double deltaY = y - pressPos[1]; + double[] coords; + if (selectedSurface != null) { + List l = Util.traverse(selectedSurface); + for (int i = 0; i < l.size(); i++) { + Vertex v = (Vertex)l.get(i); + if (moveMode == XY) { + coords = new double[] {v.getX() + deltaX / moveSpeed, + v.getY() - deltaY / moveSpeed, + v.getZ() + 0}; + updateVertex(v, coords); + } else { + coords = new double[] {v.getX() + deltaX / moveSpeed, + v.getY() + 0, + v.getZ() - deltaY / moveSpeed}; + updateVertex(v, coords); + } + } + } else if (selectedEdge != null) { + Vertex to = selectedEdge.getTo(); + Vertex from = selectedEdge.getFrom(); + if (moveMode == XY) { + coords = new double[] {to.getX() + deltaX / moveSpeed, + to.getY() - deltaY / moveSpeed, + to.getZ() + 0}; + updateVertex(to, coords); + coords = new double[] {from.getX() + deltaX / moveSpeed, + from.getY() - deltaY / moveSpeed, + from.getZ() + 0}; + updateVertex(from, coords); + } else { + coords = new double[] {to.getX() + deltaX / moveSpeed, + to.getY() + 0, + to.getZ() - deltaY / moveSpeed}; + updateVertex(to, coords); + coords = new double[] {from.getX() + deltaX / moveSpeed, + from.getY() + 0, + from.getZ() - deltaY / moveSpeed}; + updateVertex(from, coords); + } + } + } if (selectedVertex != null) { int x = e.getX(); *************** *** 53,57 **** coordsa[1] - coordsb[1], coordsa[2] - coordsb[2]}; ! List l = Util.traverse(selectedSurface); for (int i = 0; i < l.size(); i++) { --- 113,117 ---- coordsa[1] - coordsb[1], coordsa[2] - coordsb[2]}; ! List l = Util.traverse(selectedSurface); for (int i = 0; i < l.size(); i++) { *************** *** 86,88 **** --- 146,170 ---- pressPos[1] = e.getY(); } + + /** + * Invoked when a key has been pressed. Lets user control the speed + * and mode of movement. + * @param e The KeyEvent + */ + public void keyPressed(KeyEvent e) { + if (e.getKeyCode() == KeyEvent.VK_X) { + if (moveSpeed > 13) { + moveSpeed -= 3; + } + } else if (e.getKeyCode() == KeyEvent.VK_Z) { + moveSpeed += 3; + } else if (e.getKeyCode() == KeyEvent.VK_A) { + moveMode = XY; + } else if (e.getKeyCode() == KeyEvent.VK_S) { + moveMode = XZ; + } else { + super.keyPressed(e); + } + glv.repaint(); + } } |
From: Nordholt <nor...@us...> - 2005-08-19 09:49:27
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12055 Modified Files: SelectTool.java Log Message: made viewType a protected instance variable Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SelectTool.java 17 Aug 2005 10:55:15 -0000 1.5 --- SelectTool.java 19 Aug 2005 09:49:20 -0000 1.6 *************** *** 44,47 **** --- 44,50 ---- /** The selected surface */ protected static Surface selectedSurface = null; + + /** the Viewtype */ + protected int viewType; /** *************** *** 91,95 **** int x = e.getX(); int y = e.getY(); ! int viewType = 0; View view = glv.getView(); double[] coords = view.toCanvasCoords(new double[]{x, y}); --- 94,98 ---- int x = e.getX(); int y = e.getY(); ! viewType = 0; View view = glv.getView(); double[] coords = view.toCanvasCoords(new double[]{x, y}); |
From: Jesper P. <je...@us...> - 2005-08-19 09:48:01
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11826/src/net/sourceforge/bprocessor/model/db Modified Files: AbstractDatabase.java Database.java DatabaseFactory.java HSQLDB.java PostgreSQL.java Log Message: Added isEnabled() Index: AbstractDatabase.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/db/AbstractDatabase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractDatabase.java 4 Aug 2005 06:04:43 -0000 1.1 --- AbstractDatabase.java 19 Aug 2005 09:47:52 -0000 1.2 *************** *** 117,119 **** --- 117,125 ---- */ public abstract int getType(); + + /** + * Is the database enabled ? + * @return True if enabled; otherwise false + */ + public abstract boolean isEnabled(); } Index: PostgreSQL.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/db/PostgreSQL.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PostgreSQL.java 4 Aug 2005 06:04:43 -0000 1.1 --- PostgreSQL.java 19 Aug 2005 09:47:52 -0000 1.2 *************** *** 52,54 **** --- 52,68 ---- return Database.POSTGRESQL; } + + /** + * Is the database enabled ? + * @return True if enabled; otherwise false + */ + public boolean isEnabled() { + try { + Class c = Thread.currentThread().getContextClassLoader().loadClass("org.postgresql.Driver"); + return true; + } catch (Exception e) { + // Ok + } + return false; + } } Index: HSQLDB.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/db/HSQLDB.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HSQLDB.java 4 Aug 2005 06:04:43 -0000 1.1 --- HSQLDB.java 19 Aug 2005 09:47:52 -0000 1.2 *************** *** 52,54 **** --- 52,68 ---- return Database.HSQLDB; } + + /** + * Is the database enabled ? + * @return True if enabled; otherwise false + */ + public boolean isEnabled() { + try { + Class c = Thread.currentThread().getContextClassLoader().loadClass("org.hsqldb.jdbcDriver"); + return true; + } catch (Exception e) { + // Ok + } + return false; + } } Index: Database.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/db/Database.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Database.java 4 Aug 2005 06:04:43 -0000 1.1 --- Database.java 19 Aug 2005 09:47:52 -0000 1.2 *************** *** 31,34 **** --- 31,40 ---- /** + * Is the database enabled ? + * @return True if enabled; otherwise false + */ + public boolean isEnabled(); + + /** * Get the url * @return The url of the database Index: DatabaseFactory.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/db/DatabaseFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DatabaseFactory.java 4 Aug 2005 09:51:33 -0000 1.2 --- DatabaseFactory.java 19 Aug 2005 09:47:52 -0000 1.3 *************** *** 70,74 **** known = false; } ! if (known) { database.setUrl(url); database.setUser(user); --- 70,74 ---- known = false; } ! if (known && database.isEnabled()) { database.setUrl(url); database.setUser(user); |
From: Nordholt <nor...@us...> - 2005-08-19 09:45:23
|
Update of /cvsroot/bprocessor/build/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11362 Modified Files: README Log Message: Added desription of keys when using the movetool in 3D Index: README =================================================================== RCS file: /cvsroot/bprocessor/build/doc/README,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** README 8 Aug 2005 09:50:41 -0000 1.1 --- README 19 Aug 2005 09:45:15 -0000 1.2 *************** *** 36,39 **** --- 36,46 ---- COMMA : Zoom out + When using the move tool in 3D view: + + A: XY movement mode + S: XZ movement mode + Z: decrease movement speed + X: increase movement speed + Homepage: --------- |
From: rimestad <rim...@us...> - 2005-08-17 17:39:28
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12861/src/net/sourceforge/bprocessor/gl/view Modified Files: AbstractView.java Log Message: changed so that vertical and horizontal edges are another color and transparancy is on Index: AbstractView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/AbstractView.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AbstractView.java 17 Aug 2005 10:58:11 -0000 1.7 --- AbstractView.java 17 Aug 2005 17:39:19 -0000 1.8 *************** *** 56,63 **** /** Surface color for all not selected surfaces */ ! public static final double[] SURFACE_COLOR = new double[] {0.93, 0.93, 0.93, 0.7}; /** Used for selected objects */ ! public static final double[] SELECTED_COLOR = new double[] {1.0, 0.4, 1.0, 0.7}; /** The view transformation matrix (it is shown transposed) see p. 187 [GL BIBLE]*/ --- 56,63 ---- /** Surface color for all not selected surfaces */ ! public static final double[] SURFACE_COLOR = new double[] {0.93, 0.93, 0.93, 0.95}; /** Used for selected objects */ ! public static final double[] SELECTED_COLOR = new double[] {1.0, 0.4, 1.0, 0.95}; /** The view transformation matrix (it is shown transposed) see p. 187 [GL BIBLE]*/ *************** *** 160,163 **** --- 160,165 ---- gl.glEnable(GL.GL_DEPTH_TEST); + gl.glEnable(GL.GL_LINE_SMOOTH); + gl.glEnable(GL.GL_POINT_SMOOTH); gl.glEnable(GL.GL_BLEND); *************** *** 259,280 **** gl.glInitNames(); if (mode[0] != GL.GL_SELECT) { - Iterator it = surfaces.iterator(); - gl.glColor4dv(SURFACE_COLOR); - while (it.hasNext()) { - Surface s = (Surface)it.next(); - if (!s.equals(selectedSurface)) { - drawSurface(s); - } - } - - it = edges.iterator(); - gl.glColor3dv(STD_LINE_COLOR); - while (it.hasNext()) { - Edge e = (Edge)it.next(); - if (!e.equals(selectedEdge)) { - drawEdge(e); - } - } - // draw activeEdge different if it is parallel with axis if (activeEdge != null) { --- 261,264 ---- *************** *** 353,356 **** --- 337,358 ---- drawSurface(selectedSurface); } + + Iterator it = surfaces.iterator(); + gl.glColor4dv(SURFACE_COLOR); + while (it.hasNext()) { + Surface s = (Surface)it.next(); + if (!s.equals(selectedSurface)) { + drawSurface(s); + } + } + + it = edges.iterator(); + gl.glColor3dv(STD_LINE_COLOR); + while (it.hasNext()) { + Edge e = (Edge)it.next(); + if (!e.equals(selectedEdge)) { + drawEdge(e); + } + } } else { if (selectMode == SURFACES) { |
From: Jesper P. <je...@us...> - 2005-08-17 11:23:04
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22809/src/net/sourceforge/bprocessor/model Modified Files: ConstructionSpaceFacade.java EdgeFacade.java ElementFacade.java FunctionalSpaceFacade.java PartFacade.java SurfaceFacade.java VertexFacade.java Log Message: Synchronized findById() Index: ConstructionSpaceFacade.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ConstructionSpaceFacade.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ConstructionSpaceFacade.java 28 Jul 2005 10:16:01 -0000 1.3 --- ConstructionSpaceFacade.java 17 Aug 2005 11:22:54 -0000 1.4 *************** *** 153,157 **** * @return The construction space */ ! public ConstructionSpace findById(Long id) { ConstructionSpace result = null; --- 153,157 ---- * @return The construction space */ ! public synchronized ConstructionSpace findById(Long id) { ConstructionSpace result = null; Index: ElementFacade.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ElementFacade.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ElementFacade.java 28 Jul 2005 10:16:02 -0000 1.3 --- ElementFacade.java 17 Aug 2005 11:22:54 -0000 1.4 *************** *** 153,157 **** * @return The element */ ! public Element findById(Long id) { Element result = null; --- 153,157 ---- * @return The element */ ! public synchronized Element findById(Long id) { Element result = null; Index: SurfaceFacade.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SurfaceFacade.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SurfaceFacade.java 28 Jul 2005 10:16:02 -0000 1.4 --- SurfaceFacade.java 17 Aug 2005 11:22:54 -0000 1.5 *************** *** 153,157 **** * @return The surface */ ! public Surface findById(Long id) { Surface result = null; --- 153,157 ---- * @return The surface */ ! public synchronized Surface findById(Long id) { Surface result = null; Index: VertexFacade.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/VertexFacade.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** VertexFacade.java 2 Aug 2005 07:18:25 -0000 1.4 --- VertexFacade.java 17 Aug 2005 11:22:54 -0000 1.5 *************** *** 153,157 **** * @return The vertex */ ! public Vertex findById(Long id) { Vertex result = null; --- 153,157 ---- * @return The vertex */ ! public synchronized Vertex findById(Long id) { Vertex result = null; Index: EdgeFacade.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/EdgeFacade.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EdgeFacade.java 28 Jul 2005 10:16:02 -0000 1.4 --- EdgeFacade.java 17 Aug 2005 11:22:54 -0000 1.5 *************** *** 153,157 **** * @return The edge */ ! public Edge findById(Long id) { Edge result = null; --- 153,157 ---- * @return The edge */ ! public synchronized Edge findById(Long id) { Edge result = null; Index: PartFacade.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/PartFacade.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PartFacade.java 28 Jul 2005 10:16:02 -0000 1.3 --- PartFacade.java 17 Aug 2005 11:22:54 -0000 1.4 *************** *** 153,157 **** * @return The part */ ! public Part findById(Long id) { Part result = null; --- 153,157 ---- * @return The part */ ! public synchronized Part findById(Long id) { Part result = null; Index: FunctionalSpaceFacade.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/FunctionalSpaceFacade.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FunctionalSpaceFacade.java 28 Jul 2005 10:16:02 -0000 1.3 --- FunctionalSpaceFacade.java 17 Aug 2005 11:22:54 -0000 1.4 *************** *** 153,157 **** * @return The functional space */ ! public FunctionalSpace findById(Long id) { FunctionalSpace result = null; --- 153,157 ---- * @return The functional space */ ! public synchronized FunctionalSpace findById(Long id) { FunctionalSpace result = null; |
From: Nordholt <nor...@us...> - 2005-08-17 11:07:00
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18664 Modified Files: GLView.java Log Message: moved some comments Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** GLView.java 17 Aug 2005 10:18:02 -0000 1.9 --- GLView.java 17 Aug 2005 11:06:47 -0000 1.10 *************** *** 100,103 **** --- 100,117 ---- glc.repaint(); } + + /** + * Repaint the canvas. Will force instant repaint if given true + * @param force wether or not to force reapint + */ + public void repaint(boolean force) { + if (force) { + glc.display(); + } else { + glc.repaint(); + } + } + + /** |
From: Nordholt <nor...@us...> - 2005-08-17 11:03:51
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18261 Modified Files: View3D.java Log Message: moved selection code to abstractview Index: View3D.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View3D.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** View3D.java 17 Aug 2005 08:57:52 -0000 1.5 --- View3D.java 17 Aug 2005 11:03:22 -0000 1.6 *************** *** 11,26 **** import net.java.games.jogl.GL; import net.java.games.jogl.GLDrawable; - //import net.java.games.jogl.GLU; - import net.java.games.jogl.util.BufferUtils; - - - import net.sourceforge.bprocessor.model.Edge; - import net.sourceforge.bprocessor.model.EdgeFacade; - import net.sourceforge.bprocessor.model.Vertex; - - import java.util.Iterator; - import java.util.Set; - - import java.nio.IntBuffer; import org.apache.log4j.Logger; --- 11,14 ---- *************** *** 42,54 **** private static double rotationY = 130; - /** The picking state */ - private int picking = 0; - - /** x coordinate */ - private double x; - - /** y coordinate */ - private double y; - /** * The constructor --- 30,33 ---- *************** *** 77,82 **** //Set the PickMatrix if we are trying to pick something if (picking > 0) { ! glu.gluPickMatrix(x, viewport[3] - y, 7, 7, viewport); ! picking--; } double aspect = width / height; --- 56,60 ---- //Set the PickMatrix if we are trying to pick something if (picking > 0) { ! glu.gluPickMatrix(x, viewport[3] - y, 5, 5, viewport); } double aspect = width / height; *************** *** 183,273 **** } } - - /** - *Names objects in the scene for selection - */ - protected void nameObjects() { - gl.glClear(GL.GL_COLOR_BUFFER_BIT); - gl.glMatrixMode(GL.GL_MODELVIEW); - gl.glPushMatrix(); - - gl.glInitNames(); - - Set edges = EdgeFacade.getInstance().findAll(); - Iterator it = edges.iterator(); - gl.glColor3dv(STD_LINE_COLOR); - gl.glLineWidth(1.0f); - gl.glColor3dv(STD_LINE_COLOR); - while (it.hasNext()) { - Edge e = (Edge)it.next(); - Vertex to = e.getTo(); - Vertex from = e.getFrom(); - int name = e.getId().intValue(); - if (to != null && from != null) { - gl.glPushName(name); - gl.glBegin(GL.GL_LINES); - gl.glVertex3d(to.getX(), to.getY(), to.getZ()); - gl.glVertex3d(from.getX(), from.getY(), from.getZ()); - gl.glEnd(); - gl.glPopName(); - } - } - gl.glPopMatrix(); - } - - /** - * Gives an id of the object under the point of a mouseclick - * @param x the x coordinate of the point - * @param y the y coordinate of the point - * @return a Long id of the object under the point, null if no object is there - */ - public Long getObjectAtPoint(double x, double y) { - this.x = x; - this.y = y; - int hits; - IntBuffer selectBuffer = BufferUtils.newIntBuffer(1024); - Long id = null; - int[] mode = new int[1]; - int[] viewport = new int[] {0, 0, (int)width, (int)height}; - gl.glViewport(0, 0, (int)width, (int)height); - gl.glSelectBuffer(1024, selectBuffer); - gl.glRenderMode(GL.GL_SELECT); - - //drawing scene in selection mode - picking = 60; //indicating that I am trying to pick(used in camera) - gl.glClear(GL.GL_COLOR_BUFFER_BIT); - - camera(drawable); - grid(); - coords(); - gl.glColor3dv(STD_LINE_COLOR); - gl.glLineWidth(1.0f); - drawAll(drawable); - - //picking = 0; - //end drawing scene - - //gl.glMatrixMode(GL.GL_PROJECTION); - //gl.glPopMatrix(); - gl.glFlush(); - - //Geting hits and going back to RENDER mode - hits = gl.glRenderMode(GL.GL_RENDER); - - log.info("x,y = " + x + "," + y + " hits = " + hits + ";SB = " + selectBuffer.get(0)); - - //Processing hits - if (hits >= 1) { - Integer intId = new Integer(selectBuffer.get(3)); - id = new Long(intId.longValue()); - } - - gl.glMatrixMode(GL.GL_MODELVIEW); - - if (id != null) { - return id; - } else { - return null; - } - } } --- 161,163 ---- |
From: Nordholt <nor...@us...> - 2005-08-17 10:58:20
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16706 Modified Files: AbstractView.java Log Message: getObjectAtPoint now supports selection Index: AbstractView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/AbstractView.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AbstractView.java 17 Aug 2005 08:56:08 -0000 1.6 --- AbstractView.java 17 Aug 2005 10:58:11 -0000 1.7 *************** *** 22,28 **** --- 22,31 ---- import java.util.Set; + import java.nio.IntBuffer; + import net.java.games.jogl.GL; import net.java.games.jogl.GLDrawable; import net.java.games.jogl.GLU; + import net.java.games.jogl.util.BufferUtils; import org.apache.log4j.Logger; *************** *** 63,66 **** --- 66,74 ---- 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0}; + /** Select mode for selecting edges */ + private static final int EDGES = 0; + + /** Select mode for selecting surfaces */ + private static final int SURFACES = 1; /** The width of the window */ *************** *** 103,109 **** protected GLU glu = null; - /** The GLDrawable */ - protected GLDrawable drawable = null; - /** The zoomFactor in the parent view */ protected double zoomFactor = 1.0; --- 111,114 ---- *************** *** 112,117 **** protected GLView glv = null; ! /** The frames per second counter */ ! protected int fps = 0; /** --- 117,137 ---- protected GLView glv = null; ! /** Flag for when to use SELECT render mode */ ! protected int picking = 0; ! ! /** The last amount of hits from SELECT render mode */ ! protected int hits = 0; ! ! /** The selection buffer */ ! protected IntBuffer selectBuffer; ! ! /** The x-coordinate of last selection */ ! protected double x; ! ! /** The y-coordinate of last selection */ ! protected double y; ! ! /** The mode of selecting. Either edges or surfaces */ ! private int selectMode; /** *************** *** 133,136 **** --- 153,157 ---- gl = gld.getGL(); glu = gld.getGLU(); + this.width = gld.getSize().getWidth(); this.height = gld.getSize().getHeight(); *************** *** 138,145 **** this.aspect = this.width / this.height; - drawable = gld; - gl.glEnable(GL.GL_DEPTH_TEST); gl.glEnable(GL.GL_BLEND); gl.glClearColor(0.7f, 0.7f, 0.7f, 0.0f); gl.glViewport(0, 0, (int)width, (int)height); --- 159,165 ---- this.aspect = this.width / this.height; gl.glEnable(GL.GL_DEPTH_TEST); gl.glEnable(GL.GL_BLEND); + gl.glClearColor(0.7f, 0.7f, 0.7f, 0.0f); gl.glViewport(0, 0, (int)width, (int)height); *************** *** 157,165 **** glu = gld.getGLU(); ! drawable = gld; ! gl.glViewport(0, 0, (int)width, (int)height); ! camera(gld); gl.glLineWidth(1.0f); --- 177,191 ---- glu = gld.getGLU(); ! int[] mode = new int[1]; gl.glViewport(0, 0, (int)width, (int)height); ! ! if (picking > 0) { ! selectBuffer = BufferUtils.newIntBuffer(512); ! gl.glSelectBuffer(512, selectBuffer); ! gl.glRenderMode(GL.GL_SELECT); ! } ! camera(gld); + picking = 0; gl.glLineWidth(1.0f); *************** *** 170,179 **** gl.glLineWidth(2.0f); drawAll(gld); long after = System.currentTimeMillis(); long ellapsed = after - before; - //StringBuffer buffer = new StringBuffer(); - //buffer.append("ellapsed: "); - //buffer.append(ellapsed); - //log.info(buffer); } --- 196,208 ---- gl.glLineWidth(2.0f); drawAll(gld); + gl.glGetIntegerv(GL.GL_RENDER_MODE, mode); + if (mode[0] == GL.GL_SELECT) { + gl.glFlush(); + hits = gl.glRenderMode(GL.GL_RENDER); + glv.repaint(); + } + long after = System.currentTimeMillis(); long ellapsed = after - before; } *************** *** 222,322 **** Set surfaces = SurfaceFacade.getInstance().findAll(); Set edges = EdgeFacade.getInstance().findAll(); gl = gld.getGL(); glu = gld.getGLU(); ! gl.glInitNames(); ! Iterator it = surfaces.iterator(); ! gl.glColor4dv(SURFACE_COLOR); ! while (it.hasNext()) { ! Surface s = (Surface)it.next(); ! if (!s.equals(selectedSurface)) { ! drawSurface(s); } ! } ! ! it = edges.iterator(); ! gl.glColor3dv(STD_LINE_COLOR); ! while (it.hasNext()) { ! Edge e = (Edge)it.next(); ! if (!e.equals(selectedEdge)) { ! drawEdge(e); } ! } ! ! // draw activeEdge different if it is parallel with axis ! if (activeEdge != null) { ! Vertex to = activeEdge.getTo(); ! Vertex from = activeEdge.getFrom(); ! if (from.getY() == to.getY() && from.getZ() == to.getZ()) { ! gl.glColor3dv(X_AXIS_COLOR); ! } else if (from.getX() == to.getX() && from.getZ() == to.getZ()) { ! gl.glColor3dv(Y_AXIS_COLOR); ! } else if (from.getX() == to.getX() && from.getY() == to.getY()) { ! gl.glColor3dv(Z_AXIS_COLOR); ! } else { ! gl.glColor3dv(STD_LINE_COLOR); } ! gl.glBegin(GL.GL_LINES); ! gl.glLineWidth(1.0f); ! gl.glVertex3d(from.getX(), from.getY(), from.getZ()); ! gl.glVertex3d(to.getX(), to.getY(), to.getZ()); ! gl.glEnd(); ! } ! ! // draw alignment line ! if (alignPoint != null && alignVertex != null) { ! if (alignPoint[1] == alignVertex.getY() && alignPoint[2] == alignVertex.getZ()) { ! gl.glColor3dv(X_AXIS_COLOR); ! } else if (alignPoint[0] == alignVertex.getX() && alignPoint[2] == alignVertex.getZ()) { ! gl.glColor3dv(Y_AXIS_COLOR); ! } else if (alignPoint[0] == alignVertex.getX() && alignPoint[1] == alignVertex.getY()) { ! gl.glColor3dv(Z_AXIS_COLOR); ! } else { ! gl.glColor3dv(DRAW_COLOR); } - gl.glBegin(GL.GL_LINES); - gl.glVertex3d(alignPoint[0], alignPoint[1], alignPoint[2]); - gl.glVertex3d(alignVertex.getX(), alignVertex.getY(), alignVertex.getZ()); - gl.glEnd(); - } - - // draw snap point if any - if (snapVertex != null) { - gl.glColor3d(0.0, 1.0, 0.0); - gl.glPointSize(5.0f); - gl.glBegin(GL.GL_POINTS); - gl.glVertex3d(snapVertex.getX(), snapVertex.getY(), snapVertex.getZ()); - gl.glEnd(); - gl.glPointSize(1.0f); - } ! // draw selected vertex ! if (selectedVertex != null) { ! gl.glColor4dv(SELECTED_COLOR); ! gl.glPointSize(5.0f); ! gl.glBegin(GL.GL_POINTS); ! selectedVertex = VertexFacade.getInstance().findById(selectedVertex.getId()); ! gl.glVertex3d(selectedVertex.getX(), selectedVertex.getY(), selectedVertex.getZ()); ! gl.glEnd(); ! gl.glPointSize(1.0f); ! } ! ! // draw selected edge ! if (selectedEdge != null) { ! gl.glColor4dv(SELECTED_COLOR); ! selectedEdge = EdgeFacade.getInstance().findById(selectedEdge.getId()); ! Vertex to = selectedEdge.getTo(); ! Vertex from = selectedEdge.getFrom(); ! gl.glBegin(GL.GL_LINES); ! gl.glVertex3d(to.getX(), to.getY(), to.getZ()); ! gl.glVertex3d(from.getX(), from.getY(), from.getZ()); ! gl.glEnd(); ! } ! // draw selected surface ! if (selectedSurface != null) { ! gl.glColor4dv(SELECTED_COLOR); ! selectedSurface = SurfaceFacade.getInstance().findById(selectedSurface.getId()); ! drawSurface(selectedSurface); } } --- 251,380 ---- Set surfaces = SurfaceFacade.getInstance().findAll(); Set edges = EdgeFacade.getInstance().findAll(); + int[] mode = new int[1]; + gl.glGetIntegerv(GL.GL_RENDER_MODE, mode); + gl = gld.getGL(); glu = gld.getGLU(); ! gl.glInitNames(); ! if (mode[0] != GL.GL_SELECT) { ! Iterator it = surfaces.iterator(); ! gl.glColor4dv(SURFACE_COLOR); ! while (it.hasNext()) { ! Surface s = (Surface)it.next(); ! if (!s.equals(selectedSurface)) { ! drawSurface(s); ! } } ! ! it = edges.iterator(); ! gl.glColor3dv(STD_LINE_COLOR); ! while (it.hasNext()) { ! Edge e = (Edge)it.next(); ! if (!e.equals(selectedEdge)) { ! drawEdge(e); ! } } ! ! // draw activeEdge different if it is parallel with axis ! if (activeEdge != null) { ! Vertex to = activeEdge.getTo(); ! Vertex from = activeEdge.getFrom(); ! if (from.getY() == to.getY() && from.getZ() == to.getZ()) { ! gl.glColor3dv(X_AXIS_COLOR); ! } else if (from.getX() == to.getX() && from.getZ() == to.getZ()) { ! gl.glColor3dv(Y_AXIS_COLOR); ! } else if (from.getX() == to.getX() && from.getY() == to.getY()) { ! gl.glColor3dv(Z_AXIS_COLOR); ! } else { ! gl.glColor3dv(STD_LINE_COLOR); ! } ! gl.glBegin(GL.GL_LINES); ! gl.glLineWidth(1.0f); ! gl.glVertex3d(from.getX(), from.getY(), from.getZ()); ! gl.glVertex3d(to.getX(), to.getY(), to.getZ()); ! gl.glEnd(); } ! ! // draw alignment line ! if (alignPoint != null && alignVertex != null) { ! if (alignPoint[1] == alignVertex.getY() && alignPoint[2] == alignVertex.getZ()) { ! gl.glColor3dv(X_AXIS_COLOR); ! } else if (alignPoint[0] == alignVertex.getX() && alignPoint[2] == alignVertex.getZ()) { ! gl.glColor3dv(Y_AXIS_COLOR); ! } else if (alignPoint[0] == alignVertex.getX() && alignPoint[1] == alignVertex.getY()) { ! gl.glColor3dv(Z_AXIS_COLOR); ! } else { ! gl.glColor3dv(DRAW_COLOR); ! } ! gl.glBegin(GL.GL_LINES); ! gl.glVertex3d(alignPoint[0], alignPoint[1], alignPoint[2]); ! gl.glVertex3d(alignVertex.getX(), alignVertex.getY(), alignVertex.getZ()); ! gl.glEnd(); } ! // draw snap point if any ! if (snapVertex != null) { ! gl.glColor3d(0.0, 1.0, 0.0); ! gl.glPointSize(5.0f); ! gl.glBegin(GL.GL_POINTS); ! gl.glVertex3d(snapVertex.getX(), snapVertex.getY(), snapVertex.getZ()); ! gl.glEnd(); ! gl.glPointSize(1.0f); ! } ! ! // draw selected vertex ! if (selectedVertex != null) { ! gl.glColor4dv(SELECTED_COLOR); ! gl.glPointSize(5.0f); ! gl.glBegin(GL.GL_POINTS); ! selectedVertex = VertexFacade.getInstance().findById(selectedVertex.getId()); ! gl.glVertex3d(selectedVertex.getX(), selectedVertex.getY(), selectedVertex.getZ()); ! gl.glEnd(); ! gl.glPointSize(1.0f); ! } ! ! // draw selected edge ! if (selectedEdge != null) { ! gl.glColor4dv(SELECTED_COLOR); ! selectedEdge = EdgeFacade.getInstance().findById(selectedEdge.getId()); ! Vertex to = selectedEdge.getTo(); ! Vertex from = selectedEdge.getFrom(); ! gl.glBegin(GL.GL_LINES); ! gl.glVertex3d(to.getX(), to.getY(), to.getZ()); ! gl.glVertex3d(from.getX(), from.getY(), from.getZ()); ! gl.glEnd(); ! } ! // draw selected surface ! if (selectedSurface != null) { ! gl.glColor4dv(SELECTED_COLOR); ! selectedSurface = SurfaceFacade.getInstance().findById(selectedSurface.getId()); ! drawSurface(selectedSurface); ! } ! } else { ! if (selectMode == SURFACES) { ! Iterator it = surfaces.iterator(); ! gl.glColor4dv(SURFACE_COLOR); ! while (it.hasNext()) { ! Surface s = (Surface)it.next(); ! int name = s.getId().intValue(); ! gl.glPushName(name); ! drawSurface(s); ! gl.glPopName(); ! } ! } ! ! if (selectMode == EDGES) { ! Iterator it = edges.iterator(); ! gl.glColor3dv(STD_LINE_COLOR); ! while (it.hasNext()) { ! Edge e = (Edge)it.next(); ! int name = e.getId().intValue(); ! gl.glPushName(name); ! drawEdge(e); ! gl.glPopName(); ! } ! } } } *************** *** 368,372 **** Vertex from = e.getFrom(); int name = e.getId().intValue(); - gl.glPushName(name); if (to != null && from != null) { gl.glBegin(GL.GL_LINE_STRIP); --- 426,429 ---- *************** *** 375,379 **** gl.glEnd(); } - gl.glPopName(); } --- 432,435 ---- *************** *** 566,576 **** /** ! * Gets id of the object under a point. For use in 3D selection. ! * @param x the x coordinate of the point ! * @param y the y coordinate of the point * @return a Long id of the object under the point, null if no object is there */ ! public Long getObjectAtPoint(double x, double y) { ! return null; } --- 622,692 ---- /** ! * Processes the select buffer ! * @return the ID of the closest hit ! */ ! private Long processSelect() { ! //Processing hits ! int bufferOffset = 0; ! int names = 0; ! int minZ = Integer.MAX_VALUE; ! int z1; ! int z2; ! Long id = null; ! Integer intId; ! for (int i = 0; i < hits; i++) { ! names = selectBuffer.get(bufferOffset); ! if (names > 0) { ! bufferOffset++; ! z1 = selectBuffer.get(bufferOffset); ! z2 = selectBuffer.get(bufferOffset + 1); ! bufferOffset += 2; ! if (z1 < minZ) { ! minZ = z1; ! id = new Long((new Integer(selectBuffer.get(bufferOffset))).longValue()); ! } ! bufferOffset += names; ! } else { ! bufferOffset += 3; ! } ! } ! ! if (id != null) { ! return id; ! } else { ! return null; ! } ! } ! ! /** ! * Gets id of the object under a point. For use in selection. ! * @param x the x coordinate of the point in mouse coordinates ! * @param y the y coordinate of the point in mouse coordinates * @return a Long id of the object under the point, null if no object is there */ ! public Object getObjectAtPoint(double x, double y) { ! Long id = null; ! this.x = x; ! this.y = y; ! //indicating that I am trying to pick(used in camera) ! picking = 10; ! selectMode = EDGES; ! //repainting to get selection buffer ! glv.repaint(true); ! id = processSelect(); ! if (id != null) { ! Edge e = EdgeFacade.getInstance().findById(id); ! return e; ! } ! //indicating that I am trying to pick(used in camera) ! picking = 10; ! selectMode = SURFACES; ! //repainting to get selection buffer ! glv.repaint(true); ! id = processSelect(); ! if (id != null) { ! Surface s = SurfaceFacade.getInstance().findById(id); ! return s; ! } ! return null; } |
From: Nordholt <nor...@us...> - 2005-08-17 10:56:23
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16342 Modified Files: View.java Log Message: Changed getObjectAtPoint to return an object Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** View.java 17 Aug 2005 09:00:17 -0000 1.4 --- View.java 17 Aug 2005 10:56:15 -0000 1.5 *************** *** 126,131 **** * @param x the x coordinate of the point * @param y the y coordinate of the point ! * @return a Long id of the object under the point, null if no object is there */ ! public Long getObjectAtPoint(double x, double y); } --- 126,131 ---- * @param x the x coordinate of the point * @param y the y coordinate of the point ! * @return The object under the point, null if no object is there. */ ! public Object getObjectAtPoint(double x, double y); } |
From: Nordholt <nor...@us...> - 2005-08-17 10:55:25
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16183 Modified Files: SelectTool.java Log Message: Selection in 3D added Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SelectTool.java 15 Aug 2005 12:49:31 -0000 1.4 --- SelectTool.java 17 Aug 2005 10:55:15 -0000 1.5 *************** *** 108,117 **** coordsx[0] == 0 && coordsx[1] == 0 && coordsx[2] == 0 && coordsy[0] == 0 && coordsy[1] == 0 && coordsy[2] == 0) { viewType = View.VIEW_3D; ! Edge edge = edgeCollide3D(x, y); ! if (edge != null) { Notification n = new Notification(Notification.EDGE_SELECTED, edge.getId()); Notifier.getInstance().sendNotification(n); } } else { Vertex v = vertexCollide(coords); --- 108,124 ---- coordsx[0] == 0 && coordsx[1] == 0 && coordsx[2] == 0 && coordsy[0] == 0 && coordsy[1] == 0 && coordsy[2] == 0) { + Object o; viewType = View.VIEW_3D; ! o = view.getObjectAtPoint(x, y); ! if (o instanceof Edge) { ! Edge edge = (Edge)o; Notification n = new Notification(Notification.EDGE_SELECTED, edge.getId()); Notifier.getInstance().sendNotification(n); } + if (o instanceof Surface) { + Surface surface = (Surface)o; + Notification n = new Notification(Notification.SURFACE_SELECTED, surface.getId()); + Notifier.getInstance().sendNotification(n); + } } else { Vertex v = vertexCollide(coords); *************** *** 296,315 **** } - - /** - * Check if a point is over any edge in 3D. - * @param x the x coordinate of the point - * @param y the y coordinate of the point - * @return an Edge the point is over, null if no Edge is found - */ - protected Edge edgeCollide3D(double x, double y) { - View view = glv.getView(); - Long id = view.getObjectAtPoint(x, y); - if (id != null) { - return EdgeFacade.getInstance().findById(id); - } - return null; - } - /** * Handle a notification --- 303,306 ---- |
From: rimestad <rim...@us...> - 2005-08-17 10:18:11
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10255/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: fixed dimension bug Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** GLView.java 17 Aug 2005 09:10:10 -0000 1.8 --- GLView.java 17 Aug 2005 10:18:02 -0000 1.9 *************** *** 7,12 **** package net.sourceforge.bprocessor.gl; - import java.awt.Dimension; - import net.sourceforge.bprocessor.gl.tool.Tool; import net.sourceforge.bprocessor.gl.tool.ToolFactory; --- 7,10 ---- *************** *** 49,54 **** view = ViewFactory.getFactory(this).getDefault(); glc.addGLEventListener(view); - glc.setMinimumSize(new Dimension(320, 0)); - glc.setMaximumSize(new Dimension(1024, 768)); tool = ToolFactory.getFactory(this).getDefault(); --- 47,50 ---- |
From: Jesper P. <je...@us...> - 2005-08-17 10:08:19
|
Update of /cvsroot/bprocessor/kernel/src/net/sourceforge/bprocessor/kernel/notification In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8476 Modified Files: Notifier.java Log Message: Use async notifications Index: Notifier.java =================================================================== RCS file: /cvsroot/bprocessor/kernel/src/net/sourceforge/bprocessor/kernel/notification/Notifier.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Notifier.java 1 Jul 2005 11:30:00 -0000 1.2 --- Notifier.java 17 Aug 2005 10:08:08 -0000 1.3 *************** *** 77,82 **** while (it.hasNext()) { NotificationListener l = (NotificationListener)it.next(); ! if (l.isNotificationEnabled(n.getType())) { ! l.handleNotification(n); } } --- 77,110 ---- while (it.hasNext()) { NotificationListener l = (NotificationListener)it.next(); ! new NotificationThread(l, n).start(); ! } ! } ! ! /** ! * Notification thread ! */ ! class NotificationThread extends Thread { ! /** The NotificationListener */ ! private NotificationListener listener; ! ! /** The notification */ ! private Notification n; ! ! /** ! * Constructor ! * @param listener The notification listener ! * @param n The notification ! */ ! NotificationThread(NotificationListener listener, Notification n) { ! this.listener = listener; ! this.n = n; ! } ! ! /** ! * Run ! */ ! public void run() { ! if (listener.isNotificationEnabled(n.getType())) { ! listener.handleNotification(n); } } |
From: rimestad <rim...@us...> - 2005-08-17 09:10:19
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31377 Modified Files: GLView.java Log Message: Added reset of view on view and tool change Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** GLView.java 11 Aug 2005 13:23:20 -0000 1.7 --- GLView.java 17 Aug 2005 09:10:10 -0000 1.8 *************** *** 15,22 **** import net.sourceforge.bprocessor.gui.GUI; - import net.java.games.jogl.Animator; import net.java.games.jogl.GLCapabilities; import net.java.games.jogl.GLDrawableFactory; ! import net.java.games.jogl.GLJPanel; import org.apache.log4j.Logger; --- 15,21 ---- import net.sourceforge.bprocessor.gui.GUI; import net.java.games.jogl.GLCapabilities; import net.java.games.jogl.GLDrawableFactory; ! import net.java.games.jogl.GLCanvas; import org.apache.log4j.Logger; *************** *** 30,34 **** /** GL canvas */ ! private GLJPanel glc; /** current event listener */ --- 29,33 ---- /** GL canvas */ ! private GLCanvas glc; /** current event listener */ *************** *** 37,43 **** /** current working tool */ private Tool tool; - - /** The animator */ - private Animator animator; /** --- 36,39 ---- *************** *** 49,53 **** glCap.setDoubleBuffered(true); glCap.setHardwareAccelerated(true); ! glc = GLDrawableFactory.getFactory().createGLJPanel(glCap); view = ViewFactory.getFactory(this).getDefault(); --- 45,49 ---- glCap.setDoubleBuffered(true); glCap.setHardwareAccelerated(true); ! glc = GLDrawableFactory.getFactory().createGLCanvas(glCap); view = ViewFactory.getFactory(this).getDefault(); *************** *** 60,65 **** glc.addMouseMotionListener(tool); glc.addKeyListener(tool); - animator = new Animator(glc); - start(); GUI.getInstance().registerPanel(glc, GUI.SPLIT_MIDDLE); --- 56,59 ---- *************** *** 68,87 **** /** - * Start the animator - * - */ - public void start() { - animator.start(); - } - - /** - * Stop the animator - * - */ - public void stop() { - animator.stop(); - } - - /** * Change the tool * @param mode The new tool --- 62,65 ---- *************** *** 99,102 **** --- 77,81 ---- log.error("[changeMode] tool was null"); } + getView().reset(); } *************** *** 115,118 **** --- 94,98 ---- glc.addGLEventListener(view); } + getView().reset(); this.repaint(); } |
From: rimestad <rim...@us...> - 2005-08-17 09:01:33
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29037 Modified Files: AbstractTool.java Log Message: Added view variable reset on view and tool change Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AbstractTool.java 5 Aug 2005 11:24:15 -0000 1.7 --- AbstractTool.java 17 Aug 2005 09:01:26 -0000 1.8 *************** *** 97,123 **** v.zoom(0.9); } else if (e.getKeyCode() == KeyEvent.VK_Q) { - glv.getView().setAlignVertex(null); - glv.getView().setSnapVertex(null); glv.changeTool(Tool.SELECT_TOOL); } else if (e.getKeyCode() == KeyEvent.VK_W) { glv.changeTool(Tool.DRAW_TOOL); } else if (e.getKeyCode() == KeyEvent.VK_E) { - glv.getView().setAlignVertex(null); - glv.getView().setSnapVertex(null); glv.changeTool(Tool.MOVE_TOOL); } else if (e.getKeyCode() == KeyEvent.VK_R) { - glv.getView().setAlignVertex(null); - glv.getView().setSnapVertex(null); glv.changeTool(Tool.EXTRUSION_TOOL); ! } ! glv.repaint(); ! } ! ! /** ! * Invoked when a key has been released. ! * @param e The KeyEvent ! */ ! public void keyReleased(KeyEvent e) { ! if (e.getKeyChar() == KeyEvent.VK_1) { glv.changeView(View.VIEW_3D); } else if (e.getKeyChar() == KeyEvent.VK_2) { --- 97,108 ---- v.zoom(0.9); } else if (e.getKeyCode() == KeyEvent.VK_Q) { glv.changeTool(Tool.SELECT_TOOL); } else if (e.getKeyCode() == KeyEvent.VK_W) { glv.changeTool(Tool.DRAW_TOOL); } else if (e.getKeyCode() == KeyEvent.VK_E) { glv.changeTool(Tool.MOVE_TOOL); } else if (e.getKeyCode() == KeyEvent.VK_R) { glv.changeTool(Tool.EXTRUSION_TOOL); ! } else if (e.getKeyChar() == KeyEvent.VK_1) { glv.changeView(View.VIEW_3D); } else if (e.getKeyChar() == KeyEvent.VK_2) { *************** *** 128,131 **** --- 113,124 ---- glv.changeView(View.VIEW_YZ); } + glv.repaint(); + } + + /** + * Invoked when a key has been released. + * @param e The KeyEvent + */ + public void keyReleased(KeyEvent e) { } |
From: rimestad <rim...@us...> - 2005-08-17 09:00:28
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28666 Modified Files: View.java Log Message: Added a reset of variables to the interface Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** View.java 15 Aug 2005 12:53:11 -0000 1.3 --- View.java 17 Aug 2005 09:00:17 -0000 1.4 *************** *** 31,34 **** --- 31,39 ---- /** + * Resets the working attributes of the view + */ + public void reset(); + + /** * Return the 3D coordinates for the canvas matching the given 2D coords * @param coords The window coordinates |
From: rimestad <rim...@us...> - 2005-08-17 08:58:57
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28375 Modified Files: ViewFactory.java Log Message: changed log message from error to warn Index: ViewFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/ViewFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ViewFactory.java 5 Aug 2005 11:04:17 -0000 1.2 --- ViewFactory.java 17 Aug 2005 08:58:49 -0000 1.3 *************** *** 103,107 **** return viewYZ; } else { ! log.error("[get] no such view " + i); return null; } --- 103,107 ---- return viewYZ; } else { ! log.warn("[get] no such view " + i); return null; } |
From: rimestad <rim...@us...> - 2005-08-17 08:58:00
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28192 Modified Files: ViewXY.java ViewXZ.java ViewYZ.java View3D.java Log Message: Moved the grid a little to obtain a better depth feeling Index: View3D.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View3D.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** View3D.java 16 Aug 2005 12:03:26 -0000 1.4 --- View3D.java 17 Aug 2005 08:57:52 -0000 1.5 *************** *** 37,44 **** /** The rotaion about the X axis */ ! private static double rotationX = 0; /** The rotation about the Y axis */ ! private static double rotationY = -30; /** The picking state */ --- 37,44 ---- /** The rotaion about the X axis */ ! private static double rotationX = -30; /** The rotation about the Y axis */ ! private static double rotationY = 130; /** The picking state */ *************** *** 83,99 **** if (aspect < 1.0) { // fovy, aspect, near, far (relative to camera position) ! glu.gluPerspective(aspect * 60.0, 1.0, 0.0, 50.0); } else { ! glu.gluPerspective(60.0, aspect, 0.0, 50.0); } gl.glMatrixMode(GL.GL_MODELVIEW); gl.glLoadIdentity(); ! glu.gluLookAt(0.0, 15.0 * getZoomFactor(), 20.0 * getZoomFactor(), ! center[0], center[1], center[2], ! 0.0, 1.0, 0.0); gl.glMultMatrixd(viewTrans); gl.glRotated(rotationX, 1.0, 0.0, 0.0); ! gl.glRotated(rotationY, 0.0, 1.0, 0.0); } --- 83,101 ---- if (aspect < 1.0) { // fovy, aspect, near, far (relative to camera position) ! glu.gluPerspective(aspect * 60.0, 1.0, 0.5, 50.0 * getZoomFactor()); } else { ! glu.gluPerspective(60.0, aspect, 0.5, 50.0 * getZoomFactor()); } gl.glMatrixMode(GL.GL_MODELVIEW); gl.glLoadIdentity(); ! glu.gluLookAt(0.0 + center[0], ! 25.0 * getZoomFactor() + center[1], ! 0.0 + center[2], ! center[0], center[1], center[2], ! 0.0, 0.0, 1.0); gl.glMultMatrixd(viewTrans); gl.glRotated(rotationX, 1.0, 0.0, 0.0); ! gl.glRotated(rotationY, 0.0, 0.0, 1.0); } *************** *** 104,110 **** public void translateCenter(double [] mv) { if (mv.length == 3) { ! this.viewTrans[12] -= mv[0]; ! this.viewTrans[13] += mv[2]; ! this.viewTrans[14] += mv[1]; } else { log.error("[translateViewMatrix] Wrong parameter size"); --- 106,112 ---- public void translateCenter(double [] mv) { if (mv.length == 3) { ! this.center[0] -= mv[0]; ! this.center[1] += mv[2]; ! this.center[2] += mv[1]; } else { log.error("[translateViewMatrix] Wrong parameter size"); *************** *** 117,121 **** */ public void translateRotationX(double change) { ! rotationX -= change / height; } --- 119,123 ---- */ public void translateRotationX(double change) { ! rotationX += change / height; } *************** *** 132,138 **** */ protected void grid() { - gl.glLineWidth(1.0f); - gl.glColor3dv(GRID_COLOR); - gl.glBegin(GL.GL_LINES); double size = this.size; if (aspect > 1) { --- 134,137 ---- *************** *** 141,151 **** size /= aspect; } for (int x = -(int)size; x <= (int)size; x++) { ! gl.glVertex3d((double) x, 0.0, -size); ! gl.glVertex3d((double) x, 0.0, size); } ! for (int z = -(int)size; z <= (int)size; z++) { ! gl.glVertex3d(-size, 0.0, (double) z); ! gl.glVertex3d(size, 0.0, (double) z); } gl.glEnd(); --- 140,152 ---- size /= aspect; } + gl.glColor4dv(GRID_COLOR); + gl.glBegin(GL.GL_LINES); for (int x = -(int)size; x <= (int)size; x++) { ! gl.glVertex3d((double) x, -size, -0.001); ! gl.glVertex3d((double) x, size, -0.001); } ! for (int y = -(int)size; y <= (int)size; y++) { ! gl.glVertex3d(-size, (double) y, -0.001); ! gl.glVertex3d(size, (double) y, -0.001); } gl.glEnd(); *************** *** 156,160 **** */ protected void coords() { - gl.glLineWidth(2.0f); gl.glBegin(GL.GL_LINES); gl.glColor3dv(X_AXIS_COLOR); --- 157,160 ---- Index: ViewXY.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/ViewXY.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ViewXY.java 5 Aug 2005 11:02:31 -0000 1.2 --- ViewXY.java 17 Aug 2005 08:57:52 -0000 1.3 *************** *** 80,86 **** */ protected void grid() { - gl.glLineWidth(1.0f); - gl.glColor3dv(GRID_COLOR); - gl.glBegin(GL.GL_LINES); double size; if (aspect > 1) { --- 80,83 ---- *************** *** 89,99 **** size = this.size * getZoomFactor() / aspect; } for (int x = -(int)size; x <= (int)size; x++) { ! gl.glVertex3d((double) x, -size, 0.0); ! gl.glVertex3d((double) x, size, 0.0); } for (int y = -(int)size; y <= (int)size; y++) { ! gl.glVertex3d(-size, (double) y, 0.0); ! gl.glVertex3d(size, (double) y, 0.0); } gl.glEnd(); --- 86,98 ---- size = this.size * getZoomFactor() / aspect; } + gl.glColor4dv(GRID_COLOR); + gl.glBegin(GL.GL_LINES); for (int x = -(int)size; x <= (int)size; x++) { ! gl.glVertex3d((double) x, -size, -90.0); ! gl.glVertex3d((double) x, size, -90.0); } for (int y = -(int)size; y <= (int)size; y++) { ! gl.glVertex3d(-size, (double) y, -90.0); ! gl.glVertex3d(size, (double) y, -90.0); } gl.glEnd(); *************** *** 104,108 **** */ protected void coords() { - gl.glLineWidth(2.0f); gl.glBegin(GL.GL_LINES); gl.glColor3dv(X_AXIS_COLOR); --- 103,106 ---- Index: ViewXZ.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/ViewXZ.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ViewXZ.java 5 Aug 2005 11:02:31 -0000 1.2 --- ViewXZ.java 17 Aug 2005 08:57:52 -0000 1.3 *************** *** 83,89 **** */ protected void grid() { - gl.glLineWidth(1.0f); - gl.glColor3dv(GRID_COLOR); - gl.glBegin(GL.GL_LINES); double size; if (aspect > 1) { --- 83,86 ---- *************** *** 92,102 **** size = this.size * getZoomFactor() / aspect; } for (int x = -(int)size; x <= (int)size; x++) { ! gl.glVertex3d((double) x, 0.0, -size); ! gl.glVertex3d((double) x, 0.0, size); } for (int z = -(int)size; z <= (int)size; z++) { ! gl.glVertex3d(-size, 0.0, (double) z); ! gl.glVertex3d(size, 0.0, (double) z); } gl.glEnd(); --- 89,101 ---- size = this.size * getZoomFactor() / aspect; } + gl.glColor4dv(GRID_COLOR); + gl.glBegin(GL.GL_LINES); for (int x = -(int)size; x <= (int)size; x++) { ! gl.glVertex3d((double) x, 90.0, -size); ! gl.glVertex3d((double) x, 90.0, size); } for (int z = -(int)size; z <= (int)size; z++) { ! gl.glVertex3d(-size, 90.0, (double) z); ! gl.glVertex3d(size, 90.0, (double) z); } gl.glEnd(); *************** *** 107,111 **** */ protected void coords() { - gl.glLineWidth(2.0f); gl.glBegin(GL.GL_LINES); gl.glColor3dv(X_AXIS_COLOR); --- 106,109 ---- Index: ViewYZ.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/ViewYZ.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ViewYZ.java 5 Aug 2005 11:02:31 -0000 1.2 --- ViewYZ.java 17 Aug 2005 08:57:52 -0000 1.3 *************** *** 87,100 **** size = this.size * getZoomFactor() / aspect; } ! gl.glLineWidth(1.0f); ! gl.glColor3dv(GRID_COLOR); gl.glBegin(GL.GL_LINES); for (int y = -(int)size; y <= size; y++) { ! gl.glVertex3d(0.0, (double)y, -size); ! gl.glVertex3d(0.0, (double)y, size); } for (int z = -(int)size; z <= size; z++) { ! gl.glVertex3d(0.0, -size, (double)z); ! gl.glVertex3d(0.0, size, (double)z); } gl.glEnd(); --- 87,99 ---- size = this.size * getZoomFactor() / aspect; } ! gl.glColor4dv(GRID_COLOR); gl.glBegin(GL.GL_LINES); for (int y = -(int)size; y <= size; y++) { ! gl.glVertex3d(90.0, (double)y, -size); ! gl.glVertex3d(90.0, (double)y, size); } for (int z = -(int)size; z <= size; z++) { ! gl.glVertex3d(90.0, -size, (double)z); ! gl.glVertex3d(90.0, size, (double)z); } gl.glEnd(); *************** *** 105,109 **** */ protected void coords() { - gl.glLineWidth(2.0f); gl.glBegin(GL.GL_LINES); gl.glColor3dv(Y_AXIS_COLOR); --- 104,107 ---- |
From: rimestad <rim...@us...> - 2005-08-17 08:56:19
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27837 Modified Files: AbstractView.java Log Message: changed the look so that surfaces is draw solid with a little transparency and edges a bit more massive Index: AbstractView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/AbstractView.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AbstractView.java 16 Aug 2005 12:03:26 -0000 1.5 --- AbstractView.java 17 Aug 2005 08:56:08 -0000 1.6 *************** *** 9,13 **** import net.sourceforge.bprocessor.kernel.notification.Notification; - import net.sourceforge.bprocessor.gl.tool.Util; import net.sourceforge.bprocessor.gl.GLView; --- 9,12 ---- *************** *** 45,49 **** /** the std line color*/ ! public static final double[] STD_LINE_COLOR = new double[] {0.0, 0.0, 0.0}; /** Used for the actual drawing line */ --- 44,48 ---- /** the std line color*/ ! public static final double[] STD_LINE_COLOR = new double[] {0.1, 0.1, 0.1}; /** Used for the actual drawing line */ *************** *** 51,58 **** /** Used for the actual drawing line */ ! public static final double[] GRID_COLOR = new double[] {0.85, 0.85, 0.85}; /** Used for selected objects */ ! public static final double[] SELECTED_COLOR = new double[] {1.0, 0.4, 1.0}; /** The view transformation matrix (it is shown transposed) see p. 187 [GL BIBLE]*/ --- 50,60 ---- /** Used for the actual drawing line */ ! public static final double[] GRID_COLOR = new double[] {0.85, 0.85, 0.85, 0.8}; ! ! /** Surface color for all not selected surfaces */ ! public static final double[] SURFACE_COLOR = new double[] {0.93, 0.93, 0.93, 0.7}; /** Used for selected objects */ ! public static final double[] SELECTED_COLOR = new double[] {1.0, 0.4, 1.0, 0.7}; /** The view transformation matrix (it is shown transposed) see p. 187 [GL BIBLE]*/ *************** *** 131,135 **** gl = gld.getGL(); glu = gld.getGLU(); - gl.glEnable(GL.GL_CULL_FACE); this.width = gld.getSize().getWidth(); this.height = gld.getSize().getHeight(); --- 133,136 ---- *************** *** 139,142 **** --- 140,145 ---- drawable = gld; + gl.glEnable(GL.GL_DEPTH_TEST); + gl.glEnable(GL.GL_BLEND); gl.glClearColor(0.7f, 0.7f, 0.7f, 0.0f); gl.glViewport(0, 0, (int)width, (int)height); *************** *** 150,165 **** long before = System.currentTimeMillis(); gl = gld.getGL(); glu = gld.getGLU(); drawable = gld; - gl.glClear(GL.GL_COLOR_BUFFER_BIT); gl.glViewport(0, 0, (int)width, (int)height); camera(gld); ! grid(); coords(); gl.glColor3dv(STD_LINE_COLOR); ! gl.glLineWidth(1.0f); drawAll(gld); long after = System.currentTimeMillis(); --- 153,172 ---- long before = System.currentTimeMillis(); gl = gld.getGL(); + gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); + gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA); + glu = gld.getGLU(); drawable = gld; gl.glViewport(0, 0, (int)width, (int)height); camera(gld); ! ! gl.glLineWidth(1.0f); grid(); + gl.glLineWidth(3.0f); coords(); gl.glColor3dv(STD_LINE_COLOR); ! gl.glLineWidth(2.0f); drawAll(gld); long after = System.currentTimeMillis(); *************** *** 172,175 **** --- 179,191 ---- /** + * Resets the working attributes of the view + */ + public void reset() { + setAlignVertex(null); + setSnapVertex(null); + setAlignPoint(null); + } + + /** * Called by the drawable during the first repaint after the component has been resized. * @param gld The GLDrawable *************** *** 204,208 **** */ protected void drawAll(GLDrawable gld) { ! Set edges = EdgeFacade.getInstance().findAll(); gl = gld.getGL(); --- 220,224 ---- */ protected void drawAll(GLDrawable gld) { ! Set surfaces = SurfaceFacade.getInstance().findAll(); Set edges = EdgeFacade.getInstance().findAll(); gl = gld.getGL(); *************** *** 210,218 **** gl.glInitNames(); ! Iterator it = edges.iterator(); ! gl.glColor3dv(STD_LINE_COLOR); while (it.hasNext()) { Edge e = (Edge)it.next(); ! drawEdge(e); } --- 226,245 ---- gl.glInitNames(); ! Iterator it = surfaces.iterator(); ! gl.glColor4dv(SURFACE_COLOR); ! while (it.hasNext()) { ! Surface s = (Surface)it.next(); ! if (!s.equals(selectedSurface)) { ! drawSurface(s); ! } ! } ! ! it = edges.iterator(); ! gl.glColor3dv(STD_LINE_COLOR); while (it.hasNext()) { Edge e = (Edge)it.next(); ! if (!e.equals(selectedEdge)) { ! drawEdge(e); ! } } *************** *** 231,234 **** --- 258,262 ---- } gl.glBegin(GL.GL_LINES); + gl.glLineWidth(1.0f); gl.glVertex3d(from.getX(), from.getY(), from.getZ()); gl.glVertex3d(to.getX(), to.getY(), to.getZ()); *************** *** 265,269 **** // draw selected vertex if (selectedVertex != null) { ! gl.glColor3dv(SELECTED_COLOR); gl.glPointSize(5.0f); gl.glBegin(GL.GL_POINTS); --- 293,297 ---- // draw selected vertex if (selectedVertex != null) { ! gl.glColor4dv(SELECTED_COLOR); gl.glPointSize(5.0f); gl.glBegin(GL.GL_POINTS); *************** *** 276,280 **** // draw selected edge if (selectedEdge != null) { ! gl.glColor3dv(SELECTED_COLOR); selectedEdge = EdgeFacade.getInstance().findById(selectedEdge.getId()); Vertex to = selectedEdge.getTo(); --- 304,308 ---- // draw selected edge if (selectedEdge != null) { ! gl.glColor4dv(SELECTED_COLOR); selectedEdge = EdgeFacade.getInstance().findById(selectedEdge.getId()); Vertex to = selectedEdge.getTo(); *************** *** 288,292 **** // draw selected surface if (selectedSurface != null) { ! gl.glColor3dv(SELECTED_COLOR); selectedSurface = SurfaceFacade.getInstance().findById(selectedSurface.getId()); drawSurface(selectedSurface); --- 316,320 ---- // draw selected surface if (selectedSurface != null) { ! gl.glColor4dv(SELECTED_COLOR); selectedSurface = SurfaceFacade.getInstance().findById(selectedSurface.getId()); drawSurface(selectedSurface); *************** *** 299,308 **** */ private void drawSurface(Surface s) { ! List l = Util.traverse(s); if (l != null) { gl.glBegin(GL.GL_POLYGON); for (int i = 0; i < l.size(); i++) { ! Vertex v = (Vertex)l.get(i); ! gl.glVertex3d(v.getX(), v.getY(), v.getZ()); } gl.glEnd(); --- 327,358 ---- */ private void drawSurface(Surface s) { ! List l = s.getEdges(); if (l != null) { gl.glBegin(GL.GL_POLYGON); + Vertex previous = null; + Edge previousEdge = null; for (int i = 0; i < l.size(); i++) { ! Edge e = (Edge)l.get(i); ! if (previous == null) { ! previous = e.getTo(); ! // will be drawn with the secound vertex as to find out if it is to or from that counts ! } else { ! Vertex temp = e.otherVertex(previous); ! if (temp != null) { ! gl.glVertex3d(previous.getX(), previous.getY(), previous.getZ()); ! previous = temp; ! gl.glVertex3d(previous.getX(), previous.getY(), previous.getZ()); ! } else { ! temp = previousEdge.otherVertex(previous); ! gl.glVertex3d(temp.getX(), temp.getY(), temp.getZ()); ! previous = e.otherVertex(temp); ! if (previous == null) { ! log.warn("[drawSurface] could not find vertex " + temp + " on " + e); ! } else { ! gl.glVertex3d(previous.getX(), previous.getY(), previous.getZ()); ! } ! } ! } ! previousEdge = e; } gl.glEnd(); |
From: Michael L. <he...@us...> - 2005-08-16 12:03:44
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25498/src/net/sourceforge/bprocessor/gl/tool Modified Files: DebugTool.java Log Message: Changed back to GLCanvas since GLJPanel is not accelerated.. Index: DebugTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/DebugTool.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DebugTool.java 10 Aug 2005 12:42:46 -0000 1.1 --- DebugTool.java 16 Aug 2005 12:03:26 -0000 1.2 *************** *** 10,17 **** --- 10,20 ---- import java.awt.event.MouseEvent; import java.util.Iterator; + import java.util.LinkedList; import java.util.Set; import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Surface; + import net.sourceforge.bprocessor.model.Vertex; /** *************** *** 20,23 **** --- 23,35 ---- public class DebugTool extends SelectTool { + /** The height */ + private int height = 0; + + /** The current number of surfaces */ + private int number = 0; + + /** The current factor */ + private int factor = 0; + /** * Constructor *************** *** 29,37 **** /** ! * Invoked when a mouse button has been pressed on a component. ! * @param e The MouseEvent object */ ! protected void pressed(MouseEvent e) { ! super.pressed(e); if (SelectTool.selectedVertex != null) { Set a = SelectTool.selectedVertex.getEdges(); --- 41,47 ---- /** ! * Test object identity in model */ ! void testObjectIdentity() { if (SelectTool.selectedVertex != null) { Set a = SelectTool.selectedVertex.getEdges(); *************** *** 52,54 **** --- 62,114 ---- } } + /** + * Create n surfaces to test performance. + * @param n The number of surfaces to create + */ + void createSurfaces(int n) { + double coords[] = new double[3]; + coords[0] = -1; + coords[1] = height; + coords[2] = -1; + Vertex a = createVertex(coords); + coords[0] = 1; + coords[1] = height; + coords[2] = -1; + Vertex b = createVertex(coords); + coords[0] = 1; + coords[1] = height; + coords[2] = 1; + Vertex c = createVertex(coords); + coords[0] = -1; + coords[1] = height; + coords[2] = 1; + height++; + Vertex d = createVertex(coords); + Edge e1 = createEdge(a, b); + Edge e2 = createEdge(b, c); + Edge e3 = createEdge(c, d); + Edge e4 = createEdge(d, a); + LinkedList edges = new LinkedList(); + edges.add(e1); + edges.add(e2); + edges.add(e3); + edges.add(e4); + Surface s = createSurface(edges); + } + /** + * Invoked when a mouse button has been pressed on a component. + * @param e The MouseEvent object + */ + protected void pressed(MouseEvent e) { + super.pressed(e); + int n = 0; + for (int i = 0; i < factor; i++) { + n = n + 100; + } + factor++; + for (int i = 0; i < (n - number); i++) { + createSurfaces(1); + number++; + } + } } |
From: Michael L. <he...@us...> - 2005-08-16 12:03:44
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25498/src/net/sourceforge/bprocessor/gl/view Modified Files: AbstractView.java View3D.java Log Message: Changed back to GLCanvas since GLJPanel is not accelerated.. Index: AbstractView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/AbstractView.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AbstractView.java 15 Aug 2005 12:55:52 -0000 1.4 --- AbstractView.java 16 Aug 2005 12:03:26 -0000 1.5 *************** *** 110,113 **** --- 110,116 ---- protected GLView glv = null; + /** The frames per second counter */ + protected int fps = 0; + /** * The constructor *************** *** 145,148 **** --- 148,152 ---- */ public void display(GLDrawable gld) { + long before = System.currentTimeMillis(); gl = gld.getGL(); glu = gld.getGLU(); *************** *** 159,162 **** --- 163,172 ---- gl.glLineWidth(1.0f); drawAll(gld); + long after = System.currentTimeMillis(); + long ellapsed = after - before; + //StringBuffer buffer = new StringBuffer(); + //buffer.append("ellapsed: "); + //buffer.append(ellapsed); + //log.info(buffer); } *************** *** 194,197 **** --- 204,208 ---- */ protected void drawAll(GLDrawable gld) { + Set edges = EdgeFacade.getInstance().findAll(); gl = gld.getGL(); *************** *** 309,313 **** gl.glPushName(name); if (to != null && from != null) { ! gl.glBegin(GL.GL_LINES); gl.glVertex3d(to.getX(), to.getY(), to.getZ()); gl.glVertex3d(from.getX(), from.getY(), from.getZ()); --- 320,324 ---- gl.glPushName(name); if (to != null && from != null) { ! gl.glBegin(GL.GL_LINE_STRIP); gl.glVertex3d(to.getX(), to.getY(), to.getZ()); gl.glVertex3d(from.getX(), from.getY(), from.getZ()); *************** *** 318,321 **** --- 329,366 ---- /** + * Draw all edges + * @param gld The GLDrawable + */ + private void drawEdges(GLDrawable gld) { + Set edges = EdgeFacade.getInstance().findAll(); + GL gl = gld.getGL(); + GLU glu = gld.getGLU(); + + Iterator it = edges.iterator(); + gl.glColor3dv(STD_LINE_COLOR); + while (it.hasNext()) { + Edge e = (Edge)it.next(); + drawEdge(e); + } + } + /** + * Draw all surfaces + * @param gld The GLDrawable + */ + private void drawSurfaces(GLDrawable gld) { + Set surfaces = SurfaceFacade.getInstance().findAll(); + GL gl = gld.getGL(); + GLU glu = gld.getGLU(); + + Iterator it = surfaces.iterator(); + gl.glColor3dv(STD_LINE_COLOR); + while (it.hasNext()) { + Surface s = (Surface)it.next(); + gl.glPushName(s.getId().intValue()); + drawSurface(s); + gl.glPopName(); + } + } + /** * Change the rotation about the x axis. Only usable in 3D * @param change The change in R+ (is divided with the window height) Index: View3D.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View3D.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** View3D.java 15 Aug 2005 13:00:46 -0000 1.3 --- View3D.java 16 Aug 2005 12:03:26 -0000 1.4 *************** *** 77,81 **** //Set the PickMatrix if we are trying to pick something if (picking > 0) { ! glu.gluPickMatrix(x, viewport[3] - y, 2, 2, viewport); } double aspect = width / height; --- 77,82 ---- //Set the PickMatrix if we are trying to pick something if (picking > 0) { ! glu.gluPickMatrix(x, viewport[3] - y, 7, 7, viewport); ! picking--; } double aspect = width / height; *************** *** 229,243 **** int[] mode = new int[1]; int[] viewport = new int[] {0, 0, (int)width, (int)height}; ! gl.glSelectBuffer(1024, selectBuffer); gl.glRenderMode(GL.GL_SELECT); //drawing scene in selection mode ! picking = 1; //indicating that I am trying to pick(used in camera) ! gl.glMatrixMode(GL.GL_MODELVIEW); ! gl.glPushMatrix(); ! gl.glLoadIdentity(); gl.glClear(GL.GL_COLOR_BUFFER_BIT); ! gl.glViewport(0, 0, (int)width, (int)height); camera(drawable); grid(); --- 230,241 ---- int[] mode = new int[1]; int[] viewport = new int[] {0, 0, (int)width, (int)height}; ! gl.glViewport(0, 0, (int)width, (int)height); gl.glSelectBuffer(1024, selectBuffer); gl.glRenderMode(GL.GL_SELECT); //drawing scene in selection mode ! picking = 60; //indicating that I am trying to pick(used in camera) gl.glClear(GL.GL_COLOR_BUFFER_BIT); ! camera(drawable); grid(); *************** *** 246,251 **** gl.glLineWidth(1.0f); drawAll(drawable); ! gl.glPopMatrix(); ! picking = 0; //end drawing scene --- 244,249 ---- gl.glLineWidth(1.0f); drawAll(drawable); ! ! //picking = 0; //end drawing scene *************** *** 257,261 **** hits = gl.glRenderMode(GL.GL_RENDER); ! //log.info("x,y = " + x + "," + y + " hits = " + hits + ";SB = " + selectBuffer.get(0)); //Processing hits --- 255,259 ---- hits = gl.glRenderMode(GL.GL_RENDER); ! log.info("x,y = " + x + "," + y + " hits = " + hits + ";SB = " + selectBuffer.get(0)); //Processing hits |
From: Jesper P. <je...@us...> - 2005-08-16 11:45:41
|
Update of /cvsroot/bprocessor/build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22256 Modified Files: build.xml Log Message: Copy OSCache to library Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/build/build.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** build.xml 8 Aug 2005 09:51:24 -0000 1.4 --- build.xml 16 Aug 2005 11:45:29 -0000 1.5 *************** *** 97,100 **** --- 97,103 ---- <fileset dir="${tools.dir}/jogl"/> </copy> + <copy todir="${release.dir}/library"> + <fileset dir="${tools.dir}/oscache"/> + </copy> <copy todir="${release.dir}/plugin"> <fileset dir="${gl.dir}/dist"> |
From: Jesper P. <je...@us...> - 2005-08-16 11:45:14
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22168 Modified Files: Attribute.java Domain.java Edge.java Surface.java Vertex.java Log Message: Set cache to read-write Index: Attribute.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Attribute.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Attribute.java 28 Jul 2005 06:48:54 -0000 1.2 --- Attribute.java 16 Aug 2005 11:45:03 -0000 1.3 *************** *** 17,20 **** --- 17,22 ---- * table="ATTRIBUTE" * lazy="false" + * @hibernate.cache + * usage="read-write" */ public class Attribute implements Serializable { Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Surface.java 15 Aug 2005 12:29:43 -0000 1.9 --- Surface.java 16 Aug 2005 11:45:03 -0000 1.10 *************** *** 18,21 **** --- 18,23 ---- * table="SURFACE" * lazy="false" + * @hibernate.cache + * usage="read-write" */ public class Surface implements Serializable { Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Edge.java 5 Aug 2005 10:43:08 -0000 1.4 --- Edge.java 16 Aug 2005 11:45:03 -0000 1.5 *************** *** 16,19 **** --- 16,21 ---- * table="EDGE" * lazy="false" + * @hibernate.cache + * usage="read-write" */ public class Edge implements Serializable { Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Vertex.java 5 Aug 2005 10:40:58 -0000 1.4 --- Vertex.java 16 Aug 2005 11:45:03 -0000 1.5 *************** *** 17,20 **** --- 17,22 ---- * table="VERTEX" * lazy="false" + * @hibernate.cache + * usage="read-write" */ public class Vertex implements Serializable { Index: Domain.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Domain.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Domain.java 4 Aug 2005 11:11:48 -0000 1.3 --- Domain.java 16 Aug 2005 11:45:03 -0000 1.4 *************** *** 17,20 **** --- 17,22 ---- * table="DOMAIN" * lazy="false" + * @hibernate.cache + * usage="read-write" */ public abstract class Domain implements Serializable { |