[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view View.java, 1.245, 1.246 Display.java,
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-10-11 13:12:10
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31977/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java Log Message: implemented drawing modes in new display Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Display.java 10 Oct 2007 14:15:56 -0000 1.27 --- Display.java 11 Oct 2007 13:12:12 -0000 1.28 *************** *** 46,50 **** private static final boolean TRUE = true; - private static boolean initialized; private static boolean selecting; --- 46,49 ---- *************** *** 59,62 **** --- 58,62 ---- private static boolean intersecting; private static boolean construction; + private static int mode; private static Project project; *************** *** 225,228 **** --- 225,244 ---- /** + * Returns the mode + * @return the mode + */ + public static int mode() { + return mode; + } + + /** + * Changes the value of mode + * @param value new value of mode + */ + public static void mode(int value) { + mode = value; + } + + /** * Sets the objects table * @param value ArrayList *************** *** 357,360 **** --- 373,388 ---- } + private static void paintSurfaces(Collection<Surface> surfaces, float[] color) { + gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); + gl.glPolygonOffset(1.0f, 1.0f); + apply(color); + for (Surface current : surfaces) { + if (!transparent(current)) { + draw(current, false); + } + } + gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); + } + private static void paintSurfaces(Collection<Surface> surfaces) { *************** *** 683,687 **** if (selecting()) { if (inside) { ! selectSurfaces(surfaces); } if (inside || (intersecting() && !(active instanceof Net))) { --- 711,717 ---- if (selecting()) { if (inside) { ! if (mode != View.WIREFRAME_MODE) { ! selectSurfaces(surfaces); ! } } if (inside || (intersecting() && !(active instanceof Net))) { *************** *** 693,697 **** } else { if (inside) { ! paintSurfaces(surfaces); } if (active == space) { --- 723,733 ---- } else { if (inside) { ! if (mode == View.SOLID_MODE) { ! paintSurfaces(surfaces, alice); ! } else if (mode == View.LIGHTING_MODE || mode == View.SPACE_ASSGN_MODE) { ! paintSurfaces(surfaces); ! } else if (mode == View.WIREFRAME_MODE) { ! // do not paint surfaces ! } } if (active == space) { *************** *** 720,727 **** color = grey; } - gl.glDepthMask(false); paintEdges(normal, color, size); paintStippled(stippled, middleblue, size); - gl.glDepthMask(true); } --- 756,761 ---- Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.245 retrieving revision 1.246 diff -C2 -d -r1.245 -r1.246 *** View.java 10 Oct 2007 09:27:53 -0000 1.245 --- View.java 11 Oct 2007 13:12:12 -0000 1.246 *************** *** 212,215 **** --- 212,223 ---- protected static Surface lastSurface; + + + /** Flag for the lighted style of view (this is the default) */ + public static final int LIGHTING_MODE = 0; + /** Flag for the solid style of view (no lighting) */ + public static final int SOLID_MODE = 1; + /** Flag for the wireframe style of view */ + public static final int WIREFRAME_MODE = 2; /** Flag for the "space assignmened only" style of view. * This style of view will only show those surfaces that *************** *** 217,228 **** public static final int SPACE_ASSGN_MODE = 3; - /** Flag for the wireframe style of view */ - public static final int WIREFRAME_MODE = 2; - - /** Flag for the solid style of view (no lighting) */ - public static final int SOLID_MODE = 1; - /** Flag for the lighted style of view (this is the default) */ - public static final int LIGHTING_MODE = 0; - /** */ public static final int VIEW_XY = 3; --- 225,228 ---- *************** *** 697,700 **** --- 697,701 ---- Display.selecting(hitdetection); Display.construction(gridEnabled); + Display.mode(drawMode); initNames(gl); Display.objects(objectTable); |