[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view View.java, 1.229, 1.230
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-09-21 12:02:28
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18177/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Preliminary implementation of hidden geometry Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.229 retrieving revision 1.230 diff -C2 -d -r1.229 -r1.230 *** View.java 19 Sep 2007 12:29:39 -0000 1.229 --- View.java 21 Sep 2007 12:02:29 -0000 1.230 *************** *** 374,378 **** /** Contains invisible entities during drawing */ ! private Set invisibles; /** Contains highlighted entities during drawing */ --- 374,378 ---- /** Contains invisible entities during drawing */ ! private Set<Surface> invisibles; /** Contains highlighted entities during drawing */ *************** *** 962,965 **** --- 962,974 ---- } { + Camera camera = Project.getInstance().getCurrentCamera(); + for (Geometric geometric : camera.getHiddenGeometrics()) { + if (geometric instanceof Space) { + Space space = (Space) geometric; + invisibles.addAll(space.getEnvelope()); + } + } + } + { Iterator iter = highligts.iterator(); while (iter.hasNext()) { *************** *** 1189,1193 **** } if (doDrawEdges) { ! drawGeneralEdges(space.getEdges(), !active); } --- 1198,1217 ---- } if (doDrawEdges) { ! Set<Edge> mark = new HashSet(); ! for (Surface current : invisibles) { ! mark.addAll(current.getEdges()); ! } ! for (Surface current : space.getSurfaces()) { ! if (!hidden(current)) { ! mark.removeAll(current.getEdges()); ! } ! } ! List<Edge> edges = new LinkedList(); ! for (Edge current : space.getEdges()) { ! if (!mark.contains(current)) { ! edges.add(current); ! } ! } ! drawGeneralEdges(edges, !active); } *************** *** 1633,1636 **** --- 1657,1672 ---- } + private boolean hidden(Space space) { + Camera camera = Project.getInstance().getCurrentCamera(); + return camera.getHiddenGeometrics().contains(space); + } + + private boolean hidden(Surface surface) { + if (hidden(surface.getBackDomain()) || hidden(surface.getFrontDomain())) { + return true; + } + return false; + } + /** * |