[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view View.java, 1.164, 1.165
Status: Pre-Alpha
Brought to you by:
henryml
|
From: rimestad <rim...@us...> - 2006-11-28 16:43:32
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25071/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: made changes to make labels both visible and clickable both in orthographic and perspective views, fix is to change the z value from 0 to 1, seems to work in both view formats Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.164 retrieving revision 1.165 diff -C2 -d -r1.164 -r1.165 *** View.java 28 Nov 2006 15:40:02 -0000 1.164 --- View.java 28 Nov 2006 16:43:26 -0000 1.165 *************** *** 1705,1715 **** * @param x The x position * @param y The y position * @param string The string to draw */ ! void drawString(double x, double y, String string) { gl.glPushMatrix(); ! gl.glTranslated(x, y, 0.1); ! ! gl.glRasterPos2i(0, 0); glut.glutBitmapString(gl, GLUT.BITMAP_HELVETICA_12, string); gl.glPopMatrix(); --- 1705,1714 ---- * @param x The x position * @param y The y position + * @param z The z position * @param string The string to draw */ ! void drawString(double x, double y, double z, String string) { gl.glPushMatrix(); ! gl.glRasterPos3d(x, y, z); glut.glutBitmapString(gl, GLUT.BITMAP_HELVETICA_12, string); gl.glPopMatrix(); *************** *** 1720,1731 **** * @param x The x position * @param y The y position * @param string The String */ ! void drawTextBox(double x, double y, String string) { int width = glut.glutBitmapLength(GLUT.BITMAP_HELVETICA_12, string); gl.glColor3d(0.85, 0.85, 0.85); gl.glRectd(x - 4, y - 8, x + width + 4, y + 18); gl.glColor3d(0, 0, 0); ! drawString(x, y, string); } --- 1719,1731 ---- * @param x The x position * @param y The y position + * @param z The z position * @param string The String */ ! void drawTextBox(double x, double y, double z, String string) { int width = glut.glutBitmapLength(GLUT.BITMAP_HELVETICA_12, string); gl.glColor3d(0.85, 0.85, 0.85); gl.glRectd(x - 4, y - 8, x + width + 4, y + 18); gl.glColor3d(0, 0, 0); ! drawString(x, y, z, string); } *************** *** 1793,1796 **** --- 1793,1798 ---- Vertex from = surface.center(); Vertex front = transformation.project(from); + //fix for making label selection work in ortho mode + front.setZ(1); Space frontDomain = surface.getFrontDomain(); Space backDomain = surface.getBackDomain(); *************** *** 1854,1858 **** gl.glColor3d(0.8 + fcb, 0.2 + fcb, 0.4 + fcb); } ! drawString(frontTextAnchor.getX(), frontTextAnchor.getY(), frontName); double bcb = 0; if (backLabelSelect) { --- 1856,1861 ---- gl.glColor3d(0.8 + fcb, 0.2 + fcb, 0.4 + fcb); } ! drawString(frontTextAnchor.getX(), frontTextAnchor.getY(), ! frontTextAnchor.getZ(), frontName); double bcb = 0; if (backLabelSelect) { *************** *** 1869,1873 **** } ! drawString(backTextAnchor.getX(), backTextAnchor.getY(), backName); drawSeperator(front, Math.max(frontWidth, backWidth)); --- 1872,1877 ---- } ! drawString(backTextAnchor.getX(), backTextAnchor.getY(), ! backTextAnchor.getZ(), backName); drawSeperator(front, Math.max(frontWidth, backWidth)); |