Thread: [Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view View.java, 1.166, 1.167 Transformatio
Status: Pre-Alpha
Brought to you by:
henryml
|
From: rimestad <rim...@us...> - 2006-12-18 14:48:16
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2048/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Transformation.java Log Message: Changed implementation to JOGL 1.0.0 with lots of new binary files in tools/jogl still need to add support for Sparc!!!!! Made changes to GLView and GLObject and View to support the new jogl and fixed rotation tool to work better (fix was to use isNaN on a double object not double != Double.NaN) Index: Transformation.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Transformation.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Transformation.java 19 Dec 2005 07:51:30 -0000 1.6 --- Transformation.java 18 Dec 2006 14:48:04 -0000 1.7 *************** *** 12,17 **** import java.util.List; - import net.java.games.jogl.GLU; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Surface; --- 12,18 ---- import java.util.List; + import javax.media.opengl.glu.GLU; + import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Surface; *************** *** 110,114 **** double z = vertex.getZ(); double[] view = new double[3]; ! boolean success = glu.gluProject(x, y, z, modelview, projection, viewport, view); if (!success) { log.error("error projecting"); --- 111,116 ---- double z = vertex.getZ(); double[] view = new double[3]; ! boolean success = ! glu.gluProject(x, y, z, modelview, 0, projection, 0, viewport, 0, view, 0); if (!success) { log.error("error projecting"); *************** *** 163,167 **** double z = vertex.getZ(); double[] view = new double[3]; ! boolean success = glu.gluUnProject(x, y, z, modelview, projection, viewport, view); if (!success) { log.error("error un-projecting"); --- 165,170 ---- double z = vertex.getZ(); double[] view = new double[3]; ! boolean success = ! glu.gluUnProject(x, y, z, modelview, 0, projection, 0, viewport, 0, view, 0); if (!success) { log.error("error un-projecting"); Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.166 retrieving revision 1.167 diff -C2 -d -r1.166 -r1.167 *** View.java 13 Dec 2006 17:42:10 -0000 1.166 --- View.java 18 Dec 2006 14:48:04 -0000 1.167 *************** *** 52,55 **** --- 52,64 ---- import java.nio.IntBuffer; + import javax.media.opengl.DebugGL; + import javax.media.opengl.GL; + import javax.media.opengl.GLAutoDrawable; + import javax.media.opengl.GLEventListener; + import javax.media.opengl.glu.GLU; + import javax.media.opengl.glu.GLUquadric; + import javax.media.opengl.glu.GLUtessellator; + import javax.media.opengl.glu.GLUtessellatorCallback; + import javax.media.opengl.glu.GLUtessellatorCallbackAdapter; import javax.swing.AbstractAction; import javax.swing.Action; *************** *** 58,73 **** import javax.swing.ButtonGroup; - import net.java.games.jogl.GL; - import net.java.games.jogl.GLDrawable; - import net.java.games.jogl.GLU; - import net.java.games.jogl.GLUquadric; - import net.java.games.jogl.util.BufferUtils; - import net.java.games.jogl.util.GLUT; - import net.java.games.jogl.GLUtesselatorCallbackAdapter; - import net.java.games.jogl.GLUtesselatorCallback; - import net.java.games.jogl.GLUtesselator; - import net.java.games.jogl.GLEventListener; - import org.apache.log4j.Logger; /** * The 3D view listener --- 67,74 ---- import javax.swing.ButtonGroup; import org.apache.log4j.Logger; + + import com.sun.opengl.util.BufferUtil; + import com.sun.opengl.util.GLUT; /** * The 3D view listener *************** *** 502,518 **** * @param gld The GLDrawable object */ ! public void init(GLDrawable gld) { if (log.isDebugEnabled()) { log.debug("[init]"); } gl = gld.getGL(); ! glu = gld.getGLU(); int[] maxplanes = new int[1]; ! gl.glGetIntegerv(GL.GL_MAX_CLIP_PLANES, maxplanes); maxClippingPlanes = maxplanes[0]; ! View.width = gld.getSize().getWidth(); ! View.height = gld.getSize().getHeight(); View.aspect = View.width / View.height; --- 503,521 ---- * @param gld The GLDrawable object */ ! public void init(GLAutoDrawable gld) { if (log.isDebugEnabled()) { log.debug("[init]"); } gl = gld.getGL(); ! //ENABLE FOR DEBUG ! gld.setGL(new DebugGL(gld.getGL())); ! glu = new GLU(); int[] maxplanes = new int[1]; ! gl.glGetIntegerv(GL.GL_MAX_CLIP_PLANES, maxplanes, 0); maxClippingPlanes = maxplanes[0]; ! View.width = gld.getWidth(); ! View.height = gld.getHeight(); View.aspect = View.width / View.height; *************** *** 526,532 **** gl.glLightModeli(GL.GL_LIGHT_MODEL_TWO_SIDE, 1); gl.glLightModeli(GL.GL_LIGHT_MODEL_LOCAL_VIEWER, 1); ! gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, new float[] {0.3f, 0.3f, 0.3f, 1.0f}); ! gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, new float[] {0.7f, 0.7f, 0.7f, 1.0f}); ! gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, new float[] {0.0f, 0.0f, 0.0f, 1.0f}); gl.glEnable(GL.GL_LINE_SMOOTH); --- 529,535 ---- gl.glLightModeli(GL.GL_LIGHT_MODEL_TWO_SIDE, 1); gl.glLightModeli(GL.GL_LIGHT_MODEL_LOCAL_VIEWER, 1); ! gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, new float[] {0.3f, 0.3f, 0.3f, 1.0f}, 0); ! gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, new float[] {0.7f, 0.7f, 0.7f, 1.0f}, 0); ! gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, new float[] {0.0f, 0.0f, 0.0f, 1.0f}, 0); gl.glEnable(GL.GL_LINE_SMOOTH); *************** *** 560,564 **** * @param gld The GLDrawable object */ ! public void display(GLDrawable gld) { boolean hitdetection = false; --- 563,567 ---- * @param gld The GLDrawable object */ ! public void display(GLAutoDrawable gld) { boolean hitdetection = false; *************** *** 567,574 **** gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); ! glu = gld.getGLU(); gl.glViewport(0, 0, (int)width, (int)height); if (picking > 0) { ! selectBuffer = BufferUtils.newIntBuffer(selectionLength); gl.glSelectBuffer(selectionLength, selectBuffer); gl.glRenderMode(GL.GL_SELECT); --- 570,577 ---- gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); ! glu = new GLU(); gl.glViewport(0, 0, (int)width, (int)height); if (picking > 0) { ! selectBuffer = BufferUtil.newIntBuffer(selectionLength); gl.glSelectBuffer(selectionLength, selectBuffer); gl.glRenderMode(GL.GL_SELECT); *************** *** 582,586 **** enableClipplanes(); ! gl.glColor3fv(lineColor); gl.glLineWidth(1.0f); --- 585,589 ---- enableClipplanes(); ! gl.glColor3fv(lineColor, 0); gl.glLineWidth(1.0f); *************** *** 600,606 **** } else { if (selection.contains(cp)) { ! gl.glColor3fv(SELECTED_COLOR); } else { ! gl.glColor3fv(CLIP_PLANE_COLOR); } drawClipplane(cp); --- 603,609 ---- } else { if (selection.contains(cp)) { ! gl.glColor3fv(SELECTED_COLOR, 0); } else { ! gl.glColor3fv(CLIP_PLANE_COLOR, 0); } drawClipplane(cp); *************** *** 614,618 **** if (hitdetection) { int[] viewport = new int[] {0, 0, (int)width, (int)height}; ! glu.gluPickMatrix(x, viewport[3] - y, 5, 5, viewport); } glu.gluOrtho2D(0, width, 0, height); --- 617,621 ---- if (hitdetection) { int[] viewport = new int[] {0, 0, (int)width, (int)height}; ! glu.gluPickMatrix(x, viewport[3] - y, 5, 5, viewport, 0); } glu.gluOrtho2D(0, width, 0, height); *************** *** 634,638 **** if (hitdetection) { int[] viewport = new int[] {0, 0, (int)width, (int)height}; ! glu.gluPickMatrix(x, viewport[3] - y, 5, 5, viewport); } glu.gluOrtho2D(0, width, 0, height); --- 637,641 ---- if (hitdetection) { int[] viewport = new int[] {0, 0, (int)width, (int)height}; ! glu.gluPickMatrix(x, viewport[3] - y, 5, 5, viewport, 0); } glu.gluOrtho2D(0, width, 0, height); *************** *** 689,696 **** ClippingPlane cp = (ClippingPlane)clipit.next(); if (cp.isActive()) { ! gl.glClipPlane(GL.GL_CLIP_PLANE0 + cp.getNumber(), cp.getPlane().getDoublev()); gl.glEnable(GL.GL_CLIP_PLANE0 + cp.getNumber()); if (cp.isSlice()) { ! gl.glClipPlane(GL.GL_CLIP_PLANE5, cp.getPlane().negate().getDoublev()); gl.glEnable(GL.GL_CLIP_PLANE5); cp.getPlane().negate(); --- 692,699 ---- ClippingPlane cp = (ClippingPlane)clipit.next(); if (cp.isActive()) { ! gl.glClipPlane(GL.GL_CLIP_PLANE0 + cp.getNumber(), cp.getPlane().getDoublev(), 0); gl.glEnable(GL.GL_CLIP_PLANE0 + cp.getNumber()); if (cp.isSlice()) { ! gl.glClipPlane(GL.GL_CLIP_PLANE5, cp.getPlane().negate().getDoublev(), 0); gl.glEnable(GL.GL_CLIP_PLANE5); cp.getPlane().negate(); *************** *** 704,713 **** * @param gld The GLDrawable object */ ! public void initCamera(GLDrawable gld) { if (log.isDebugEnabled()) { log.debug("[display]"); } gl = gld.getGL(); ! glu = gld.getGLU(); gl.glMatrixMode(GL.GL_PROJECTION); --- 707,716 ---- * @param gld The GLDrawable object */ ! public void initCamera(GLAutoDrawable gld) { if (log.isDebugEnabled()) { log.debug("[display]"); } gl = gld.getGL(); ! glu = new GLU(); gl.glMatrixMode(GL.GL_PROJECTION); *************** *** 716,720 **** if (picking > 0) { int[] viewport = new int[] {0, 0, (int)width, (int)height}; ! glu.gluPickMatrix(x, viewport[3] - y, selectionSize[0], selectionSize[1], viewport); } --- 719,723 ---- if (picking > 0) { int[] viewport = new int[] {0, 0, (int)width, (int)height}; ! glu.gluPickMatrix(x, viewport[3] - y, selectionSize[0], selectionSize[1], viewport, 0); } *************** *** 751,757 **** if (picking == 0) { ! gl.glGetIntegerv(GL.GL_VIEWPORT, screenport); ! gl.glGetDoublev(GL.GL_PROJECTION_MATRIX, projMatrix); ! gl.glGetDoublev(GL.GL_MODELVIEW_MATRIX, modelMatrix); } } --- 754,760 ---- if (picking == 0) { ! gl.glGetIntegerv(GL.GL_VIEWPORT, screenport, 0); ! gl.glGetDoublev(GL.GL_PROJECTION_MATRIX, projMatrix, 0); ! gl.glGetDoublev(GL.GL_MODELVIEW_MATRIX, modelMatrix, 0); } } *************** *** 764,768 **** double size = View.gridSize(); gl.glLineWidth(0.5f); ! gl.glColor4fv(gridColor); //gl.glDisable(GL.GL_DEPTH_TEST); gl.glBegin(GL.GL_LINES); --- 767,771 ---- double size = View.gridSize(); gl.glLineWidth(0.5f); ! gl.glColor4fv(gridColor, 0); //gl.glDisable(GL.GL_DEPTH_TEST); gl.glBegin(GL.GL_LINES); *************** *** 795,802 **** gl.glBegin(GL.GL_LINES); gl.glDisable(GL.GL_DEPTH_TEST); ! gl.glColor3fv(X_AXIS_COLOR); gl.glVertex3d(0.0, 0.0, 0.0); gl.glVertex3d(size * 2, 0.0, 0.0); ! gl.glColor3fv(Y_AXIS_COLOR); gl.glVertex3d(0.0, 0.0, 0.0); gl.glVertex3d(0.0, size * 2, 0.0); --- 798,805 ---- gl.glBegin(GL.GL_LINES); gl.glDisable(GL.GL_DEPTH_TEST); ! gl.glColor3fv(X_AXIS_COLOR, 0); gl.glVertex3d(0.0, 0.0, 0.0); gl.glVertex3d(size * 2, 0.0, 0.0); ! gl.glColor3fv(Y_AXIS_COLOR, 0); gl.glVertex3d(0.0, 0.0, 0.0); gl.glVertex3d(0.0, size * 2, 0.0); *************** *** 804,808 **** gl.glEnable(GL.GL_DEPTH_TEST); gl.glBegin(GL.GL_LINES); ! gl.glColor3fv(Z_AXIS_COLOR); gl.glVertex3d(0.0, 0.0, 0.0); gl.glVertex3d(0.0, 0.0, size * 2); --- 807,811 ---- gl.glEnable(GL.GL_DEPTH_TEST); gl.glBegin(GL.GL_LINES); ! gl.glColor3fv(Z_AXIS_COLOR, 0); gl.glVertex3d(0.0, 0.0, 0.0); gl.glVertex3d(0.0, 0.0, size * 2); *************** *** 816,820 **** * @param hitdetection For hitdetection */ ! protected void drawAll(GLDrawable gld, boolean hitdetection) { if (!hitdetection) { drawNormalMode(gld); --- 819,823 ---- * @param hitdetection For hitdetection */ ! protected void drawAll(GLAutoDrawable gld, boolean hitdetection) { if (!hitdetection) { drawNormalMode(gld); *************** *** 886,894 **** * @param gld The GLDrawable */ ! private void drawNormalMode(GLDrawable gld) { Collection selection = Selection.primary(); gl.glEnable(GL.GL_DEPTH_TEST); // draw selection ! gl.glColor3fv(SELECTED_COLOR); invisibles = new HashSet(); highligts = new HashSet(); --- 889,897 ---- * @param gld The GLDrawable */ ! private void drawNormalMode(GLAutoDrawable gld) { Collection selection = Selection.primary(); gl.glEnable(GL.GL_DEPTH_TEST); // draw selection ! gl.glColor3fv(SELECTED_COLOR, 0); invisibles = new HashSet(); highligts = new HashSet(); *************** *** 937,941 **** { ! gl.glColor3fv(SELECTED_COLOR); Iterator highlightIter = highligts.iterator(); while (highlightIter.hasNext()) { --- 940,944 ---- { ! gl.glColor3fv(SELECTED_COLOR, 0); Iterator highlightIter = highligts.iterator(); while (highlightIter.hasNext()) { *************** *** 948,952 **** { ! gl.glColor3fv(constructorColor); Iterator it = tempVertices.iterator(); while (it.hasNext()) { --- 951,955 ---- { ! gl.glColor3fv(constructorColor, 0); Iterator it = tempVertices.iterator(); while (it.hasNext()) { *************** *** 957,961 **** // draw target if (target != null && target instanceof Geometric) { ! gl.glColor3fv(targetColor); gl.glLineWidth(1.5f); // If target is a snap vertex it should be shown regardless of the clip --- 960,964 ---- // draw target if (target != null && target instanceof Geometric) { ! gl.glColor3fv(targetColor, 0); gl.glLineWidth(1.5f); // If target is a snap vertex it should be shown regardless of the clip *************** *** 970,976 **** } } ! ! drawConstructorPlanes(); ! { Iterator it = glObjects3D.iterator(); --- 973,977 ---- } } ! { Iterator it = glObjects3D.iterator(); *************** *** 981,984 **** --- 982,987 ---- } + drawConstructorPlanes(); + gl.glDisable(GL.GL_DEPTH_TEST); { *************** *** 1041,1045 **** gl.glTranslated(5, height - 15, 0.5); gl.glRasterPos2i(0, 0); ! glut.glutBitmapString(gl, GLUT.BITMAP_HELVETICA_12, name); gl.glPopMatrix(); } --- 1044,1048 ---- gl.glTranslated(5, height - 15, 0.5); gl.glRasterPos2i(0, 0); ! glut.glutBitmapString(GLUT.BITMAP_HELVETICA_12, name); gl.glPopMatrix(); } *************** *** 1094,1098 **** * @param space The Space */ ! private void drawSpace(Space space, GLDrawable gld) { gl.glPushMatrix(); transform(space.getTransformations()); --- 1097,1101 ---- * @param space The Space */ ! private void drawSpace(Space space, GLAutoDrawable gld) { gl.glPushMatrix(); transform(space.getTransformations()); *************** *** 1106,1114 **** gl.glCullFace(GL.GL_BACK); ! gl.glColor3fv(Defaults.getFrontColor()); drawSurfaces(gld, surfaces, FRONT); gl.glCullFace(GL.GL_FRONT); ! gl.glColor3fv(Defaults.getBackColor()); drawSurfaces(gld, surfaces, BACK); --- 1109,1117 ---- gl.glCullFace(GL.GL_BACK); ! gl.glColor3fv(Defaults.getFrontColor(), 0); drawSurfaces(gld, surfaces, FRONT); gl.glCullFace(GL.GL_FRONT); ! gl.glColor3fv(Defaults.getBackColor(), 0); drawSurfaces(gld, surfaces, BACK); *************** *** 1125,1129 **** gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); gl.glPolygonOffset(1.0f, 1.0f); ! gl.glColor3fv(SURFACE_COLOR); drawSurfaces(gld, surfaces, BOTH); gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); --- 1128,1132 ---- gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); gl.glPolygonOffset(1.0f, 1.0f); ! gl.glColor3fv(SURFACE_COLOR, 0); drawSurfaces(gld, surfaces, BOTH); gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); *************** *** 1176,1180 **** } else if (o instanceof Surface) { gl.glEnable(GL.GL_POLYGON_STIPPLE); ! gl.glPolygonStipple(highlight); Surface s = (Surface) o; drawSurface(s); --- 1179,1183 ---- } else if (o instanceof Surface) { gl.glEnable(GL.GL_POLYGON_STIPPLE); ! gl.glPolygonStipple(highlight, 0); Surface s = (Surface) o; drawSurface(s); *************** *** 1206,1210 **** * @param gld The GLDrawable */ ! private void drawEdges(GLDrawable gld) { disableClipplanes(); drawGeneralEdges(gld, tempEdges); --- 1209,1213 ---- * @param gld The GLDrawable */ ! private void drawEdges(GLAutoDrawable gld) { disableClipplanes(); drawGeneralEdges(gld, tempEdges); *************** *** 1300,1309 **** if (constructor instanceof Point) { if (colorize) { ! gl.glColor3fv(constructorColor); } drawConstructorPoint(((Point)constructor).getOrigin(), dist); } else if (constructor instanceof Line) { if (colorize) { ! gl.glColor3fv(constructorColor); } Line l = (Line)constructor; --- 1303,1312 ---- if (constructor instanceof Point) { if (colorize) { ! gl.glColor3fv(constructorColor, 0); } drawConstructorPoint(((Point)constructor).getOrigin(), dist); } else if (constructor instanceof Line) { if (colorize) { ! gl.glColor3fv(constructorColor, 0); } Line l = (Line)constructor; *************** *** 1337,1341 **** Vertex c = origin.minus(u).add(v); Vertex d = origin.minus(u).minus(v); ! gl.glColor4fv(CLIP_PLANE_INTERIOR_COLOR); gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); gl.glPolygonOffset(1f, 1f); --- 1340,1344 ---- Vertex c = origin.minus(u).add(v); Vertex d = origin.minus(u).minus(v); ! gl.glColor4fv(CLIP_PLANE_INTERIOR_COLOR, 0); gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); gl.glPolygonOffset(1f, 1f); *************** *** 1364,1368 **** if (cs.onlyPlane()) { if (colorize) { ! gl.glColor3fv(constructorColor); } if (cs.isEditable()) { --- 1367,1371 ---- if (cs.onlyPlane()) { if (colorize) { ! gl.glColor3fv(constructorColor, 0); } if (cs.isEditable()) { *************** *** 1389,1393 **** Vertex c = origin.minus(u).add(v); Vertex d = origin.minus(u).minus(v); ! gl.glColor4fv(CLIP_PLANE_INTERIOR_COLOR); gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); gl.glPolygonOffset(1f, 1f); --- 1392,1396 ---- Vertex c = origin.minus(u).add(v); Vertex d = origin.minus(u).minus(v); ! gl.glColor4fv(CLIP_PLANE_INTERIOR_COLOR, 0); gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); gl.glPolygonOffset(1f, 1f); *************** *** 1402,1406 **** } else { if (colorize) { ! gl.glColor3fv(X_AXIS_COLOR); } if (cs.isEditable()) { --- 1405,1409 ---- } else { if (colorize) { ! gl.glColor3fv(X_AXIS_COLOR, 0); } if (cs.isEditable()) { *************** *** 1411,1415 **** } if (colorize) { ! gl.glColor3fv(Y_AXIS_COLOR); } if (cs.isEditable()) { --- 1414,1418 ---- } if (colorize) { ! gl.glColor3fv(Y_AXIS_COLOR, 0); } if (cs.isEditable()) { *************** *** 1421,1425 **** Vertex n = cs.getN(); if (colorize) { ! gl.glColor3fv(Z_AXIS_COLOR); } if (cs.isEditable()) { --- 1424,1428 ---- Vertex n = cs.getN(); if (colorize) { ! gl.glColor3fv(Z_AXIS_COLOR, 0); } if (cs.isEditable()) { *************** *** 1511,1515 **** gl.glLineWidth(0.5f); gl.glEnable(GL.GL_LINE_STIPPLE); - gl.glBegin(GL.GL_LINE_STRIP); drawConstructorLineGeometry(from, direction, dist); gl.glDisable(GL.GL_LINE_STIPPLE); --- 1514,1517 ---- *************** *** 1527,1531 **** Vertex a = from.minus(dir); Vertex b = from.add(dir); ! gl.glBegin(GL.GL_LINE_STRIP); gl.glVertex3d(a.getX(), a.getY(), a.getZ()); gl.glVertex3d(b.getX(), b.getY(), b.getZ()); --- 1529,1533 ---- Vertex a = from.minus(dir); Vertex b = from.add(dir); ! gl.glBegin(GL.GL_LINES); gl.glVertex3d(a.getX(), a.getY(), a.getZ()); gl.glVertex3d(b.getX(), b.getY(), b.getZ()); *************** *** 1538,1544 **** * @param edges The edges */ ! public void drawGeneralEdges(GLDrawable gld, Collection edges) { gl.glLineWidth(1.0f); ! gl.glColor3fv(lineColor); Iterator iter = edges.iterator(); while (iter.hasNext()) { --- 1540,1546 ---- * @param edges The edges */ ! public void drawGeneralEdges(GLAutoDrawable gld, Collection edges) { gl.glLineWidth(1.0f); ! gl.glColor3fv(lineColor, 0); Iterator iter = edges.iterator(); while (iter.hasNext()) { *************** *** 1547,1551 **** float[] color = (float[])colorMap.get(current); if (color != null) { ! gl.glColor3fv(color); if (current.getStrippled()) { drawConstructor(current); --- 1549,1553 ---- float[] color = (float[])colorMap.get(current); if (color != null) { ! gl.glColor3fv(color, 0); if (current.getStrippled()) { drawConstructor(current); *************** *** 1553,1561 **** drawEdge(current); } ! gl.glColor3fv(lineColor); } else if (current.getStrippled()) { ! gl.glColor3fv(constructorColor); drawConstructor(current); ! gl.glColor3fv(lineColor); } else { drawEdge(current); --- 1555,1563 ---- drawEdge(current); } ! gl.glColor3fv(lineColor, 0); } else if (current.getStrippled()) { ! gl.glColor3fv(constructorColor, 0); drawConstructor(current); ! gl.glColor3fv(lineColor, 0); } else { drawEdge(current); *************** *** 1570,1576 **** * @param edges The edges */ ! public void drawConstructionEdges(GLDrawable gld, Collection edges) { gl.glLineWidth(1.0f); ! gl.glColor3fv(constructorColor); Iterator iter = edges.iterator(); while (iter.hasNext()) { --- 1572,1578 ---- * @param edges The edges */ ! public void drawConstructionEdges(GLAutoDrawable gld, Collection edges) { gl.glLineWidth(1.0f); ! gl.glColor3fv(constructorColor, 0); Iterator iter = edges.iterator(); while (iter.hasNext()) { *************** *** 1586,1590 **** * @param side The side */ ! public void drawSpaceSurfaces(GLDrawable gld, Space space, int side) { drawSurfaces(gld, space.getSurfaces(), side); } --- 1588,1592 ---- * @param side The side */ ! public void drawSpaceSurfaces(GLAutoDrawable gld, Space space, int side) { drawSurfaces(gld, space.getSurfaces(), side); } *************** *** 1605,1609 **** * @param side The side of the Surface to draw */ ! private void drawSurfaces(GLDrawable gld, Collection surfaces, int side) { GL gl = gld.getGL(); Iterator it = surfaces.iterator(); --- 1607,1611 ---- * @param side The side of the Surface to draw */ ! private void drawSurfaces(GLAutoDrawable gld, Collection surfaces, int side) { GL gl = gld.getGL(); Iterator it = surfaces.iterator(); *************** *** 1619,1631 **** if (!visible) { gl.glEnable(GL.GL_POLYGON_STIPPLE); ! gl.glPolygonStipple(seethrough); ! gl.glColor3fv(GRID_COLOR); } else { if (side == FRONT) { if (s.getFrontMaterial() == null) { Space back = s.getFrontDomain(); ! gl.glColor3fv(getSpaceColor(back)); } else { ! gl.glColor3fv(s.getFrontMaterial().getColor()); } } --- 1621,1633 ---- if (!visible) { gl.glEnable(GL.GL_POLYGON_STIPPLE); ! gl.glPolygonStipple(seethrough, 0); ! gl.glColor3fv(GRID_COLOR, 0); } else { if (side == FRONT) { if (s.getFrontMaterial() == null) { Space back = s.getFrontDomain(); ! gl.glColor3fv(getSpaceColor(back), 0); } else { ! gl.glColor3fv(s.getFrontMaterial().getColor(), 0); } } *************** *** 1633,1639 **** if (s.getBackMaterial() == null) { Space front = s.getBackDomain(); ! gl.glColor3fv(getSpaceColor(front)); } else { ! gl.glColor3fv(s.getBackMaterial().getColor()); } } --- 1635,1641 ---- if (s.getBackMaterial() == null) { Space front = s.getBackDomain(); ! gl.glColor3fv(getSpaceColor(front), 0); } else { ! gl.glColor3fv(s.getBackMaterial().getColor(), 0); } } *************** *** 1653,1658 **** */ private void drawSurface(Surface s) { ! GLUtesselator tess = glu.gluNewTess(); ! GLUtesselatorCallback cb = new Callback(); //Setting callbacks --- 1655,1660 ---- */ private void drawSurface(Surface s) { ! GLUtessellator tess = glu.gluNewTess(); ! GLUtessellatorCallback cb = new Callback(); //Setting callbacks *************** *** 1695,1699 **** * @param tess The Tesselator */ ! private void drawContour(Surface surface, GLUtesselator tess) { List vertices = surface.getVertices(); if (vertices.size() > 0) { --- 1697,1701 ---- * @param tess The Tesselator */ ! private void drawContour(Surface surface, GLUtessellator tess) { List vertices = surface.getVertices(); if (vertices.size() > 0) { *************** *** 1704,1711 **** Vertex current = (Vertex) iter.next(); double[] coords = new double[] {current.getX(), current.getY(), current.getZ()}; ! glu.gluTessVertex(tess, coords, new TesselatorPoint(coords[0], coords[1], coords[2])); } double[] coords = new double[] {first.getX(), first.getY(), first.getZ()}; ! glu.gluTessVertex(tess, coords, new TesselatorPoint(coords[0], coords[1], coords[2])); glu.gluTessEndContour(tess); } --- 1706,1713 ---- Vertex current = (Vertex) iter.next(); double[] coords = new double[] {current.getX(), current.getY(), current.getZ()}; ! glu.gluTessVertex(tess, coords, 0, new TesselatorPoint(coords[0], coords[1], coords[2])); } double[] coords = new double[] {first.getX(), first.getY(), first.getZ()}; ! glu.gluTessVertex(tess, coords, 0, new TesselatorPoint(coords[0], coords[1], coords[2])); glu.gluTessEndContour(tess); } *************** *** 1724,1728 **** gl.glPushMatrix(); gl.glRasterPos3d(x, y, z); ! glut.glutBitmapString(gl, GLUT.BITMAP_HELVETICA_12, string); gl.glPopMatrix(); } --- 1726,1730 ---- gl.glPushMatrix(); gl.glRasterPos3d(x, y, z); ! glut.glutBitmapString(GLUT.BITMAP_HELVETICA_12, string); gl.glPopMatrix(); } *************** *** 1758,1762 **** * @param height The new window height */ ! public void reshape(GLDrawable gld, int x, int y, int width, int height) { --- 1760,1764 ---- * @param height The new window height */ ! public void reshape(GLAutoDrawable gld, int x, int y, int width, int height) { *************** *** 1773,1777 **** * @param deviceChanged The new graphical device */ ! public void displayChanged(GLDrawable gld, boolean modeChanged, boolean deviceChanged) { --- 1775,1779 ---- * @param deviceChanged The new graphical device */ ! public void displayChanged(GLAutoDrawable gld, boolean modeChanged, boolean deviceChanged) { *************** *** 1959,1963 **** * @param gld The GLDrawable */ ! private void drawSelectionMode(GLDrawable gld) { Space space = Project.getInstance().getActiveSpace(); --- 1961,1965 ---- * @param gld The GLDrawable */ ! private void drawSelectionMode(GLAutoDrawable gld) { Space space = Project.getInstance().getActiveSpace(); *************** *** 2844,2848 **** * Inner class that defines the callbacks for tessellation */ ! private class Callback extends GLUtesselatorCallbackAdapter { /** --- 2846,2850 ---- * Inner class that defines the callbacks for tessellation */ ! private class Callback extends GLUtessellatorCallbackAdapter... [truncated message content] |