bprocessor-commit Mailing List for B-processor (Page 53)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: rimestad <rim...@us...> - 2007-09-27 10:39:42
|
Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10550/src/net/sourceforge/bprocessor/gl/tool Modified Files: ExtrusionTool.java Log Message: calls static method in the static way Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** ExtrusionTool.java 20 Sep 2007 07:45:06 -0000 1.68 --- ExtrusionTool.java 27 Sep 2007 10:39:43 -0000 1.69 *************** *** 131,135 **** extrusion.addAll(tops); if (finish) { ! insert(space, extrusion); } else { space.addProtected(extrusion); --- 131,135 ---- extrusion.addAll(tops); if (finish) { ! ExtrusionTool.insert(space, extrusion); } else { space.addProtected(extrusion); |
From: rimestad <rim...@us...> - 2007-09-27 10:39:15
|
Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10524/src/net/sourceforge/bprocessor/gl/tool Modified Files: FocusTool.java Log Message: when no legal target is hoovered target is nulled Index: FocusTool.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool/FocusTool.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FocusTool.java 24 Sep 2007 13:02:17 -0000 1.4 --- FocusTool.java 27 Sep 2007 10:39:16 -0000 1.5 *************** *** 67,71 **** Camera.focusOn(Project.getInstance().getCurrentCamera(), (ClippingPlane)target); } ! this.glv.repaint(); } --- 67,71 ---- Camera.focusOn(Project.getInstance().getCurrentCamera(), (ClippingPlane)target); } ! target = null; this.glv.repaint(); } |
From: rimestad <rim...@us...> - 2007-09-27 10:38:43
|
Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10132/src/net/sourceforge/bprocessor/gl/tool Modified Files: Tool.java Log Message: changed javadoc Index: Tool.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool/Tool.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Tool.java 7 Sep 2007 13:21:10 -0000 1.37 --- Tool.java 27 Sep 2007 10:38:35 -0000 1.38 *************** *** 93,97 **** /** ! * Prepare */ public void prepare(); --- 93,97 ---- /** ! * Method called when the tool is selected */ public void prepare(); |
From: Michael L. <he...@us...> - 2007-09-27 08:33:36
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25056/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: First step in space propagation Refactored GenericTreeView sorting of children Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.112 retrieving revision 1.113 diff -C2 -d -r1.112 -r1.113 *** GenericTreeView.java 23 Sep 2007 18:20:22 -0000 1.112 --- GenericTreeView.java 27 Sep 2007 08:33:17 -0000 1.113 *************** *** 442,445 **** --- 442,446 ---- public class ContainerNode extends GenericNode { protected Collection< ? extends Entity> content; + private boolean sort; /** *************** *** 447,454 **** * @param object User collection to put in * @param label The label for the container node */ ! public ContainerNode(Object label, Collection< ? extends Entity> object) { super(label); this.content = object; } --- 448,457 ---- * @param object User collection to put in * @param label The label for the container node + * @param sort Sort the children? */ ! public ContainerNode(Object label, Collection< ? extends Entity> object, boolean sort) { super(label); this.content = object; + this.sort = sort; } *************** *** 525,529 **** } if (elements.size() > 0) { ! this.insertChildren(elements, true); } if (children.size() > 0) { --- 528,532 ---- } if (elements.size() > 0) { ! this.insertChildren(elements); } if (children.size() > 0) { *************** *** 538,544 **** * Insert a collection of Entity into this node * @param entities collection of Entity - * @param sort boolean that is true if the entities should be sorted */ ! public void insertChildren(Collection<? extends Entity> entities, boolean sort) { LinkedList<Entity> sorted = new LinkedList<Entity>(entities); if (sort) { --- 541,546 ---- * Insert a collection of Entity into this node * @param entities collection of Entity */ ! public void insertChildren(Collection<? extends Entity> entities) { LinkedList<Entity> sorted = new LinkedList<Entity>(entities); if (sort) { *************** *** 817,821 **** if (constructor instanceof CoordinateSystem) { CoordinateSystem system = (CoordinateSystem) constructor; ! add(new ContainerNode("Relations", system.relations())); update(system); } --- 819,823 ---- if (constructor instanceof CoordinateSystem) { CoordinateSystem system = (CoordinateSystem) constructor; ! add(new ContainerNode("Relations", system.relations(), true)); update(system); } *************** *** 930,935 **** */ public SurfaceContainer(String name, Collection surfaces) { ! super(name, surfaces); ! insertChildren(surfaces, true); } --- 932,937 ---- */ public SurfaceContainer(String name, Collection surfaces) { ! super(name, surfaces, true); ! insertChildren(surfaces); } *************** *** 958,963 **** */ public ElementContainer(String name, Collection elements) { ! super(name, elements); ! insertChildren(elements, true); } --- 960,965 ---- */ public ElementContainer(String name, Collection elements) { ! super(name, elements, true); ! insertChildren(elements); } *************** *** 986,990 **** */ public GeometryContainer(String name, Space space) { ! super(name, null); add(new SurfaceContainer("Surfaces", space.getSurfaces())); add(new EdgeContainer("Edges", space.getEdges())); --- 988,992 ---- */ public GeometryContainer(String name, Space space) { ! super(name, null, false); add(new SurfaceContainer("Surfaces", space.getSurfaces())); add(new EdgeContainer("Edges", space.getEdges())); *************** *** 1018,1023 **** */ public ConstructorContainer(String name, Collection constructors) { ! super(name, constructors); ! insertChildren(constructors, true); } --- 1020,1025 ---- */ public ConstructorContainer(String name, Collection constructors) { ! super(name, constructors, true); ! insertChildren(constructors); } *************** *** 1046,1051 **** */ public EdgeContainer(String name, Collection edges) { ! super(name, edges); ! insertChildren(edges, true); } --- 1048,1053 ---- */ public EdgeContainer(String name, Collection edges) { ! super(name, edges, true); ! insertChildren(edges); } *************** *** 1073,1078 **** */ public ProjectNode(Project p) { ! super(p, p.getSpaces()); ! insertChildren(p.getSpaces(), true); } --- 1075,1080 ---- */ public ProjectNode(Project p) { ! super(p, p.getSpaces(), true); ! insertChildren(p.getSpaces()); } *************** *** 1109,1113 **** */ public CameraNode(Camera c) { ! super(c, c.getClipplanes()); update(c); } --- 1111,1115 ---- */ public CameraNode(Camera c) { ! super(c, c.getClipplanes(), true); update(c); } *************** *** 1140,1145 **** */ public VertexContainer(String name, Collection vertices) { ! super(name, vertices); ! insertChildren(vertices, true); } --- 1142,1147 ---- */ public VertexContainer(String name, Collection vertices) { ! super(name, vertices, true); ! insertChildren(vertices); } *************** *** 1168,1173 **** */ public ParameterBlockNode(String name, ParameterBlock object) { ! super(name, object.getAttributes()); ! insertChildren(object.getAttributes(), true); } --- 1170,1175 ---- */ public ParameterBlockNode(String name, ParameterBlock object) { ! super(name, object.getAttributes(), true); ! insertChildren(object.getAttributes()); } *************** *** 1229,1233 **** */ public ConstraintContainer(String name, Collection constraints) { ! super(name, constraints); update(constraints); } --- 1231,1235 ---- */ public ConstraintContainer(String name, Collection constraints) { ! super(name, constraints, true); update(constraints); } *************** *** 1244,1248 **** */ public RelationContainer(List<Relation> relations) { ! super("Relations", relations); update(relations); } --- 1246,1250 ---- */ public RelationContainer(List<Relation> relations) { ! super("Relations", relations, true); update(relations); } *************** *** 1259,1263 **** */ public TransformationContainer(String name, Stack transforms) { ! super(name, transforms); update(transforms); } --- 1261,1265 ---- */ public TransformationContainer(String name, Stack transforms) { ! super(name, transforms, false); update(transforms); } |
From: Michael L. <he...@us...> - 2007-09-27 08:33:14
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25042/src/net/sourceforge/bprocessor/model Modified Files: SpaceAnalysis.java Surface.java Log Message: First step in space propagation Refactored GenericTreeView sorting of children Index: SpaceAnalysis.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SpaceAnalysis.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SpaceAnalysis.java 27 Sep 2007 07:00:20 -0000 1.3 --- SpaceAnalysis.java 27 Sep 2007 08:33:13 -0000 1.4 *************** *** 54,65 **** } } for (Edge current : surface.getEdges()) { List<Surface> surfaces = edgemap.get(current); if (surfaces.size() > 1) { - System.out.println("select from " + surfaces + " around " + current); Surface selected = select(current, surfaces, surface, side); - System.out.println("selected = " + selected); if (travel(surface, current) == travel(selected, current)) { - System.out.println("SAME"); if (side == 1) { selected.setBackDomain(surface.getFrontDomain()); --- 54,63 ---- } } + for (Edge current : surface.getEdges()) { List<Surface> surfaces = edgemap.get(current); if (surfaces.size() > 1) { Surface selected = select(current, surfaces, surface, side); if (travel(surface, current) == travel(selected, current)) { if (side == 1) { selected.setBackDomain(surface.getFrontDomain()); *************** *** 68,72 **** } } else { - System.out.println("OTHER"); if (side == 1) { selected.setFrontDomain(surface.getFrontDomain()); --- 66,69 ---- *************** *** 87,91 **** double minimum = 2 * Math.PI; double maximum = 0; - System.out.println("-- " + leader + " " + direction + " --"); for (Surface current : surfaces) { if (current != leader) { --- 84,87 ---- Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.180 retrieving revision 1.181 diff -C2 -d -r1.180 -r1.181 *** Surface.java 27 Sep 2007 07:00:20 -0000 1.180 --- Surface.java 27 Sep 2007 08:33:13 -0000 1.181 *************** *** 1305,1310 **** public void assignBack(Space back) { setBackDomain(back); ! //SpaceAnalysis analysis = new SpaceAnalysis(); ! //analysis.propagate(this, -1); } --- 1305,1310 ---- public void assignBack(Space back) { setBackDomain(back); ! SpaceAnalysis analysis = new SpaceAnalysis(); ! analysis.propagate(this, -1); } *************** *** 1330,1335 **** public void assignFront(Space front) { setFrontDomain(front); ! //SpaceAnalysis analysis = new SpaceAnalysis(); ! //analysis.propagate(this, 1); } --- 1330,1335 ---- public void assignFront(Space front) { setFrontDomain(front); ! SpaceAnalysis analysis = new SpaceAnalysis(); ! analysis.propagate(this, 1); } |
From: Michael L. <he...@us...> - 2007-09-27 07:00:21
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20989/src/net/sourceforge/bprocessor/model Modified Files: SpaceAnalysis.java Surface.java Log Message: Good progress on space assignment propagation Index: SpaceAnalysis.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SpaceAnalysis.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SpaceAnalysis.java 26 Sep 2007 14:30:22 -0000 1.2 --- SpaceAnalysis.java 27 Sep 2007 07:00:20 -0000 1.3 *************** *** 20,24 **** private static final int FORWARD = 1; ! private static final int BACKWARD = 2; private static int travel(Surface surface, Edge edge) { --- 20,24 ---- private static final int FORWARD = 1; ! private static final int BACKWARD = -1; private static int travel(Surface surface, Edge edge) { *************** *** 83,94 **** Vertex i = leader.normal(); int direction = travel(leader, edge); Surface selected = leader; double minimum = 2 * Math.PI; ! if (side < 0) { ! i.scale(-1); ! n.scale(-1); ! } ! ! System.out.println("-- " + leader + " --"); for (Surface current : surfaces) { if (current != leader) { --- 83,91 ---- Vertex i = leader.normal(); int direction = travel(leader, edge); + n.scale(direction); Surface selected = leader; double minimum = 2 * Math.PI; ! double maximum = 0; ! System.out.println("-- " + leader + " " + direction + " --"); for (Surface current : surfaces) { if (current != leader) { *************** *** 104,110 **** angle = 2 * Math.PI - angle; } ! if (angle < minimum) { ! selected = current; ! minimum = angle; } } --- 101,114 ---- angle = 2 * Math.PI - angle; } ! if (side < 0) { ! if (angle > maximum) { ! selected = current; ! maximum = angle; ! } ! } else { ! if (angle < minimum) { ! selected = current; ! minimum = angle; ! } } } Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.179 retrieving revision 1.180 diff -C2 -d -r1.179 -r1.180 *** Surface.java 26 Sep 2007 14:30:23 -0000 1.179 --- Surface.java 27 Sep 2007 07:00:20 -0000 1.180 *************** *** 1305,1310 **** public void assignBack(Space back) { setBackDomain(back); ! // SpaceAnalysis analysis = new SpaceAnalysis(); ! // analysis.propagate(this, -1); } --- 1305,1310 ---- public void assignBack(Space back) { setBackDomain(back); ! //SpaceAnalysis analysis = new SpaceAnalysis(); ! //analysis.propagate(this, -1); } *************** *** 1330,1334 **** public void assignFront(Space front) { setFrontDomain(front); ! // SpaceAnalysis analysis = new SpaceAnalysis(); //analysis.propagate(this, 1); } --- 1330,1334 ---- public void assignFront(Space front) { setFrontDomain(front); ! //SpaceAnalysis analysis = new SpaceAnalysis(); //analysis.propagate(this, 1); } |
From: Michael L. <he...@us...> - 2007-09-26 14:30:32
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17705/src/net/sourceforge/bprocessor/model Modified Files: SpaceAnalysis.java Surface.java Log Message: Progress on SpaceAnalysis Index: SpaceAnalysis.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SpaceAnalysis.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SpaceAnalysis.java 25 Sep 2007 14:25:34 -0000 1.1 --- SpaceAnalysis.java 26 Sep 2007 14:30:22 -0000 1.2 *************** *** 18,28 **** public class SpaceAnalysis { /** * Progates space assignment in specified direction * 1 = front and -1 = back. * @param surface Surface whose space assigment is propagated ! * @param direction side of surface to start */ ! public void propagate(Surface surface, int direction) { Space space = surface.getOwner(); Map<Edge, List<Surface>> edgemap = new HashMap(); --- 18,47 ---- public class SpaceAnalysis { + + private static final int FORWARD = 1; + private static final int BACKWARD = 2; + + private static int travel(Surface surface, Edge edge) { + Vertex vertex = surface.getFirstVertex(); + for (Edge current : surface.getEdges()) { + vertex = current.otherVertex(vertex); + if (current == edge) { + if (vertex == edge.getTo()) { + return FORWARD; + } else { + return BACKWARD; + } + } + } + return 0; + } + /** * Progates space assignment in specified direction * 1 = front and -1 = back. * @param surface Surface whose space assigment is propagated ! * @param side side of surface to start */ ! public void propagate(Surface surface, int side) { Space space = surface.getOwner(); Map<Edge, List<Surface>> edgemap = new HashMap(); *************** *** 35,39 **** --- 54,116 ---- } } + for (Edge current : surface.getEdges()) { + List<Surface> surfaces = edgemap.get(current); + if (surfaces.size() > 1) { + System.out.println("select from " + surfaces + " around " + current); + Surface selected = select(current, surfaces, surface, side); + System.out.println("selected = " + selected); + if (travel(surface, current) == travel(selected, current)) { + System.out.println("SAME"); + if (side == 1) { + selected.setBackDomain(surface.getFrontDomain()); + } else { + selected.setFrontDomain(surface.getBackDomain()); + } + } else { + System.out.println("OTHER"); + if (side == 1) { + selected.setFrontDomain(surface.getFrontDomain()); + } else { + selected.setBackDomain(surface.getBackDomain()); + } + } + } + } + } + + private Surface select(Edge edge, List<Surface> surfaces, Surface leader, int side) { + Vertex n = edge.getDirection(); + Vertex i = leader.normal(); + int direction = travel(leader, edge); + Surface selected = leader; + double minimum = 2 * Math.PI; + if (side < 0) { + i.scale(-1); + n.scale(-1); + } + System.out.println("-- " + leader + " --"); + for (Surface current : surfaces) { + if (current != leader) { + Vertex normal = current.normal(); + if (travel(current, edge) != direction) { + normal.scale(-1); + } + double t = i.dot(normal); + double angle = Math.acos(t); + Vertex cross = i.cross(normal); + double dot = n.dot(cross); + if (dot < 0) { + angle = 2 * Math.PI - angle; + } + if (angle < minimum) { + selected = current; + minimum = angle; + } + } + } + return selected; } + + } Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.178 retrieving revision 1.179 diff -C2 -d -r1.178 -r1.179 *** Surface.java 26 Sep 2007 08:36:29 -0000 1.178 --- Surface.java 26 Sep 2007 14:30:23 -0000 1.179 *************** *** 1305,1308 **** --- 1305,1310 ---- public void assignBack(Space back) { setBackDomain(back); + // SpaceAnalysis analysis = new SpaceAnalysis(); + // analysis.propagate(this, -1); } *************** *** 1328,1331 **** --- 1330,1335 ---- public void assignFront(Space front) { setFrontDomain(front); + // SpaceAnalysis analysis = new SpaceAnalysis(); + //analysis.propagate(this, 1); } |
From: Michael L. <he...@us...> - 2007-09-26 08:36:34
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv520/src/net/sourceforge/bprocessor/gl/tool Modified Files: DomainPopupListener.java CreateSpaceActionListener.java Log Message: Preps for new space assignment mechanism Index: CreateSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CreateSpaceActionListener.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** CreateSpaceActionListener.java 14 Sep 2007 10:57:49 -0000 1.19 --- CreateSpaceActionListener.java 26 Sep 2007 08:36:34 -0000 1.20 *************** *** 75,81 **** owner.add(space); if (front) { ! surface.setFrontDomain(space); } else { ! surface.setBackDomain(space); } surface.changed(); --- 75,81 ---- owner.add(space); if (front) { ! surface.assignFront(space); } else { ! surface.assignBack(space); } surface.changed(); *************** *** 124,130 **** owner.add(space); if (front) { ! surface.setFrontDomain(space); } else { ! surface.setBackDomain(space); } surface.changed(); --- 124,130 ---- owner.add(space); if (front) { ! surface.assignFront(space); } else { ! surface.assignBack(space); } surface.changed(); Index: DomainPopupListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/DomainPopupListener.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DomainPopupListener.java 5 Apr 2006 09:36:16 -0000 1.5 --- DomainPopupListener.java 26 Sep 2007 08:36:34 -0000 1.6 *************** *** 52,59 **** if (front) { Space oldFront = surface.getFrontDomain(); ! surface.setFrontDomain(domain); ! if (domain != null) { ! domain.addSurface(surface); ! } if (oldFront != null) { oldFront.changed(); --- 52,56 ---- if (front) { Space oldFront = surface.getFrontDomain(); ! surface.assignFront(domain); if (oldFront != null) { oldFront.changed(); *************** *** 61,68 **** } else { Space oldBack = surface.getBackDomain(); ! surface.setBackDomain(domain); ! if (domain != null) { ! domain.addSurface(surface); ! } if (oldBack != null) { oldBack.changed(); --- 58,62 ---- } else { Space oldBack = surface.getBackDomain(); ! surface.assignBack(domain); if (oldBack != null) { oldBack.changed(); |
From: Michael L. <he...@us...> - 2007-09-26 08:36:27
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv509/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Preps for new space assignment mechanism Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.177 retrieving revision 1.178 diff -C2 -d -r1.177 -r1.178 *** Surface.java 26 Sep 2007 08:05:26 -0000 1.177 --- Surface.java 26 Sep 2007 08:36:29 -0000 1.178 *************** *** 1300,1303 **** --- 1300,1311 ---- /** + * Assigns the back and propagates to nearby surfaces. + * @param back Space + */ + public void assignBack(Space back) { + setBackDomain(back); + } + + /** * Get the domain in front of the surface * @return the frontdomain *************** *** 1312,1315 **** --- 1320,1333 ---- return frontDomain; } + + /** + * Assigns the front at takes care of propagating + * to nearby surfaces + * @param front Space to assign + */ + public void assignFront(Space front) { + setFrontDomain(front); + } + /** * Set the domain in front of the surface *************** *** 1327,1331 **** frontDomain.addSurface(this); } - //changed(); } } --- 1345,1348 ---- |
From: Michael L. <he...@us...> - 2007-09-26 08:05:35
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20756/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Removed some comments Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.176 retrieving revision 1.177 diff -C2 -d -r1.176 -r1.177 *** Surface.java 22 Sep 2007 13:51:44 -0000 1.176 --- Surface.java 26 Sep 2007 08:05:26 -0000 1.177 *************** *** 584,597 **** } copy.setEdges(edges); - // Space front = (Space) map.get(frontDomain); - // if (front == null) { - // front = frontDomain; - // } - // copy.setFrontDomain(front); - // Space back = (Space) map.get(backDomain); - // if (back == null) { - // back = backDomain; - // } - // copy.setBackDomain(back); } return copy; --- 584,587 ---- *************** *** 724,747 **** if (delta < 0) { facemap[i].setBackDomain(getBackDomain()); - //facemap[i].setFrontMaterial(getBackMaterial()); if (exterior != null && inside) { if (flip) { facemap[i].setFrontDomain(exterior.getFrontDomain()); - //facemap[i].setBackMaterial(exterior.getFrontMaterial()); } else { facemap[i].setFrontDomain(exterior.getBackDomain()); - //facemap[i].setBackMaterial(exterior.getBackMaterial()); } } } else { facemap[i].setFrontDomain(getFrontDomain()); - //facemap[i].setBackMaterial(getFrontMaterial()); if (exterior != null && inside) { if (flip) { facemap[i].setBackDomain(exterior.getBackDomain()); - //facemap[i].setFrontMaterial(exterior.getBackMaterial()); } else { facemap[i].setBackDomain(exterior.getFrontDomain()); - //facemap[i].setFrontMaterial(exterior.getFrontMaterial()); } } --- 714,731 ---- *************** *** 750,757 **** if (delta < 0) { top.setBackDomain(getBackDomain()); - //top.setFrontMaterial(getBackMaterial()); } else { top.setFrontDomain(getFrontDomain()); - //top.setBackMaterial(getFrontMaterial()); } } --- 734,739 ---- |
From: Michael L. <he...@us...> - 2007-09-25 14:25:37
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20494/src/net/sourceforge/bprocessor/model Added Files: SpaceAnalysis.java Log Message: Started implementation of space analysis --- NEW FILE: SpaceAnalysis.java --- //--------------------------------------------------------------------------------- // $Id: SpaceAnalysis.java,v 1.1 2007/09/25 14:25:34 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; /** * */ public class SpaceAnalysis { /** * Progates space assignment in specified direction * 1 = front and -1 = back. * @param surface Surface whose space assigment is propagated * @param direction side of surface to start */ public void propagate(Surface surface, int direction) { Space space = surface.getOwner(); Map<Edge, List<Surface>> edgemap = new HashMap(); for (Edge current : space.getEdges()) { edgemap.put(current, new LinkedList()); } for (Surface current : space.getSurfaces()) { for (Edge edge : current.getEdges()) { edgemap.get(edge).add(current); } } } } |
From: Michael L. <he...@us...> - 2007-09-25 13:45:00
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3001/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: Void is displayed in cornflower blue Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Display.java 25 Sep 2007 11:07:39 -0000 1.11 --- Display.java 25 Sep 2007 13:45:02 -0000 1.12 *************** *** 54,57 **** --- 54,60 ---- private static float[] blueish = new float[] {0.1f, 0.2f, 0.5f}; private static float[] redish = new float[] {0.5f, 0.2f, 0.1f}; + private static float[] alice = new float[] {0.94f, 0.97f, 1}; + private static float[] cornflower = new float[] {100f / 255, 149f / 255, 237f / 255}; + private static byte[] highlight = new byte[128]; *************** *** 179,183 **** Vertex n = current.normal(); gl.glNormal3d(n.getX(), n.getY(), n.getZ()); ! if (front.isConstructionSpace()) { gl.glColor3fv(Defaults.getFrontColor(), 0); } else { --- 182,188 ---- Vertex n = current.normal(); gl.glNormal3d(n.getX(), n.getY(), n.getZ()); ! if (front.isVoid()) { ! gl.glColor3fv(cornflower, 0); ! } else if (front.isConstructionSpace()) { gl.glColor3fv(Defaults.getFrontColor(), 0); } else { *************** *** 192,196 **** Vertex n = current.normal(); gl.glNormal3d(-n.getX(), -n.getY(), -n.getZ()); ! if (back.isConstructionSpace()) { gl.glColor3fv(Defaults.getFrontColor(), 0); } else { --- 197,203 ---- Vertex n = current.normal(); gl.glNormal3d(-n.getX(), -n.getY(), -n.getZ()); ! if (back.isVoid()) { ! gl.glColor3fv(cornflower, 0); ! } else if (back.isConstructionSpace()) { gl.glColor3fv(Defaults.getFrontColor(), 0); } else { *************** *** 305,309 **** Space back = surface.getBackDomain(); if (front == back) { ! return true; } if (transparent(front) && transparent(back)) { --- 312,318 ---- Space back = surface.getBackDomain(); if (front == back) { ! if (front.isContainer()) { ! return true; ! } } if (transparent(front) && transparent(back)) { |
From: Michael L. <he...@us...> - 2007-09-25 13:45:00
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2977/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Void is displayed in cornflower blue Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.174 retrieving revision 1.175 diff -C2 -d -r1.174 -r1.175 *** Space.java 25 Sep 2007 08:45:48 -0000 1.174 --- Space.java 25 Sep 2007 13:44:58 -0000 1.175 *************** *** 399,402 **** --- 399,414 ---- /** + * Returns true if this space is the empty space. + * @return true if this space is the empty space + */ + public boolean isVoid() { + if (getOwner() != null) { + return getOwner().empty == this; + } else { + return false; + } + } + + /** * * @param container isContainer |
From: Michael L. <he...@us...> - 2007-09-25 11:07:38
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4128/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java Log Message: Drawing temp edges Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Display.java 25 Sep 2007 08:45:52 -0000 1.10 --- Display.java 25 Sep 2007 11:07:39 -0000 1.11 *************** *** 47,50 **** --- 47,51 ---- private static ArrayList objects; private static Geometric target; + private static Collection<? extends Geometric> extras; private static float[] white = new float[] {1.0f, 1.0f, 1.0f}; *************** *** 141,144 **** --- 142,153 ---- } + /** + * Sets the extras geometry + * @param value Collection of geometrics + */ + public static void extras(Collection<? extends Geometric> value) { + extras = value; + } + private static void push(Object object) { objects.add(object); *************** *** 353,356 **** --- 362,379 ---- } } + + // FIXME the set of edges not connected + // to a surface should be cashed. + Set<Edge> mark = new HashSet(); + for (Surface current : space.getSurfaces()) { + mark.addAll(current.getEdges()); + } + for (Edge current : space.getEdges()) { + if (!mark.contains(current)) { + if (!hidden.contains(current)) { + edges.add(current); + } + } + } } { *************** *** 441,444 **** --- 464,481 ---- draw(world, false); + { + Collection<Edge> edges = new LinkedList(); + for (Geometric current : extras) { + if (current instanceof Edge) { + edges.add((Edge) current); + } + } + if (selecting()) { + selectEdges(edges); + } else { + drawEdges(edges, true); + } + } + if (!selecting()) { Collection<Geometric> geometrics = new HashSet(); Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.235 retrieving revision 1.236 diff -C2 -d -r1.235 -r1.236 *** View.java 24 Sep 2007 13:02:18 -0000 1.235 --- View.java 25 Sep 2007 11:07:38 -0000 1.236 *************** *** 702,705 **** --- 702,706 ---- Display.target(null); } + Display.extras(tempEdges); Display.draw(gld); Display.selecting(false); |
From: Michael L. <he...@us...> - 2007-09-25 08:45:58
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11751/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: Functional spaces can be non-transparent too Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Display.java 24 Sep 2007 18:44:40 -0000 1.9 --- Display.java 25 Sep 2007 08:45:52 -0000 1.10 *************** *** 287,291 **** } if (space.isFunctionalSpace()) { ! return true; } return false; --- 287,291 ---- } if (space.isFunctionalSpace()) { ! return false; } return false; |
From: Michael L. <he...@us...> - 2007-09-25 08:45:46
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11742/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Functional spaces can be non-transparent too Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.173 retrieving revision 1.174 diff -C2 -d -r1.173 -r1.174 *** Space.java 21 Sep 2007 08:23:12 -0000 1.173 --- Space.java 25 Sep 2007 08:45:48 -0000 1.174 *************** *** 1411,1415 **** res.add(new Attribute("ID", getId().toString(), false)); res.add(new Attribute("Owner", getOwner(), false)); ! if (isConstructionSpace()) { if (isTransparent()) { res.add(new Attribute("Transparent", Boolean.TRUE)); --- 1411,1415 ---- res.add(new Attribute("ID", getId().toString(), false)); res.add(new Attribute("Owner", getOwner(), false)); ! if (isConstructionSpace() || isFunctionalSpace()) { if (isTransparent()) { res.add(new Attribute("Transparent", Boolean.TRUE)); |
From: Michael L. <he...@us...> - 2007-09-24 18:44:45
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32008/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: Refactoring of unified display Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Display.java 24 Sep 2007 14:40:34 -0000 1.8 --- Display.java 24 Sep 2007 18:44:40 -0000 1.9 *************** *** 37,40 **** --- 37,43 ---- */ public class Display { + + private static final boolean TRUE = true; + private static boolean initialized; private static boolean selecting; *************** *** 148,154 **** private static void selectSurfaces(Collection<Surface> surfaces) { for (Surface current : surfaces) { ! push(current); ! draw(current, false); ! pop(); } } --- 151,159 ---- private static void selectSurfaces(Collection<Surface> surfaces) { for (Surface current : surfaces) { ! if (!transparent(current)) { ! push(current); ! draw(current, false); ! pop(); ! } } } *************** *** 161,184 **** 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()); ! if (front.isConstructionSpace()) { ! gl.glColor3fv(Defaults.getFrontColor(), 0); ! } else { ! gl.glColor3fv(Defaults.getBackColor(), 0); } - draw(current, false); } for (Surface current : surfaces) { ! Space back = current.getBackDomain(); ! Vertex n = current.normal(); ! gl.glNormal3d(-n.getX(), -n.getY(), -n.getZ()); ! if (back.isConstructionSpace()) { ! gl.glColor3fv(Defaults.getFrontColor(), 0); ! } else { ! gl.glColor3fv(Defaults.getBackColor(), 0); } - draw(current, true); } gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); --- 166,193 ---- gl.glCullFace(GL.GL_BACK); for (Surface current : surfaces) { ! if (!transparent(current)) { ! Space front = current.getFrontDomain(); ! Vertex n = current.normal(); ! gl.glNormal3d(n.getX(), n.getY(), n.getZ()); ! if (front.isConstructionSpace()) { ! gl.glColor3fv(Defaults.getFrontColor(), 0); ! } else { ! gl.glColor3fv(Defaults.getBackColor(), 0); ! } ! draw(current, false); } } for (Surface current : surfaces) { ! if (!transparent(current)) { ! Space back = current.getBackDomain(); ! Vertex n = current.normal(); ! gl.glNormal3d(-n.getX(), -n.getY(), -n.getZ()); ! if (back.isConstructionSpace()) { ! gl.glColor3fv(Defaults.getFrontColor(), 0); ! } else { ! gl.glColor3fv(Defaults.getBackColor(), 0); ! } ! draw(current, true); } } gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); *************** *** 265,269 **** private static boolean transparent(Space space) { ! return (space.isFunctionalSpace() || space.isTransparent() || !space.getSurfaces().isEmpty()); } --- 274,293 ---- private static boolean transparent(Space space) { ! Project project = Project.getInstance(); ! Camera camera = project.getCurrentCamera(); ! Collection<Geometric> hidden = camera.getHiddenGeometrics(); ! if (hidden.contains(space)) { ! return true; ! } ! if (space.isTransparent()) { ! return true; ! } ! if (!space.getSurfaces().isEmpty()) { ! return true; ! } ! if (space.isFunctionalSpace()) { ! return true; ! } ! return false; } *************** *** 289,319 **** Set<Geometric> hidden = new HashSet(); hidden.addAll(camera.getHiddenGeometrics()); - Collection<Space> elements = new LinkedList(); - for (Space current : space.getElements()) { - if (hidden.contains(current)) { - if (!transparent(current)) { - for (Surface surface : current.getEnvelope()) { - Space front = surface.getFrontDomain(); - Space back = surface.getBackDomain(); - if (front == back) { - hidden.add(surface); - } else { - Space other = null; - if (front == current) { - other = back; - } else { - other = front; - } - if (hidden.contains(other) || transparent(other)) { - hidden.add(surface); - } - } - } - } - } else { - elements.add(current); - } - } Collection<Surface> surfaces = new LinkedList(); Collection<Edge> edges = new LinkedList(); --- 313,318 ---- Set<Geometric> hidden = new HashSet(); hidden.addAll(camera.getHiddenGeometrics()); + Collection<Space> elements = new LinkedList(); Collection<Surface> surfaces = new LinkedList(); Collection<Edge> edges = new LinkedList(); *************** *** 321,371 **** Collection<Vertex> loners = new LinkedList(); { ! Set<Edge> mark = new HashSet(); ! Set<Edge> visible = new HashSet(); ! for (Surface current : space.getSurfaces()) { ! mark.addAll(current.getEdges()); if (!hidden.contains(current)) { if (!transparent(current)) { surfaces.add(current); - visible.addAll(current.getEdges()); - for (Surface hole : current.getHoles()) { - visible.addAll(hole.getEdges()); - } } } } ! for (Edge current : space.getEdges()) { ! if (mark.contains(current)) { ! if (visible.contains(current)) { ! edges.add(current); ! } ! } else { edges.add(current); } } } - { ! Set<Vertex> connected = new HashSet(); ! Set<Vertex> mark = new HashSet(); ! for (Edge current : space.getEdges()) { ! connected.add(current.getFrom()); ! connected.add(current.getTo()); ! } for (Edge current : edges) { ! mark.add(current.getFrom()); ! mark.add(current.getTo()); } ! for (Vertex current : space.getVertices()) { ! if (!connected.contains(current)) { ! loners.add(current); ! vertices.add(current); ! } else if (mark.contains(current)) { vertices.add(current); } } } ! gl.glEnable(GL.GL_DEPTH_TEST); --- 320,371 ---- Collection<Vertex> loners = new LinkedList(); + + + for (Space current : space.getElements()) { + if (!hidden.contains(current)) { + elements.add(current); + } + } { ! Set<Surface> visible = new HashSet(); ! for (Space current : elements) { ! visible.addAll(current.getEnvelope()); ! } ! for (Surface current : visible) { if (!hidden.contains(current)) { if (!transparent(current)) { surfaces.add(current); } } } ! } ! { ! Set<Edge> visible = new HashSet(); ! for (Surface current : surfaces) { ! visible.addAll(current.getEdges()); ! for (Surface hole : current.getHoles()) { ! visible.addAll(hole.getEdges()); ! } ! } ! for (Edge current : visible) { ! if (!hidden.contains(current)) { edges.add(current); } } } { ! Set<Vertex> visible = new HashSet(); for (Edge current : edges) { ! visible.add(current.getFrom()); ! visible.add(current.getTo()); } ! for (Vertex current : visible) { ! if (!hidden.contains(current)) { vertices.add(current); } } } ! ! gl.glEnable(GL.GL_DEPTH_TEST); |
From: Michael L. <he...@us...> - 2007-09-24 14:40:32
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28996/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: Work on active space in new display model Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Display.java 24 Sep 2007 14:20:07 -0000 1.7 --- Display.java 24 Sep 2007 14:40:34 -0000 1.8 *************** *** 47,50 **** --- 47,51 ---- private static float[] white = new float[] {1.0f, 1.0f, 1.0f}; private static float[] black = new float[] {0.0f, 0.0f, 0.0f}; + private static float[] grey = new float[] {0.8f, 0.8f, 0.8f}; private static float[] blueish = new float[] {0.1f, 0.2f, 0.5f}; private static float[] redish = new float[] {0.5f, 0.2f, 0.1f}; *************** *** 210,215 **** } ! private static void drawEdges(Collection<Edge> edges) { ! gl.glColor3fv(black, 0); gl.glLineWidth(1.0f); for (Edge current : edges) { --- 211,220 ---- } ! private static void drawEdges(Collection<Edge> edges, boolean active) { ! if (active) { ! gl.glColor3fv(black, 0); ! } else { ! gl.glColor3fv(grey, 0); ! } gl.glLineWidth(1.0f); for (Edge current : edges) { *************** *** 275,281 **** } ! private static void draw(Space space) { Project project = Project.getInstance(); Camera camera = project.getCurrentCamera(); Set<Geometric> hidden = new HashSet(); hidden.addAll(camera.getHiddenGeometrics()); --- 280,290 ---- } ! private static void draw(Space space, boolean active) { Project project = Project.getInstance(); Camera camera = project.getCurrentCamera(); + if (!active) { + active = project.getActiveSpace() == space; + } + Set<Geometric> hidden = new HashSet(); hidden.addAll(camera.getHiddenGeometrics()); *************** *** 362,370 **** if (selecting()) { ! selectSurfaces(surfaces); selectEdges(edges); } else { ! drawSurfaces(surfaces); ! drawEdges(edges); } --- 371,383 ---- if (selecting()) { ! if (active) { ! selectSurfaces(surfaces); ! } selectEdges(edges); } else { ! if (active) { ! drawSurfaces(surfaces); ! } ! drawEdges(edges, active); } *************** *** 378,382 **** for (Space current : elements) { ! draw(current); } } --- 391,395 ---- for (Space current : elements) { ! draw(current, active); } } *************** *** 426,430 **** initialize(); Space world = Project.getInstance().world(); ! draw(world); if (!selecting()) { --- 439,443 ---- initialize(); Space world = Project.getInstance().world(); ! draw(world, false); if (!selecting()) { |
From: Michael L. <he...@us...> - 2007-09-24 14:20:09
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20884/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: refactored new display code Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Display.java 24 Sep 2007 13:02:18 -0000 1.6 --- Display.java 24 Sep 2007 14:20:07 -0000 1.7 *************** *** 234,237 **** --- 234,256 ---- } + private static void drawVertices(Collection<Vertex> vertices) { + gl.glColor3fv(black, 0); + gl.glPointSize(9.0f); + for (Vertex current : vertices) { + if (current != target) { + draw(current); + } + } + } + + private static void selectVertices(Collection<Vertex> vertices) { + gl.glPointSize(9.0f); + for (Vertex current : vertices) { + push(current); + draw(current); + pop(); + } + } + private static void draw(Vertex vertex) { gl.glBegin(GL.GL_POINTS); *************** *** 341,386 **** gl.glEnable(GL.GL_DEPTH_TEST); if (selecting()) { selectSurfaces(surfaces); } else { drawSurfaces(surfaces); ! gl.glEnable(GL.GL_POLYGON_STIPPLE); ! gl.glPolygonStipple(highlight, 0); ! gl.glColor3fv(redish, 0); ! for (Geometric current : Selection.primary()) { ! if (current != target) { ! if (current.getOwner() == space) { ! if (current instanceof Surface) { ! draw((Surface) current, false); ! } ! } ! } ! } ! if (target instanceof Surface) { ! draw((Surface) target, false); ! } ! gl.glDisable(GL.GL_POLYGON_STIPPLE); } if (selecting()) { ! selectEdges(edges); } else { ! gl.glColor3fv(redish, 0); ! gl.glLineWidth(3.0f); ! for (Geometric current : Selection.primary()) { ! if (current != target) { ! if (current.getOwner() == space) { ! if (current instanceof Edge) { ! draw((Edge) current); ! } ! } ! } ! } ! if (target instanceof Edge) { ! if (target.getOwner() == space) { ! draw((Edge) target); ! } ! } ! drawEdges(edges); } --- 360,378 ---- gl.glEnable(GL.GL_DEPTH_TEST); + if (selecting()) { selectSurfaces(surfaces); + selectEdges(edges); } else { drawSurfaces(surfaces); ! drawEdges(edges); } + gl.glDisable(GL.GL_DEPTH_TEST); + if (selecting()) { ! selectVertices(vertices); } else { ! drawVertices(loners); } *************** *** 388,427 **** draw(current); } gl.glDisable(GL.GL_DEPTH_TEST); ! if (!selecting()) { ! if (target instanceof Vertex) { ! if (target.getOwner() == space) { gl.glColor3fv(redish, 0); gl.glPointSize(9.0f); - draw((Vertex) target); } else { gl.glColor3fv(blueish, 0); gl.glPointSize(6.0f); - draw((Vertex) target); - } - } - gl.glColor3fv(black, 0); - gl.glPointSize(9.0f); - for (Vertex current : loners) { - if (current != target) { - draw(current); - } - } - gl.glColor3fv(redish, 0); - for (Geometric current : Selection.primary()) { - if (current != target) { - if (current instanceof Vertex) { - if (current.getOwner() == space) { - draw((Vertex) current); - } - } } ! } ! } else { ! gl.glPointSize(9.0f); ! for (Vertex current : vertices) { ! push(current); ! draw(current); ! pop(); } } --- 380,417 ---- draw(current); } + } + + private static void hilite(Collection<Geometric> geometrics) { + gl.glEnable(GL.GL_DEPTH_TEST); + gl.glColor3fv(redish, 0); + gl.glLineWidth(3.0f); + gl.glEnable(GL.GL_POLYGON_STIPPLE); + gl.glPolygonStipple(highlight, 0); + + for (Geometric current : geometrics) { + if (current instanceof Edge) { + draw((Edge) current); + } + } + + for (Geometric current : geometrics) { + if (current instanceof Surface) { + draw((Surface) current, false); + } + } + + gl.glDisable(GL.GL_POLYGON_STIPPLE); gl.glDisable(GL.GL_DEPTH_TEST); ! ! for (Geometric current : geometrics) { ! if (current instanceof Vertex) { ! if (current.getOwner() != null) { gl.glColor3fv(redish, 0); gl.glPointSize(9.0f); } else { gl.glColor3fv(blueish, 0); gl.glPointSize(6.0f); } ! draw((Vertex) current); } } *************** *** 437,440 **** --- 427,439 ---- Space world = Project.getInstance().world(); draw(world); + + if (!selecting()) { + Collection<Geometric> geometrics = new HashSet(); + geometrics.addAll(Selection.primary()); + if (target != null) { + geometrics.add(target); + } + hilite(geometrics); + } } } |
From: Michael L. <he...@us...> - 2007-09-24 13:02:16
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22745/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java Log Message: SelectTool does not mark target Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Display.java 24 Sep 2007 08:50:21 -0000 1.5 --- Display.java 24 Sep 2007 13:02:18 -0000 1.6 *************** *** 234,237 **** --- 234,243 ---- } + private static void draw(Vertex vertex) { + gl.glBegin(GL.GL_POINTS); + gl.glVertex3d(vertex.getX(), vertex.getY(), vertex.getZ()); + gl.glEnd(); + } + private static boolean transparent(Space space) { return (space.isFunctionalSpace() || space.isTransparent() || !space.getSurfaces().isEmpty()); *************** *** 283,310 **** Collection<Surface> surfaces = new LinkedList(); ! Set<Edge> mark = new HashSet(); ! Set<Edge> visible = new HashSet(); ! for (Surface current : space.getSurfaces()) { ! mark.addAll(current.getEdges()); ! if (!hidden.contains(current)) { ! if (!transparent(current)) { ! surfaces.add(current); ! visible.addAll(current.getEdges()); ! for (Surface hole : current.getHoles()) { ! visible.addAll(hole.getEdges()); } } } } ! Collection<Edge> edges = new LinkedList(); ! for (Edge current : space.getEdges()) { ! if (mark.contains(current)) { ! if (visible.contains(current)) { ! edges.add(current); } - } else { - edges.add(current); } } --- 289,340 ---- Collection<Surface> surfaces = new LinkedList(); + Collection<Edge> edges = new LinkedList(); + Collection<Vertex> vertices = new LinkedList(); + Collection<Vertex> loners = new LinkedList(); ! { ! Set<Edge> mark = new HashSet(); ! Set<Edge> visible = new HashSet(); ! for (Surface current : space.getSurfaces()) { ! mark.addAll(current.getEdges()); ! if (!hidden.contains(current)) { ! if (!transparent(current)) { ! surfaces.add(current); ! visible.addAll(current.getEdges()); ! for (Surface hole : current.getHoles()) { ! visible.addAll(hole.getEdges()); ! } } } } + for (Edge current : space.getEdges()) { + if (mark.contains(current)) { + if (visible.contains(current)) { + edges.add(current); + } + } else { + edges.add(current); + } + } } ! { ! Set<Vertex> connected = new HashSet(); ! Set<Vertex> mark = new HashSet(); ! for (Edge current : space.getEdges()) { ! connected.add(current.getFrom()); ! connected.add(current.getTo()); ! } ! for (Edge current : edges) { ! mark.add(current.getFrom()); ! mark.add(current.getTo()); ! } ! for (Vertex current : space.getVertices()) { ! if (!connected.contains(current)) { ! loners.add(current); ! vertices.add(current); ! } else if (mark.contains(current)) { ! vertices.add(current); } } } *************** *** 358,361 **** --- 388,429 ---- draw(current); } + gl.glDisable(GL.GL_DEPTH_TEST); + if (!selecting()) { + if (target instanceof Vertex) { + if (target.getOwner() == space) { + gl.glColor3fv(redish, 0); + gl.glPointSize(9.0f); + draw((Vertex) target); + } else { + gl.glColor3fv(blueish, 0); + gl.glPointSize(6.0f); + draw((Vertex) target); + } + } + gl.glColor3fv(black, 0); + gl.glPointSize(9.0f); + for (Vertex current : loners) { + if (current != target) { + draw(current); + } + } + gl.glColor3fv(redish, 0); + for (Geometric current : Selection.primary()) { + if (current != target) { + if (current instanceof Vertex) { + if (current.getOwner() == space) { + draw((Vertex) current); + } + } + } + } + } else { + gl.glPointSize(9.0f); + for (Vertex current : vertices) { + push(current); + draw(current); + pop(); + } + } } *************** *** 368,372 **** initialize(); Space world = Project.getInstance().world(); - draw(world); } --- 436,439 ---- Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.234 retrieving revision 1.235 diff -C2 -d -r1.234 -r1.235 *** View.java 24 Sep 2007 08:50:21 -0000 1.234 --- View.java 24 Sep 2007 13:02:18 -0000 1.235 *************** *** 673,680 **** if (picking > 0) { ! selectBuffer = BufferUtil.newIntBuffer(selectionLength); ! gl.glSelectBuffer(selectionLength, selectBuffer); ! gl.glRenderMode(GL.GL_SELECT); ! hitdetection = true; } --- 673,685 ---- if (picking > 0) { ! try { ! selectBuffer = BufferUtil.newIntBuffer(selectionLength); ! gl.glSelectBuffer(selectionLength, selectBuffer); ! gl.glRenderMode(GL.GL_SELECT); ! hitdetection = true; ! } catch (Exception error) { ! System.out.println("error " + error); ! throw new Error(); ! } } *************** *** 692,696 **** initNames(gl); Display.objects(objectTable); ! Display.target((Geometric) target); Display.draw(gld); Display.selecting(false); --- 697,705 ---- initNames(gl); Display.objects(objectTable); ! if (target instanceof Geometric) { ! Display.target((Geometric) target); ! } else { ! Display.target(null); ! } Display.draw(gld); Display.selecting(false); *************** *** 757,764 **** hits = gl.glRenderMode(GL.GL_RENDER); if (hits < 0) { // There were overflow in the selctionBuffer double the buffer and try again selectionLength *= 2; picking = 10; ! glv.repaint(true); } if (log.isDebugEnabled()) { --- 766,774 ---- hits = gl.glRenderMode(GL.GL_RENDER); if (hits < 0) { + System.out.println("overflow in selection buffer!"); // There were overflow in the selctionBuffer double the buffer and try again selectionLength *= 2; picking = 10; ! //glv.repaint(true); } if (log.isDebugEnabled()) { *************** *** 769,776 **** } } catch (Exception e) { ! log.error(e); //Maybe try to reset the gl setting //Project.getInstance().resetCam(); ! Project.getInstance().changed(Project.getInstance().getCurrentCamera()); } } --- 779,788 ---- } } catch (Exception e) { ! e.printStackTrace(); ! throw new Error(); ! //log.error(e); //Maybe try to reset the gl setting //Project.getInstance().resetCam(); ! //Project.getInstance().changed(Project.getInstance().getCurrentCamera()); } } |
From: Michael L. <he...@us...> - 2007-09-24 13:02:16
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22745/src/net/sourceforge/bprocessor/gl/tool Modified Files: FocusTool.java AbstractTool.java SelectStrategy.java SelectTool.java Log Message: SelectTool does not mark target Index: SelectStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectStrategy.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** SelectStrategy.java 3 Sep 2007 11:31:34 -0000 1.18 --- SelectStrategy.java 24 Sep 2007 13:02:17 -0000 1.19 *************** *** 96,101 **** */ public void moved(MouseEvent e) { ! target = glv.getView().getObjectAtPoint(e.getX(), e.getY(), View.OBJECTS); ! glv.getView().makeTarget(target); } --- 96,101 ---- */ public void moved(MouseEvent e) { ! // target = glv.getView().getObjectAtPoint(e.getX(), e.getY(), View.OBJECTS); ! // glv.getView().makeTarget(target); } *************** *** 112,115 **** --- 112,116 ---- x = e.getX(); y = e.getY(); + target = glv.getView().getObjectAtPoint(e.getX(), e.getY(), View.OBJECTS); if (target == null || target instanceof Geometric) { activated = true; Index: FocusTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FocusTool.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FocusTool.java 20 Jun 2007 13:17:55 -0000 1.3 --- FocusTool.java 24 Sep 2007 13:02:17 -0000 1.4 *************** *** 38,41 **** --- 38,42 ---- glv.getView().makeTarget(target); } else { + glv.getView().makeTarget(null); target = null; } *************** *** 63,67 **** if (target instanceof Surface) { Camera.focusOn(Project.getInstance().getCurrentCamera(), (Surface)target); ! } else { Camera.focusOn(Project.getInstance().getCurrentCamera(), (ClippingPlane)target); } --- 64,68 ---- if (target instanceof Surface) { Camera.focusOn(Project.getInstance().getCurrentCamera(), (Surface)target); ! } else if (target instanceof ClippingPlane) { Camera.focusOn(Project.getInstance().getCurrentCamera(), (ClippingPlane)target); } Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** SelectTool.java 3 Sep 2007 11:31:34 -0000 1.65 --- SelectTool.java 24 Sep 2007 13:02:17 -0000 1.66 *************** *** 35,40 **** protected void moved(MouseEvent e) { select.moved(e); - // findTarget(e); - // glv.getView().makeTarget(target); } --- 35,38 ---- Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.130 retrieving revision 1.131 diff -C2 -d -r1.130 -r1.131 *** AbstractTool.java 7 Sep 2007 13:21:10 -0000 1.130 --- AbstractTool.java 24 Sep 2007 13:02:17 -0000 1.131 *************** *** 306,309 **** --- 306,311 ---- if (e.getKeyCode() == KeyEvent.VK_CONTROL) { setActiveStrategy(AbstractTool.select); + glv.getView().makeTarget(null); + glv.repaint(); return; } |
From: Michael L. <he...@us...> - 2007-09-24 08:50:24
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20025/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java Log Message: Progress on display Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Display.java 23 Sep 2007 19:41:16 -0000 1.4 --- Display.java 24 Sep 2007 08:50:21 -0000 1.5 *************** *** 43,46 **** --- 43,47 ---- private static GLU glu; private static ArrayList objects; + private static Geometric target; private static float[] white = new float[] {1.0f, 1.0f, 1.0f}; *************** *** 122,126 **** /** ! * Set the objects table * @param value ArrayList */ --- 123,127 ---- /** ! * Sets the objects table * @param value ArrayList */ *************** *** 128,131 **** --- 129,139 ---- objects = value; } + /** + * Sets the target + * @param value Geometric + */ + public static void target(Geometric value) { + target = value; + } private static void push(Object object) { *************** *** 148,152 **** gl.glEnable(GL.GL_LIGHTING); gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); ! gl.glPolygonOffset(0.5f, 0.5f); gl.glEnable(GL.GL_CULL_FACE); gl.glCullFace(GL.GL_BACK); --- 156,160 ---- gl.glEnable(GL.GL_LIGHTING); gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); ! gl.glPolygonOffset(1.0f, 1.0f); gl.glEnable(GL.GL_CULL_FACE); gl.glCullFace(GL.GL_BACK); *************** *** 178,189 **** } - private static void highlight(Surface surface) { - gl.glEnable(GL.GL_POLYGON_STIPPLE); - gl.glPolygonStipple(highlight, 0); - gl.glColor3fv(redish, 0); - draw(surface, false); - gl.glDisable(GL.GL_POLYGON_STIPPLE); - } - private static void draw(Surface surface, boolean reverse) { glu.gluTessBeginPolygon(tesselator, null); --- 186,189 ---- *************** *** 319,328 **** gl.glColor3fv(redish, 0); for (Geometric current : Selection.primary()) { ! if (current.getOwner() == space) { ! if (current instanceof Surface) { ! draw((Surface) current, false); } } } gl.glDisable(GL.GL_POLYGON_STIPPLE); } --- 319,333 ---- gl.glColor3fv(redish, 0); for (Geometric current : Selection.primary()) { ! if (current != target) { ! if (current.getOwner() == space) { ! if (current instanceof Surface) { ! draw((Surface) current, false); ! } } } } + if (target instanceof Surface) { + draw((Surface) target, false); + } gl.glDisable(GL.GL_POLYGON_STIPPLE); } *************** *** 332,343 **** } else { gl.glColor3fv(redish, 0); ! gl.glLineWidth(2.0f); for (Geometric current : Selection.primary()) { ! if (current.getOwner() == space) { ! if (current instanceof Edge) { ! draw((Edge) current); } } } drawEdges(edges); } --- 337,355 ---- } else { gl.glColor3fv(redish, 0); ! gl.glLineWidth(3.0f); for (Geometric current : Selection.primary()) { ! if (current != target) { ! if (current.getOwner() == space) { ! if (current instanceof Edge) { ! draw((Edge) current); ! } } } } + if (target instanceof Edge) { + if (target.getOwner() == space) { + draw((Edge) target); + } + } drawEdges(edges); } Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.233 retrieving revision 1.234 diff -C2 -d -r1.233 -r1.234 *** View.java 23 Sep 2007 19:41:16 -0000 1.233 --- View.java 24 Sep 2007 08:50:21 -0000 1.234 *************** *** 692,695 **** --- 692,696 ---- initNames(gl); Display.objects(objectTable); + Display.target((Geometric) target); Display.draw(gld); Display.selecting(false); |
From: Michael L. <he...@us...> - 2007-09-23 19:41:14
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5432/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java Log Message: Progress on new display mechanism Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Display.java 23 Sep 2007 18:20:26 -0000 1.3 --- Display.java 23 Sep 2007 19:41:16 -0000 1.4 *************** *** 8,11 **** --- 8,12 ---- package net.sourceforge.bprocessor.gl.view; + import java.util.ArrayList; import java.util.Collection; import java.util.Collections; *************** *** 27,30 **** --- 28,32 ---- import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; *************** *** 40,43 **** --- 42,46 ---- private static GL gl; private static GLU glu; + private static ArrayList objects; private static float[] white = new float[] {1.0f, 1.0f, 1.0f}; *************** *** 45,48 **** --- 48,54 ---- private static float[] blueish = new float[] {0.1f, 0.2f, 0.5f}; private static float[] redish = new float[] {0.5f, 0.2f, 0.1f}; + + private static byte[] highlight = new byte[128]; + /** * *************** *** 66,69 **** --- 72,93 ---- glu.gluTessCallback(tesselator, GLU.GLU_TESS_VERTEX, callback); glu.gluTessProperty(tesselator, GLU.GLU_TESS_WINDING_RULE, GLU.GLU_TESS_WINDING_ODD); + + byte b1 = (byte) 0x88; + byte b2 = (byte) 0x22; + byte b3 = (byte) 0x00; + for (int i = 0; i < highlight.length; i++) { + int d = ((int)(i / 4)) % 4; + + if (d == 0) { + highlight[i] = b1; + } else if (d == 1) { + highlight[i] = b3; + } else if (d == 2) { + highlight[i] = b2; + } else if (d == 3) { + highlight[i] = b3; + } + } + initialized = true; } *************** *** 97,100 **** --- 121,148 ---- } + /** + * Set the objects table + * @param value ArrayList + */ + public static void objects(ArrayList value) { + objects = value; + } + + private static void push(Object object) { + objects.add(object); + gl.glPushName(objects.size()); + } + private static void pop() { + gl.glPopName(); + } + + private static void selectSurfaces(Collection<Surface> surfaces) { + for (Surface current : surfaces) { + push(current); + draw(current, false); + pop(); + } + } + private static void drawSurfaces(Collection<Surface> surfaces) { gl.glEnable(GL.GL_LIGHTING); *************** *** 130,133 **** --- 178,189 ---- } + private static void highlight(Surface surface) { + gl.glEnable(GL.GL_POLYGON_STIPPLE); + gl.glPolygonStipple(highlight, 0); + gl.glColor3fv(redish, 0); + draw(surface, false); + gl.glDisable(GL.GL_POLYGON_STIPPLE); + } + private static void draw(Surface surface, boolean reverse) { glu.gluTessBeginPolygon(tesselator, null); *************** *** 156,163 **** --- 212,227 ---- private static void drawEdges(Collection<Edge> edges) { gl.glColor3fv(black, 0); + gl.glLineWidth(1.0f); for (Edge current : edges) { draw(current); } } + private static void selectEdges(Collection<Edge> edges) { + for (Edge current : edges) { + push(current); + draw(current); + pop(); + } + } private static void draw(Edge edge) { *************** *** 246,257 **** } - - - - gl.glEnable(GL.GL_DEPTH_TEST); - drawSurfaces(surfaces); - drawEdges(edges); for (Space current : elements) { draw(current); --- 310,346 ---- } + gl.glEnable(GL.GL_DEPTH_TEST); + if (selecting()) { + selectSurfaces(surfaces); + } else { + drawSurfaces(surfaces); + gl.glEnable(GL.GL_POLYGON_STIPPLE); + gl.glPolygonStipple(highlight, 0); + gl.glColor3fv(redish, 0); + for (Geometric current : Selection.primary()) { + if (current.getOwner() == space) { + if (current instanceof Surface) { + draw((Surface) current, false); + } + } + } + gl.glDisable(GL.GL_POLYGON_STIPPLE); + } + if (selecting()) { + selectEdges(edges); + } else { + gl.glColor3fv(redish, 0); + gl.glLineWidth(2.0f); + for (Geometric current : Selection.primary()) { + if (current.getOwner() == space) { + if (current instanceof Edge) { + draw((Edge) current); + } + } + } + drawEdges(edges); + } for (Space current : elements) { draw(current); Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.232 retrieving revision 1.233 diff -C2 -d -r1.232 -r1.233 *** View.java 23 Sep 2007 16:02:08 -0000 1.232 --- View.java 23 Sep 2007 19:41:16 -0000 1.233 *************** *** 691,694 **** --- 691,695 ---- Display.selecting(hitdetection); initNames(gl); + Display.objects(objectTable); Display.draw(gld); Display.selecting(false); |
From: Michael L. <he...@us...> - 2007-09-23 18:20:32
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6068/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: Progress on new display mechanism Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Display.java 23 Sep 2007 16:02:08 -0000 1.2 --- Display.java 23 Sep 2007 18:20:26 -0000 1.3 *************** *** 9,12 **** --- 9,13 ---- import java.util.Collection; + import java.util.Collections; import java.util.HashSet; import java.util.LinkedList; *************** *** 22,25 **** --- 23,27 ---- import net.sourceforge.bprocessor.model.Camera; + import net.sourceforge.bprocessor.model.Defaults; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometric; *************** *** 41,46 **** private static float[] white = new float[] {1.0f, 1.0f, 1.0f}; private static float[] black = new float[] {0.0f, 0.0f, 0.0f}; ! ! /** * --- 43,48 ---- private static float[] white = new float[] {1.0f, 1.0f, 1.0f}; private static float[] black = new float[] {0.0f, 0.0f, 0.0f}; ! private static float[] blueish = new float[] {0.1f, 0.2f, 0.5f}; ! private static float[] redish = new float[] {0.5f, 0.2f, 0.1f}; /** * *************** *** 96,121 **** private static void drawSurfaces(Collection<Surface> surfaces) { ! gl.glColor3fv(white, 0); gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); gl.glPolygonOffset(0.5f, 0.5f); for (Surface current : surfaces) { ! draw(current); } gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); } ! private static void draw(Surface surface) { glu.gluTessBeginPolygon(tesselator, null); ! drawContour(surface); for (Surface current : surface.getHoles()) { ! drawContour(current); } glu.gluTessEndPolygon(tesselator); } ! private static void drawContour(Surface surface) { List<Vertex> vertices = surface.getVertices(); if (vertices.size() > 2) { vertices.add(vertices.get(0)); glu.gluTessBeginContour(tesselator); for (Vertex current : vertices) { --- 98,149 ---- private static void drawSurfaces(Collection<Surface> surfaces) { ! gl.glEnable(GL.GL_LIGHTING); gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); gl.glPolygonOffset(0.5f, 0.5f); + gl.glEnable(GL.GL_CULL_FACE); + 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()); ! if (front.isConstructionSpace()) { ! gl.glColor3fv(Defaults.getFrontColor(), 0); ! } else { ! gl.glColor3fv(Defaults.getBackColor(), 0); ! } ! draw(current, false); ! } ! for (Surface current : surfaces) { ! Space back = current.getBackDomain(); ! Vertex n = current.normal(); ! gl.glNormal3d(-n.getX(), -n.getY(), -n.getZ()); ! if (back.isConstructionSpace()) { ! gl.glColor3fv(Defaults.getFrontColor(), 0); ! } else { ! gl.glColor3fv(Defaults.getBackColor(), 0); ! } ! draw(current, true); } gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); + gl.glDisable(GL.GL_CULL_FACE); + gl.glDisable(GL.GL_LIGHTING); } ! private static void draw(Surface surface, boolean reverse) { glu.gluTessBeginPolygon(tesselator, null); ! drawContour(surface, reverse); for (Surface current : surface.getHoles()) { ! drawContour(current, false); } glu.gluTessEndPolygon(tesselator); } ! private static void drawContour(Surface surface, boolean reverse) { List<Vertex> vertices = surface.getVertices(); if (vertices.size() > 2) { vertices.add(vertices.get(0)); + if (reverse) { + Collections.reverse(vertices); + } glu.gluTessBeginContour(tesselator); for (Vertex current : vertices) { |
From: Michael L. <he...@us...> - 2007-09-23 18:20:27
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6060/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Progress on new display mechanism Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** GenericTreeView.java 21 Sep 2007 12:32:30 -0000 1.111 --- GenericTreeView.java 23 Sep 2007 18:20:22 -0000 1.112 *************** *** 1387,1390 **** --- 1387,1391 ---- camera.addHiddenGeometric(geometric); } + Project.getInstance().changed(Project.getInstance()); } } |