Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14147/src/net/sourceforge/bprocessor/gl/view
Modified Files:
View.java
Log Message:
Minor adjustments
Index: View.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** View.java 20 Dec 2005 13:55:52 -0000 1.35
--- View.java 20 Dec 2005 22:01:36 -0000 1.36
***************
*** 245,253 ****
protected boolean doDrawEdges = true;
! /** The transparency of surfaces */
protected static byte[] transparency = new byte[128];
! /** The transparency of highlight */
protected static byte[] highlight = new byte[128];
/** The list of clipping planes */
--- 245,256 ----
protected boolean doDrawEdges = true;
! /** The raster of selected surfaces */
protected static byte[] transparency = new byte[128];
! /** The raster of highlighted surfaces */
protected static byte[] highlight = new byte[128];
+
+ /** The raster of transparent surfaces */
+ protected static byte[] seethrough = new byte[128];
/** The list of clipping planes */
***************
*** 275,278 ****
--- 278,282 ----
setTransparency(100);
setHighlight();
+ setSeethrough();
};
***************
*** 324,327 ****
--- 328,353 ----
}
}
+
+ /**
+ * Set the seethrough pattern
+ */
+ public static void setSeethrough() {
+ byte b1 = (byte) 0x80;
+ byte b2 = (byte) 0x08;
+ byte b3 = (byte) 0x00;
+ for (int i = 0; i < seethrough.length; i++) {
+ int d = ((int)(i / 4)) % 4;
+
+ if (d == 0) {
+ seethrough[i] = b1;
+ } else if (d == 1) {
+ seethrough[i] = b3;
+ } else if (d == 2) {
+ seethrough[i] = b2;
+ } else if (d == 3) {
+ seethrough[i] = b3;
+ }
+ }
+ }
/**
***************
*** 1362,1366 ****
Surface s = (Surface)it.next();
if (!selection.contains(s)) {
! if (isVisible(s)) {
if (side == FRONT) {
Space back = s.getFrontDomain();
--- 1388,1397 ----
Surface s = (Surface)it.next();
if (!selection.contains(s)) {
! boolean visible = isVisible(s);
! if (!visible) {
! gl.glEnable(GL.GL_POLYGON_STIPPLE);
! gl.glPolygonStipple(seethrough);
! gl.glColor3fv(GRID_COLOR);
! } else {
if (side == FRONT) {
Space back = s.getFrontDomain();
***************
*** 1371,1375 ****
gl.glColor3fv(getSpaceColor(front));
}
! drawSurface(s);
}
}
--- 1402,1409 ----
gl.glColor3fv(getSpaceColor(front));
}
! }
! drawSurface(s);
! if (!visible) {
! gl.glDisable(GL.GL_POLYGON_STIPPLE);
}
}
***************
*** 2027,2031 ****
if (picking > 0) {
int[] viewport = new int[] {0, 0, (int)width, (int)height};
! glu.gluPickMatrix(x, viewport[3] - y, 10, 10, viewport);
}
--- 2061,2065 ----
if (picking > 0) {
int[] viewport = new int[] {0, 0, (int)width, (int)height};
! glu.gluPickMatrix(x, viewport[3] - y, 6, 6, viewport);
}
|