[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view View.java, 1.91, 1.92
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2006-06-06 09:22:32
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21461/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Refactored clippingplanes to the model (still needs to do xml saving along with camera as well as display them on the attribute view) and changed the storing of clipping planes to the camera instead of View... Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** View.java 18 May 2006 14:24:11 -0000 1.91 --- View.java 6 Jun 2006 09:22:25 -0000 1.92 *************** *** 9,16 **** import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.tool.SpaceTool; - import net.sourceforge.bprocessor.gl.model.ClippingPlane; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gui.Toolbar; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Defaults; --- 9,16 ---- import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.tool.SpaceTool; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gui.Toolbar; + import net.sourceforge.bprocessor.model.ClippingPlane; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Defaults; *************** *** 263,269 **** /** The raster of transparent surfaces */ protected static byte[] seethrough = new byte[128]; - - /** The list of clipping planes */ - private List clippingPlanes; /** Indicating if the front space-label is selected */ --- 263,266 ---- *************** *** 294,297 **** --- 291,297 ---- private Set highligts; + /** Max number of clipplanes */ + private int maxClippingPlanes; + static { setTransparency(100); *************** *** 378,382 **** public View(GLView glv) { this.glv = glv; - clippingPlanes = new ArrayList(); bgColor = BACKGROUND_COLOR; lineColor = STD_LINE_COLOR; --- 378,381 ---- *************** *** 422,425 **** --- 421,428 ---- 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(); *************** *** 494,498 **** coords(); ! Iterator clipit = clippingPlanes.iterator(); while (clipit.hasNext()) { ClippingPlane cp = (ClippingPlane)clipit.next(); --- 497,501 ---- coords(); ! Iterator clipit = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); while (clipit.hasNext()) { ClippingPlane cp = (ClippingPlane)clipit.next(); *************** *** 508,512 **** gl.glEnable(GL.GL_DEPTH_TEST); ! clipit = clippingPlanes.iterator(); while (clipit.hasNext()) { ClippingPlane cp = (ClippingPlane)clipit.next(); --- 511,515 ---- gl.glEnable(GL.GL_DEPTH_TEST); ! clipit = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); while (clipit.hasNext()) { ClippingPlane cp = (ClippingPlane)clipit.next(); *************** *** 514,518 **** } ! clipit = clippingPlanes.iterator(); while (clipit.hasNext()) { ClippingPlane cp = (ClippingPlane)clipit.next(); --- 517,521 ---- } ! clipit = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); while (clipit.hasNext()) { ClippingPlane cp = (ClippingPlane)clipit.next(); *************** *** 1433,1437 **** if (selectMode == CLIPPLANES || selectMode == ALL) { { ! Iterator it = clippingPlanes.iterator(); while (it.hasNext()) { ClippingPlane cp = (ClippingPlane)it.next(); --- 1436,1440 ---- if (selectMode == CLIPPLANES || selectMode == ALL) { { ! Iterator it = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); while (it.hasNext()) { ClippingPlane cp = (ClippingPlane)it.next(); *************** *** 1440,1444 **** } { ! Iterator it = clippingPlanes.iterator(); while (it.hasNext()) { ClippingPlane cp = (ClippingPlane)it.next(); --- 1443,1447 ---- } { ! Iterator it = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); while (it.hasNext()) { ClippingPlane cp = (ClippingPlane)it.next(); *************** *** 2064,2084 **** /** * Adds a clippingPlane to the view ! * @param cp The clippingPlane ! */ ! public void addClippingPlane(ClippingPlane cp) { ! int[] maxclip = new int[1]; ! gl.glGetIntegerv(GL.GL_MAX_CLIP_PLANES, maxclip); ! if (clippingPlanes.size() < maxclip[0] || maxclip[0] == 0) { ! cp.setNumber(clippingPlanes.size()); ! clippingPlanes.add(cp); ! } ! } ! ! /** ! * Remove the given clippingplane ! * @param cp The clippingplane to remove */ ! public void removeClippingPlane(ClippingPlane cp) { ! clippingPlanes.remove(cp); } --- 2067,2074 ---- /** * Adds a clippingPlane to the view ! * @return The maximum number of clipping planes in the GL */ ! public int getMaxClipPlanes() { ! return maxClippingPlanes; } |