Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16163/src/net/sourceforge/bprocessor/gl/view
Modified Files:
View.java
Log Message:
A selected space is show with highlighted edges and invisible surfaces
Index: View.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v
retrieving revision 1.88
retrieving revision 1.89
diff -C2 -d -r1.88 -r1.89
*** View.java 5 May 2006 11:40:07 -0000 1.88
--- View.java 8 May 2006 07:14:34 -0000 1.89
***************
*** 288,291 ****
--- 288,297 ----
private Map colorMap;
+ /** Contains invisible entities during drawing */
+ private Set invisibles;
+
+ /** Contains highlighted entities during drawing */
+ private Set highligts;
+
static {
setTransparency(100);
***************
*** 695,703 ****
// draw selection
gl.glColor3fv(SELECTED_COLOR);
! Iterator selit = selection.iterator();
! while (selit.hasNext()) {
! Object o = selit.next();
! if (o instanceof Surface) {
! drawObject(o);
}
}
--- 701,733 ----
// draw selection
gl.glColor3fv(SELECTED_COLOR);
! invisibles = new HashSet();
! highligts = new HashSet();
!
! {
! Iterator iter = selection.iterator();
! while (iter.hasNext()) {
! Object object = iter.next();
! if (object instanceof Space) {
! Space space = (Space) object;
! Collection envelope = space.getEnvelope();
! Iterator i = envelope.iterator();
! while (i.hasNext()) {
! Surface surface = (Surface) i.next();
! highligts.addAll(surface.getEdges());
! invisibles.add(surface);
! }
! } else {
! highligts.add(object);
! }
! }
! }
!
! {
! Iterator iter = highligts.iterator();
! while (iter.hasNext()) {
! Object o = iter.next();
! if (o instanceof Surface) {
! drawObject(o);
! }
}
}
***************
*** 715,724 ****
}
! gl.glColor3fv(SELECTED_COLOR);
! selit = selection.iterator();
! while (selit.hasNext()) {
! Object o = selit.next();
! if (!(o instanceof Surface)) {
! drawObject(o);
}
}
--- 745,756 ----
}
! {
! gl.glColor3fv(SELECTED_COLOR);
! Iterator highlightIter = highligts.iterator();
! while (highlightIter.hasNext()) {
! Object o = highlightIter.next();
! if (!(o instanceof Surface)) {
! drawObject(o);
! }
}
}
***************
*** 914,918 ****
*/
private boolean hide(Surface surface) {
! return false;
}
--- 946,950 ----
*/
private boolean hide(Surface surface) {
! return invisibles.contains(surface);
}
|