[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view View.java, 1.271, 1.272 Display.java,
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-12-13 12:00:50
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20756/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java Log Message: Major change wrt Space/Container Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** Display.java 12 Dec 2007 14:38:47 -0000 1.67 --- Display.java 13 Dec 2007 12:00:50 -0000 1.68 *************** *** 28,31 **** --- 28,32 ---- import net.sourceforge.bprocessor.gl.model.GlObject; + import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.ClippingPlane; *************** *** 40,44 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; --- 41,45 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 482,486 **** } ! private static float[] colorOf(Space space) { if (space.isVoid()) { return misty; --- 483,487 ---- } ! private static float[] colorOf(Container space) { if (space.isVoid()) { return misty; *************** *** 503,507 **** gl.glCullFace(GL.GL_BACK); for (Surface current : surfaces) { ! Space front = current.getFrontDomain(); Vertex n = current.normal(); gl.glNormal3d(n.getX(), n.getY(), n.getZ()); --- 504,508 ---- gl.glCullFace(GL.GL_BACK); for (Surface current : surfaces) { ! Container front = current.getFrontDomain(); Vertex n = current.normal(); gl.glNormal3d(n.getX(), n.getY(), n.getZ()); *************** *** 514,518 **** } for (Surface current : surfaces) { ! Space back = current.getBackDomain(); Vertex n = current.normal(); gl.glNormal3d(-n.getX(), -n.getY(), -n.getZ()); --- 515,519 ---- } for (Surface current : surfaces) { ! Container back = current.getBackDomain(); Vertex n = current.normal(); gl.glNormal3d(-n.getX(), -n.getY(), -n.getZ()); *************** *** 800,809 **** } ! private static boolean hidden(Space space) { Collection<Geometric> hidden = camera.getHiddenGeometrics(); return hidden.contains(space); } ! private static boolean transparent(Space space) { if (hidden(space)) { return true; --- 801,810 ---- } ! private static boolean hidden(Container space) { Collection<Geometric> hidden = camera.getHiddenGeometrics(); return hidden.contains(space); } ! private static boolean transparent(Container space) { if (hidden(space)) { return true; *************** *** 823,832 **** private static boolean transparent(Surface surface) { ! Space front = surface.getFrontDomain(); ! Space back = surface.getBackDomain(); return transparent(front) && transparent(back); } ! private static boolean active(Space space) { if (space == null) { return false; --- 824,833 ---- private static boolean transparent(Surface surface) { ! Container front = surface.getFrontDomain(); ! Container back = surface.getBackDomain(); return transparent(front) && transparent(back); } ! private static boolean active(Container space) { if (space == null) { return false; *************** *** 844,848 **** drawInstance((Instance) space, inside); } else { ! drawSpace(space, inside); } } --- 845,849 ---- drawInstance((Instance) space, inside); } else { ! drawSpace((Container) space, inside); } } *************** *** 855,859 **** translateToCoordinatesystem(space); if (USEDL && inside) { ! Space work = space.getProto(); Integer index = displayLists.get(work); if (index != null) { --- 856,860 ---- translateToCoordinatesystem(space); if (USEDL && inside) { ! Container work = space.getProto(); Integer index = displayLists.get(work); if (index != null) { *************** *** 900,904 **** } ! private static void drawSpace(Space space, boolean inside) { Set<Geometric> hidden = new HashSet(); hidden.addAll(camera.getHiddenGeometrics()); --- 901,905 ---- } ! private static void drawSpace(Container space, boolean inside) { Set<Geometric> hidden = new HashSet(); hidden.addAll(camera.getHiddenGeometrics()); *************** *** 1021,1025 **** } } ! Space work = space; while (work != null) { for (Constructor current : work.getConstructors()) { --- 1022,1026 ---- } } ! Container work = space; while (work != null) { for (Constructor current : work.getConstructors()) { *************** *** 1028,1032 **** } } ! work = (Space)work.parent(); } } --- 1029,1033 ---- } } ! work = (Container)work.parent(); } } *************** *** 1140,1144 **** * @param space The last space in the line of translations */ ! private static void translateToCoordinatesystem(Space space) { List<CoordinateSystem> translation = new LinkedList<CoordinateSystem>(); --- 1141,1145 ---- * @param space The last space in the line of translations */ ! private static void translateToCoordinatesystem(Instance space) { List<CoordinateSystem> translation = new LinkedList<CoordinateSystem>(); *************** *** 1191,1195 **** if (space.isInstance()) { gl.glPushMatrix(); ! translateToCoordinatesystem(space); } Collection<Surface> envelope = new LinkedList(space.getEnvelope()); --- 1192,1196 ---- if (space.isInstance()) { gl.glPushMatrix(); ! translateToCoordinatesystem((Instance) space); } Collection<Surface> envelope = new LinkedList(space.getEnvelope()); *************** *** 1290,1295 **** Display.camera = camera; Display.active = Project.getInstance().world(); ! if (geometric instanceof Space) { ! Display.draw((Space)geometric, true); } else if (geometric instanceof Surface) { Display.draw((Surface)geometric, true); --- 1291,1296 ---- Display.camera = camera; Display.active = Project.getInstance().world(); ! if (geometric instanceof Container) { ! Display.draw((Container)geometric, true); } else if (geometric instanceof Surface) { Display.draw((Surface)geometric, true); *************** *** 1314,1318 **** camera = project.getCurrentCamera(); active = project.getActiveSpace(); ! Space world = project.world(); draw(world, world == active); --- 1315,1319 ---- camera = project.getCurrentCamera(); active = project.getActiveSpace(); ! Container world = project.world(); draw(world, world == active); *************** *** 1383,1387 **** if (active.isInstance()) { gl.glPushMatrix(); ! translateToCoordinatesystem(active); } --- 1384,1388 ---- if (active.isInstance()) { gl.glPushMatrix(); ! translateToCoordinatesystem((Instance) active); } Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.271 retrieving revision 1.272 diff -C2 -d -r1.271 -r1.272 *** View.java 13 Dec 2007 08:21:40 -0000 1.271 --- View.java 13 Dec 2007 12:00:49 -0000 1.272 *************** *** 22,25 **** --- 22,26 ---- import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Geometric; + import net.sourceforge.bprocessor.model.Instance; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Camera; *************** *** 27,31 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.Surface; --- 28,32 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.Surface; *************** *** 846,853 **** } ! private void drawPath(LinkedList<Space> path, boolean selection) { LinkedList<Label> labels = new LinkedList<Label>(); boolean first = true; ! for (Space space : path) { if (!first) { labels.add(new Label(">>")); --- 847,854 ---- } ! private void drawPath(LinkedList<Container> path, boolean selection) { LinkedList<Label> labels = new LinkedList<Label>(); boolean first = true; ! for (Container space : path) { if (!first) { labels.add(new Label(">>")); *************** *** 886,892 **** */ private void drawSpacePath(boolean selection) { ! Space active = Project.getInstance().getActiveSpace(); ! Space world = Project.getInstance().world(); ! LinkedList<Space> path = new LinkedList<Space>(); path.add(active); while (active != world) { --- 887,893 ---- */ private void drawSpacePath(boolean selection) { ! Container active = Project.getInstance().getActiveSpace(); ! Container world = Project.getInstance().world(); ! LinkedList<Container> path = new LinkedList<Container>(); path.add(active); while (active != world) { *************** *** 977,982 **** //fix for making label selection work in ortho mode front.setZ(1); ! Space frontDomain = surface.getFrontDomain(); ! Space backDomain = surface.getBackDomain(); String frontName; String backName; --- 978,983 ---- //fix for making label selection work in ortho mode front.setZ(1); ! Container frontDomain = surface.getFrontDomain(); ! Container backDomain = surface.getBackDomain(); String frontName; String backName; *************** *** 1291,1295 **** if (names > 1) { for (int namesIndex = 1; namesIndex < names; namesIndex++) { ! Space instance = (Space)getObject(selectBuffer.get(bufferOffset + namesIndex)); if (unWantedEntities.contains(instance)) { currentPath = null; --- 1292,1296 ---- if (names > 1) { for (int namesIndex = 1; namesIndex < names; namesIndex++) { ! Instance instance = (Instance)getObject(selectBuffer.get(bufferOffset + namesIndex)); if (unWantedEntities.contains(instance)) { currentPath = null; *************** *** 1598,1602 **** if (object instanceof Geometric) { Geometric current = (Geometric) object; ! Space active = Project.getInstance().getActiveSpace(); while (current != null && current.getOwner() != active) { current = current.getOwner(); --- 1599,1603 ---- if (object instanceof Geometric) { Geometric current = (Geometric) object; ! Container active = Project.getInstance().getActiveSpace(); while (current != null && current.getOwner() != active) { current = current.getOwner(); *************** *** 2013,2018 **** */ public void update(Object entity) { ! if (entity instanceof Space) { ! for (Surface s : ((Space)entity).getSurfaces()) { if (DISP) { Integer which = displayLists.remove(s); --- 2014,2019 ---- */ public void update(Object entity) { ! if (entity instanceof Container) { ! for (Surface s : ((Container)entity).getSurfaces()) { if (DISP) { Integer which = displayLists.remove(s); *************** *** 2032,2036 **** if (DISP) { Geometric g = (Geometric)entity; ! Space sp = g.getOwner(); for (Surface s : sp.getSurfaces()) { Integer which = displayLists.remove(s); --- 2033,2037 ---- if (DISP) { Geometric g = (Geometric)entity; ! Container sp = g.getOwner(); for (Surface s : sp.getSurfaces()) { Integer which = displayLists.remove(s); |