[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view View.java, 1.272, 1.273 Display.java,
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Michael L. <he...@us...> - 2007-12-28 11:17:02
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8347/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java Log Message: adjusted move tool Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** Display.java 20 Dec 2007 11:44:57 -0000 1.74 --- Display.java 28 Dec 2007 11:17:05 -0000 1.75 *************** *** 369,372 **** --- 369,407 ---- /** + * disable all clipping planes + */ + private static void disableClipplanes() { + Collection<ClippingPlane> clips = Project.getInstance().getCurrentCamera().getClipplanes(); + for (ClippingPlane current : clips) { + if (current.isActive()) { + gl.glDisable(GL.GL_CLIP_PLANE0 + current.getNumber()); + if (current.isSlice()) { + gl.glDisable(GL.GL_CLIP_PLANE5); + } + } + } + } + + /** + * Turn all clipplanes on + */ + private static void enableClipplanes() { + Collection<ClippingPlane> clips = Project.getInstance().getCurrentCamera().getClipplanes(); + for (ClippingPlane current : clips) { + if (current.isActive()) { + gl.glClipPlane(GL.GL_CLIP_PLANE0 + current.getNumber(), current.getPlane().getDoublev(), 0); + gl.glEnable(GL.GL_CLIP_PLANE0 + current.getNumber()); + if (current.isSlice()) { + gl.glClipPlane(GL.GL_CLIP_PLANE5, current.getPlane().negate().getDoublev(), 0); + gl.glEnable(GL.GL_CLIP_PLANE5); + current.getPlane().negate(); + } + } + } + } + + + + /** * Drawing methods. */ *************** *** 1069,1073 **** --- 1104,1110 ---- } if (space == active && construction()) { + disableClipplanes(); selectConstructors(constructors); + enableClipplanes(); } } else { *************** *** 1085,1093 **** if (space == active) { if (construction()) { gl.glDepthMask(false); draw(grid); gl.glDepthMask(true); paintConstructors(constructors); ! } } --- 1122,1131 ---- if (space == active) { if (construction()) { + disableClipplanes(); gl.glDepthMask(false); draw(grid); gl.glDepthMask(true); paintConstructors(constructors); ! enableClipplanes(); } } *************** *** 1188,1192 **** private static void hilite(Collection<Geometric> geometrics) { gl.glEnable(GL.GL_DEPTH_TEST); ! gl.glColor3fv(redish, 0); gl.glLineWidth(3.0f); gl.glEnable(GL.GL_POLYGON_STIPPLE); --- 1226,1230 ---- private static void hilite(Collection<Geometric> geometrics) { gl.glEnable(GL.GL_DEPTH_TEST); ! gl.glColor3fv(View.SELECTED_COLOR, 0); gl.glLineWidth(3.0f); gl.glEnable(GL.GL_POLYGON_STIPPLE); *************** *** 1209,1213 **** Space space = (Space) current; Collection<Edge> edges = space.hiliteEdges(); ! paintEdges(edges, redish, 2.0f); } } --- 1247,1251 ---- Space space = (Space) current; Collection<Edge> edges = space.hiliteEdges(); ! paintEdges(edges, View.SELECTED_COLOR, 2.0f); } } *************** *** 1232,1236 **** } if (current.getOwner() != null) { ! paint((Vertex) current, redish, size); } else { if (targetColor != null) { --- 1270,1274 ---- } if (current.getOwner() != null) { ! paint((Vertex) current, View.SELECTED_COLOR, size); } else { if (targetColor != null) { *************** *** 1328,1332 **** Collection<Constructor> constructors = new LinkedList(); Collection<Vertex> vertices = new LinkedList(); - Collection<ClippingPlane> clips = Project.getInstance().getCurrentCamera().getClipplanes(); for (Geometric current : extras) { if (current instanceof Edge) { --- 1366,1369 ---- *************** *** 1350,1353 **** --- 1387,1392 ---- paintStippled(stippled, middleblue, 1.0f); } + + disableClipplanes(); if (selecting()) { selectConstructors(constructors); *************** *** 1355,1358 **** --- 1394,1398 ---- paintConstructors(constructors); } + enableClipplanes(); if (selecting()) { *************** *** 1373,1384 **** drawGlos(glos); } - - if (selecting()) { - // selectClips(clips); - } - } if (!selecting()) { Collection<Geometric> geometrics = new HashSet(); geometrics.addAll(Selection.primary()); --- 1413,1420 ---- drawGlos(glos); } } if (!selecting()) { + disableClipplanes(); Collection<Geometric> geometrics = new HashSet(); geometrics.addAll(Selection.primary()); *************** *** 1398,1401 **** --- 1434,1438 ---- gl.glPopMatrix(); } + enableClipplanes(); } } Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.272 retrieving revision 1.273 diff -C2 -d -r1.272 -r1.273 *** View.java 13 Dec 2007 12:00:49 -0000 1.272 --- View.java 28 Dec 2007 11:17:05 -0000 1.273 *************** *** 110,114 **** /** Used for selected objects */ ! public static final float[] SELECTED_COLOR = new float[] {1.0f, 0.4f, 1.0f}; /** Used for clipping planes */ --- 110,115 ---- /** Used for selected objects */ ! public static final float[] SELECTED_COLOR = new float[] {0.7f, 0.3f, 0.1f}; ! /** Used for clipping planes */ *************** *** 680,683 **** --- 681,685 ---- gl.glDisable(GL.GL_DEPTH_TEST); pushName(gl, current); + gl.glColor3fv(SELECTED_COLOR, 0); drawClipplane(current); popName(gl); |