bprocessor-commit Mailing List for B-processor (Page 108)
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: Michael L. <he...@us...> - 2006-08-29 08:26:13
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10639/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Removed surfaces treeview Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** GUI.java 28 Aug 2006 05:54:04 -0000 1.40 --- GUI.java 29 Aug 2006 08:26:04 -0000 1.41 *************** *** 26,30 **** import net.sourceforge.bprocessor.gui.splash.SplashWindow; import net.sourceforge.bprocessor.gui.treeview.SpaceTreeView; - import net.sourceforge.bprocessor.gui.treeview.SurfaceTreeView; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; --- 26,29 ---- *************** *** 392,397 **** tp.setFont(font); tp.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); ! tp.addTab("Spaces", new JScrollPane (new SpaceTreeView())); ! tp.addTab("Surfaces", new JScrollPane (new SurfaceTreeView())); tp.addTab("Views", new CameraView()); tp.setMinimumSize(new Dimension(120, 240)); --- 391,395 ---- tp.setFont(font); tp.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); ! tp.addTab("Project", new JScrollPane (new SpaceTreeView())); tp.addTab("Views", new CameraView()); tp.setMinimumSize(new Dimension(120, 240)); |
From: Michael L. <he...@us...> - 2006-08-29 08:07:22
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3215/src/net/sourceforge/bprocessor/model/modellor Modified Files: LayerModellor.java Log Message: Layer Modellor generates elements Index: LayerModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/LayerModellor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LayerModellor.java 28 Aug 2006 13:50:05 -0000 1.2 --- LayerModellor.java 29 Aug 2006 08:07:13 -0000 1.3 *************** *** 66,73 **** --- 66,78 ---- for (int i = 0; i < 3; i++) { + Space layer = Space.createConstructionSpace("Layer " + (i + 1)); + space.add(layer); + bottom.setFrontDomain(layer); Set sides = new HashSet(); bottom = bottom.extrude(distance, sides); bottom.flip(); + bottom.setBackDomain(layer); } + bottom.setFrontDomain(space.getEmpty()); } |
From: Michael L. <he...@us...> - 2006-08-29 08:07:22
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3215/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Log Message: Layer Modellor generates elements Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Camera.java 28 Aug 2006 06:51:29 -0000 1.20 --- Camera.java 29 Aug 2006 08:07:13 -0000 1.21 *************** *** 79,83 **** this.camera = camera; this.roll = roll; ! this.focalwidth = 65; this.clipplanes = new ArrayList(); if (type == ORTHOGRAPHIC || type == PERSPECTIVE) { --- 79,83 ---- this.camera = camera; this.roll = roll; ! this.focalwidth = 35; this.clipplanes = new ArrayList(); if (type == ORTHOGRAPHIC || type == PERSPECTIVE) { |
From: Michael L. <he...@us...> - 2006-08-29 08:07:19
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2982/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: Layer Modellor generates elements Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** SpaceTool.java 28 Aug 2006 05:53:53 -0000 1.26 --- SpaceTool.java 29 Aug 2006 08:07:07 -0000 1.27 *************** *** 425,434 **** Collection domains = null; String category = null; ! if (surface.getOwner() == Project.getInstance().world()) { domains = Project.getInstance().getSpaces(); category = "Space"; ! } else { ! domains = surface.getOwner().getElements(); category = "Element"; } --- 425,440 ---- Collection domains = null; String category = null; ! Space owner = surface.getOwner(); ! Space world = Project.getInstance().world(); ! ! if (owner == world) { domains = Project.getInstance().getSpaces(); category = "Space"; ! } else if (owner.getOwner() == world) { ! domains = owner.getElements(); category = "Element"; + } else { + domains = owner.getElements(); + category = "Part"; } *************** *** 440,444 **** createFuncItem.addActionListener(funcListener); ! JMenuItem createConstItem = new JMenuItem("New Construction" + category); ActionListener constListener = new CreateSpaceActionListener(surface, side.equals("front"), --- 446,450 ---- createFuncItem.addActionListener(funcListener); ! JMenuItem createConstItem = new JMenuItem("New Construction " + category); ActionListener constListener = new CreateSpaceActionListener(surface, side.equals("front"), |
From: rimestad <rim...@us...> - 2006-08-28 16:44:53
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8585/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: made windmodellor, there are some bugs, will be worked out, there are one bug in offset as well. Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** Edge.java 28 Aug 2006 14:48:25 -0000 1.53 --- Edge.java 28 Aug 2006 16:44:41 -0000 1.54 *************** *** 574,578 **** v2v.put(from, e.getFrom()); res.add(new Edge(to, from)); ! Vertex common = Edge.commonVertex(e, prevEdge); if (common == e.getFrom() || common == null) { from2edge.put(e.getFrom(), e); --- 574,585 ---- v2v.put(from, e.getFrom()); res.add(new Edge(to, from)); ! if (from2edge.containsKey(e.getFrom())) { ! from2edge.put(e.getTo(), e); ! to2edge.put(e.getFrom(), e); ! } else { ! from2edge.put(e.getFrom(), e); ! to2edge.put(e.getTo(), e); ! } ! /*Vertex common = Edge.commonVertex(e, prevEdge); if (common == e.getFrom() || common == null) { from2edge.put(e.getFrom(), e); *************** *** 581,588 **** from2edge.put(e.getTo(), e); to2edge.put(e.getFrom(), e); ! } } else { ! from2edge.put(e.getFrom(), e); ! to2edge.put(e.getTo(), e); } prevEdge = e; --- 588,600 ---- from2edge.put(e.getTo(), e); to2edge.put(e.getFrom(), e); ! }*/ } else { ! if (from2edge.containsKey(e.getFrom())) { ! from2edge.put(e.getTo(), e); ! to2edge.put(e.getFrom(), e); ! } else { ! from2edge.put(e.getFrom(), e); ! to2edge.put(e.getTo(), e); ! } } prevEdge = e; *************** *** 590,593 **** --- 602,608 ---- // calculate the directions iter = directions.values().iterator(); + System.out.println("To size " + to2edge.size()); + System.out.println("From size " + from2edge.size()); + System.out.println("Vertices " + directions.size()); while (iter.hasNext()) { Direction dir = (Direction)iter.next(); |
From: rimestad <rim...@us...> - 2006-08-28 16:44:53
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8585/src/net/sourceforge/bprocessor/model/test Modified Files: EdgeTest.java Log Message: made windmodellor, there are some bugs, will be worked out, there are one bug in offset as well. Index: EdgeTest.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test/EdgeTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EdgeTest.java 28 Aug 2006 14:48:25 -0000 1.1 --- EdgeTest.java 28 Aug 2006 16:44:41 -0000 1.2 *************** *** 221,223 **** --- 221,260 ---- assertEquals(0.0, e.getTo().getZ(), 0.0001); } + + /** + * Test the offset method in edge with backward direction + */ + public void testOffset6() { + Vertex v1 = new Vertex(0, 0, 0); + Vertex v2 = new Vertex(3, 0, 0); + Vertex v3 = new Vertex(3, 3, 0); + Vertex v4 = new Vertex(0, 3, 0); + Edge e1 = new Edge(v1, v2); + Edge e2 = new Edge(v2, v3); + Edge e3 = new Edge(v3, v4); + Edge e4 = new Edge(v4, v1); + ArrayList edges = new ArrayList(); + edges.add(e4); + edges.add(e3); + edges.add(e2); + edges.add(e1); + Surface s = new Surface(edges); + List offset = Edge.offset(edges, s, -1); + Edge e = (Edge)offset.get(0); + assertEquals(2.0, e.getFrom().getX(), 0.0001); + assertEquals(1.0, e.getFrom().getY(), 0.0001); + assertEquals(0.0, e.getFrom().getZ(), 0.0001); + e = (Edge)offset.get(1); + assertEquals(2.0, e.getFrom().getX(), 0.0001); + assertEquals(2.0, e.getFrom().getY(), 0.0001); + assertEquals(0.0, e.getFrom().getZ(), 0.0001); + e = (Edge)offset.get(2); + assertEquals(1.0, e.getFrom().getX(), 0.0001); + assertEquals(2.0, e.getFrom().getY(), 0.0001); + assertEquals(0.0, e.getFrom().getZ(), 0.0001); + e = (Edge)offset.get(3); + assertEquals(1.0, e.getFrom().getX(), 0.0001); + assertEquals(1.0, e.getFrom().getY(), 0.0001); + assertEquals(0.0, e.getFrom().getZ(), 0.0001); + } } |
From: rimestad <rim...@us...> - 2006-08-28 16:44:53
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8613/src/net/sourceforge/bprocessor/facade/modellor Modified Files: WindowModellor.java Log Message: made windmodellor, there are some bugs, will be worked out, there are one bug in offset as well. Index: WindowModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/WindowModellor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WindowModellor.java 22 Aug 2006 14:15:15 -0000 1.2 --- WindowModellor.java 28 Aug 2006 16:44:44 -0000 1.3 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.bprocessor.facade.modellor; + import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; *************** *** 15,18 **** --- 16,20 ---- import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; *************** *** 24,31 **** public class WindowModellor extends Modellor { /** The width of the frame */ ! private double framewidth = 0.1; /** The depth of the frame */ ! private double framedepth = 0.075; /** The offset in the window */ --- 26,33 ---- public class WindowModellor extends Modellor { /** The width of the frame */ ! private double framewidth = 0.054; /** The depth of the frame */ ! private double framedepth = 0.125; /** The offset in the window */ *************** *** 61,64 **** --- 63,67 ---- space = s; surface = sur; + drawWindow(); } *************** *** 67,72 **** */ public void update(Object entity) { ! if (entity == space || entity == surface) { drawWindow(); } } --- 70,78 ---- */ public void update(Object entity) { ! if (entity == surface || entity == this) { ! System.out.println("did a update on the surface"); ! cleanUp(); drawWindow(); + Project.getInstance().checkpoint(); } } *************** *** 74,88 **** /** Draw the window */ public void drawWindow() { Space frame = new Space("Frame", Space.CONSTRUCTION, true); Space glass = new Space("Glass", Space.CONSTRUCTION, true); ! Surface inner = surface.copy(frame); Vertex normal = surface.normal(); normal.scale(-offset); ! inner.move(normal.getX(), normal.getY(), normal.getZ()); ! List offset = Edge.offset(inner.getEdges(), inner, framewidth); ! Surface glasssurface = new Surface(offset); inner.addHole(glasssurface); ! inner.setBackDomain(frame); space.add(frame); } --- 80,114 ---- /** Draw the window */ public void drawWindow() { + if (surface.getBackDomain() == space) { + surface.extrude(-(offset + framewidth), new HashSet()); + } else { + surface.extrude(offset + framewidth, new HashSet()); + } + Space frame = new Space("Frame", Space.CONSTRUCTION, true); Space glass = new Space("Glass", Space.CONSTRUCTION, true); ! glass.setTransparent(true); ! Surface inner = surface.copy(space); ! inner.setFrontDomain(frame); ! //make hole in frame Vertex normal = surface.normal(); normal.scale(-offset); ! inner.move(normal.getX(), normal.getY(), normal.getZ()); ! List holeedges = Edge.offset(inner.getEdges(), inner, -framewidth); ! Iterator iter = holeedges.iterator(); ! space.add(((Edge)holeedges.get(0)).getTo()); ! while (iter.hasNext()) { ! Edge e = (Edge)iter.next(); ! space.add(e.getFrom()); ! space.add(e); ! } ! Surface glasssurface = new Surface(holeedges); inner.addHole(glasssurface); ! space.add(glasssurface); ! glasssurface.setFrontDomain(glass); ! Surface frametop = inner.extrude(framedepth, new HashSet()); ! frametop.addHole(glasssurface.extrude(framedepth, new HashSet())); space.add(frame); + space.add(glass); } *************** *** 93,99 **** if (s.getSurfaces().size() == 1) { Surface sur = (Surface)s.getSurfaces().iterator().next(); ! opposite = sur.extrude(framedepth, new HashSet()); } ! return new WindowModellor(s, (Surface)s.getSurfaces().iterator().next()); } --- 119,159 ---- if (s.getSurfaces().size() == 1) { Surface sur = (Surface)s.getSurfaces().iterator().next(); ! Surface ext = sur.getExterior(); ! double minDist = Double.NaN; ! if (sur != null) { ! Collection tryout = new ArrayList(0); ! if (sur.getFrontDomain() == s) { ! Space front = ext.getFrontDomain(); ! if (front != null) { ! tryout = front.getEnvelope(); ! } ! System.out.println("frontdomain " + ext.getFrontDomain()); ! } else { ! Space back = ext.getBackDomain(); ! if (back != null) { ! tryout = back.getEnvelope(); ! } ! System.out.println("backdomain " + ext.getBackDomain()); ! } ! Iterator iter = tryout.iterator(); ! while (iter.hasNext()) { ! Surface cur = (Surface)iter.next(); ! Vertex center = cur.center(); ! Plane p = cur.plane(); ! Vertex inter = p.intersection(cur.center(), cur.normal(), true); ! System.out.println("Were here and internersection " + inter); ! double dist = center.distance(inter); ! if (inter != null && dist < minDist) { ! minDist = dist; ! System.out.println("Found a surface with dist " + dist); ! } ! } ! } ! if (Double.isNaN(minDist)) { ! minDist = framedepth + offset; ! } ! opposite = sur.extrude(minDist, new HashSet()); } ! return new WindowModellor(s, (Surface)(s.getEnvelope().iterator().next())); } *************** *** 102,105 **** --- 162,173 ---- */ public void delete() { + cleanUp(); + space.setModellor(null); + } + + /** + * Clean up the constructed geometry + */ + private void cleanUp() { Collection added = space.getElements(); Iterator iter = added.iterator(); *************** *** 118,124 **** } } - space.setModellor(null); } ! /** * @see net.sourceforge.bprocessor.model.Parametric#setAttributes(List) --- 186,191 ---- } } } ! /** * @see net.sourceforge.bprocessor.model.Parametric#setAttributes(List) *************** *** 157,161 **** */ public String getName() { ! return "Window-" + id; } --- 224,228 ---- */ public String getName() { ! return "Window"; } |
From: rimestad <rim...@us...> - 2006-08-28 14:48:35
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20236/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: Added offset method to Edge and made tests for it Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** Edge.java 24 Aug 2006 11:51:10 -0000 1.52 --- Edge.java 28 Aug 2006 14:48:25 -0000 1.53 *************** *** 11,14 **** --- 11,15 ---- import java.util.ArrayList; import java.util.Collection; + import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; *************** *** 70,74 **** * Extract all vertices from a collection of edges * @param edges Collection of edges ! * @return Collection of vertices */ public static Collection vertices(Collection edges) { --- 71,75 ---- * Extract all vertices from a collection of edges * @param edges Collection of edges ! * @return Collection of vertices in random order */ public static Collection vertices(Collection edges) { *************** *** 345,348 **** --- 346,357 ---- } + /** + * Give a string that works even if the edge and its vertexes are not in the model + * @return The debug string + */ + public String debugString() { + return "[" + from.toString() + " -> " + to.toString() + "]"; + } + /** * Gets all surfaces this edge is a part of. *************** *** 530,540 **** * Create a offset from a list of lines and a surface * PRECONDITION: all the edges have to be in the given surface ! * @param edges The list of edges * @param inner The surface ! * @param framewidth The offset positive inside and negative outside * @return The generated list of lines */ ! public static List offset(List edges, Surface inner, double framewidth) { ! // TODO Auto-generated method stub return null; } --- 539,663 ---- * Create a offset from a list of lines and a surface * PRECONDITION: all the edges have to be in the given surface ! * @param which The list of edges in inner that are going to be offset * @param inner The surface ! * @param offset The offset negative inside and positive outside * @return The generated list of lines */ ! public static List offset(List which, Surface inner, double offset) { ! HashSet edges = new HashSet(which); ! ArrayList res = new ArrayList(); ! HashMap directions = new HashMap(); ! HashMap to2edge = new HashMap(); ! HashMap from2edge = new HashMap(); ! HashMap v2v = new HashMap(); ! Iterator iter = inner.getEdges().iterator(); ! ! Edge prevEdge = null; ! // Find all the affected vertexes and make the edges ! while (iter.hasNext()) { ! Edge e = (Edge)iter.next(); ! if (edges.contains(e)) { ! Vertex to, from; ! if (!directions.containsKey(e.getFrom())) { ! from = e.getFrom().copy(); ! directions.put(e.getFrom(), new Direction(from, null)); ! } else { ! from = ((Direction)directions.get(e.getFrom())).getVertex(); ! } ! if (!directions.containsKey(e.getTo())) { ! to = e.getTo().copy(); ! directions.put(e.getTo(), new Direction(to, null)); ! } else { ! to = ((Direction)directions.get(e.getTo())).getVertex(); ! } ! v2v.put(to, e.getTo()); ! v2v.put(from, e.getFrom()); ! res.add(new Edge(to, from)); ! Vertex common = Edge.commonVertex(e, prevEdge); ! if (common == e.getFrom() || common == null) { ! from2edge.put(e.getFrom(), e); ! to2edge.put(e.getTo(), e); ! } else { ! from2edge.put(e.getTo(), e); ! to2edge.put(e.getFrom(), e); ! } ! } else { ! from2edge.put(e.getFrom(), e); ! to2edge.put(e.getTo(), e); ! } ! prevEdge = e; ! } ! // calculate the directions ! iter = directions.values().iterator(); ! while (iter.hasNext()) { ! Direction dir = (Direction)iter.next(); ! Vertex work = (Vertex)v2v.get(dir.getVertex()); ! Vertex normal = inner.normal(); ! Edge e1 = (Edge)to2edge.get(work); ! Edge e2 = (Edge)from2edge.get(work); ! if (edges.contains(e1)) { ! if (edges.contains(e2)) { ! // have to follow a split way ! Vertex dir1 = work.minus(e1.otherVertex(work)); ! dir1 = dir1.cross(normal); ! dir1.normalize(); ! Vertex dir2 = e2.otherVertex(work).minus(work); ! dir2 = dir2.cross(normal); ! dir2.normalize(); ! Vertex mainDir = dir1.add(dir2); ! mainDir.scale(1 / mainDir.dot(dir1)); ! dir.setDirection(mainDir); ! } else { ! // have to follow the firstEdge direction ! Vertex dir1 = work.minus(e1.otherVertex(work)); ! dir1 = dir1.cross(normal); ! dir1.normalize(); ! Vertex other = e2.otherVertex(work); ! Vertex dir2 = other.minus(work); ! dir2.normalize(); ! dir2.scale(1 / dir2.dot(dir1)); ! dir.setDirection(dir2); ! } ! } else if (edges.contains(e2)) { ! // have to follow the prevEdge direction ! Vertex dir2 = e2.otherVertex(work).minus(work); ! dir2 = dir2.cross(normal); ! dir2.normalize(); ! Vertex other = e1.otherVertex(work); ! Vertex dir1 = other.minus(work); ! dir1.normalize(); ! dir1.scale(1 / dir1.dot(dir2)); ! dir.setDirection(dir1); ! } ! } ! ! Iterator diriter = directions.values().iterator(); ! while (diriter.hasNext()) { ! Direction cur = (Direction)diriter.next(); ! Vertex dir = cur.getDirection(); ! dir.scale(offset); ! cur.getVertex().move(dir.getX(), dir.getY(), dir.getZ()); ! } ! ! return res; ! } ! ! /** ! * Find the common edge of the two given edges, if ther is one ! * otherwise it just return null ! * @param e1 The first edge ! * @param e2 The second edge ! * @return The common vertex or null if none ! */ ! private static Vertex commonVertex(Edge e1, Edge e2) { ! if (e1 == null || e2 == null) { ! return null; ! } ! if (e2.contains(e1.getFrom())) { ! return e1.getFrom(); ! } ! if (e2.contains(e1.getTo())) { ! return e1.getTo(); ! } return null; } |
From: rimestad <rim...@us...> - 2006-08-28 14:48:34
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20236/src/net/sourceforge/bprocessor/model/test Modified Files: AllTests.java Added Files: EdgeTest.java Log Message: Added offset method to Edge and made tests for it --- NEW FILE: EdgeTest.java --- //--------------------------------------------------------------------------------- // $Id: EdgeTest.java,v 1.1 2006/08/28 14:48:25 rimestad 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.test; import java.util.ArrayList; import java.util.List; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; import junit.framework.TestCase; /** * A test class for Edge */ public class EdgeTest extends TestCase { /** * Test the offset method in edge */ public void testOffset1() { Vertex v1 = new Vertex(0, 0, 0); Vertex v2 = new Vertex(3, 0, 0); Vertex v3 = new Vertex(3, 3, 0); Vertex v4 = new Vertex(0, 3, 0); Edge e1 = new Edge(v1, v2); Edge e2 = new Edge(v2, v3); Edge e3 = new Edge(v3, v4); Edge e4 = new Edge(v4, v1); ArrayList edges = new ArrayList(); edges.add(e1); edges.add(e2); edges.add(e3); edges.add(e4); Surface s = new Surface(edges); List offset = Edge.offset(edges, s, -1); Edge e = (Edge)offset.get(0); assertEquals(2.0, e.getFrom().getX(), 0.0001); assertEquals(1.0, e.getFrom().getY(), 0.0001); assertEquals(0.0, e.getFrom().getZ(), 0.0001); e = (Edge)offset.get(1); assertEquals(2.0, e.getFrom().getX(), 0.0001); assertEquals(2.0, e.getFrom().getY(), 0.0001); assertEquals(0.0, e.getFrom().getZ(), 0.0001); e = (Edge)offset.get(2); assertEquals(1.0, e.getFrom().getX(), 0.0001); assertEquals(2.0, e.getFrom().getY(), 0.0001); assertEquals(0.0, e.getFrom().getZ(), 0.0001); e = (Edge)offset.get(3); assertEquals(1.0, e.getFrom().getX(), 0.0001); assertEquals(1.0, e.getFrom().getY(), 0.0001); assertEquals(0.0, e.getFrom().getZ(), 0.0001); } /** * Test the offset method in edge with from to mixed up */ public void testOffset2() { Vertex v1 = new Vertex(0, 0, 0); Vertex v2 = new Vertex(3, 0, 0); Vertex v3 = new Vertex(3, 3, 0); Vertex v4 = new Vertex(0, 3, 0); Edge e1 = new Edge(v1, v2); Edge e2 = new Edge(v3, v2); Edge e3 = new Edge(v3, v4); Edge e4 = new Edge(v1, v4); ArrayList edges = new ArrayList(); edges.add(e1); edges.add(e2); edges.add(e3); edges.add(e4); Surface s = new Surface(edges); List offset = Edge.offset(edges, s, -1); Edge e = (Edge)offset.get(0); assertEquals(2.0, e.getFrom().getX(), 0.0001); assertEquals(1.0, e.getFrom().getY(), 0.0001); assertEquals(0.0, e.getFrom().getZ(), 0.0001); e = (Edge)offset.get(1); assertEquals(2.0, e.getTo().getX(), 0.0001); assertEquals(2.0, e.getTo().getY(), 0.0001); assertEquals(0.0, e.getTo().getZ(), 0.0001); e = (Edge)offset.get(2); assertEquals(1.0, e.getFrom().getX(), 0.0001); assertEquals(2.0, e.getFrom().getY(), 0.0001); assertEquals(0.0, e.getFrom().getZ(), 0.0001); e = (Edge)offset.get(3); assertEquals(1.0, e.getTo().getX(), 0.0001); assertEquals(1.0, e.getTo().getY(), 0.0001); assertEquals(0.0, e.getTo().getZ(), 0.0001); } /** * Test offset with different offsets */ public void testOffset3() { Vertex v1 = new Vertex(0, 0, 0); Vertex v2 = new Vertex(3, 0, 0); Vertex v3 = new Vertex(3, 3, 0); Vertex v4 = new Vertex(0, 3, 0); Edge e1 = new Edge(v1, v2); Edge e2 = new Edge(v2, v3); Edge e3 = new Edge(v3, v4); Edge e4 = new Edge(v4, v1); ArrayList edges = new ArrayList(); edges.add(e1); edges.add(e2); edges.add(e3); edges.add(e4); Surface s = new Surface(edges); // offset 3 List offset = Edge.offset(edges, s, 3); Edge e = (Edge)offset.get(0); assertEquals(6.0, e.getFrom().getX(), 0.0001); assertEquals(-3.0, e.getFrom().getY(), 0.0001); assertEquals(0.0, e.getFrom().getZ(), 0.0001); e = (Edge)offset.get(2); assertEquals(-3.0, e.getFrom().getX(), 0.0001); assertEquals(6.0, e.getFrom().getY(), 0.0001); assertEquals(0.0, e.getFrom().getZ(), 0.0001); // offset 6 offset = Edge.offset(edges, s, 6); e = (Edge)offset.get(1); assertEquals(9.0, e.getFrom().getX(), 0.0001); assertEquals(9.0, e.getFrom().getY(), 0.0001); assertEquals(0.0, e.getFrom().getZ(), 0.0001); e = (Edge)offset.get(3); assertEquals(-6.0, e.getFrom().getX(), 0.0001); assertEquals(-6.0, e.getFrom().getY(), 0.0001); assertEquals(0.0, e.getFrom().getZ(), 0.0001); } /** * Test offset with onle some edges */ public void testOffset4() { Vertex v1 = new Vertex(0, 0, 0); Vertex v2 = new Vertex(3, 0, 0); Vertex v3 = new Vertex(3, 3, 0); Vertex v4 = new Vertex(0, 3, 0); Edge e1 = new Edge(v1, v2); Edge e2 = new Edge(v2, v3); Edge e3 = new Edge(v3, v4); Edge e4 = new Edge(v4, v1); ArrayList edges = new ArrayList(); edges.add(e1); edges.add(e2); edges.add(e3); edges.add(e4); Surface s = new Surface(edges); // offset with first and third edge List which = new ArrayList(); which.add(e1); which.add(e3); List offset = Edge.offset(which, s, -1); Edge e = (Edge)offset.get(1); assertEquals(0.0, e.getFrom().getX(), 0.0001); assertEquals(2.0, e.getFrom().getY(), 0.0001); assertEquals(0.0, e.getFrom().getZ(), 0.0001); assertEquals(3.0, e.getTo().getX(), 0.0001); assertEquals(2.0, e.getTo().getY(), 0.0001); assertEquals(0.0, e.getTo().getZ(), 0.0001); e = (Edge)offset.get(0); assertEquals(3.0, e.getFrom().getX(), 0.0001); assertEquals(1.0, e.getFrom().getY(), 0.0001); assertEquals(0.0, e.getFrom().getZ(), 0.0001); assertEquals(0.0, e.getTo().getX(), 0.0001); assertEquals(1.0, e.getTo().getY(), 0.0001); assertEquals(0.0, e.getTo().getZ(), 0.0001); } /** * Test offset with onle some edges advanced */ public void testOffset5() { Vertex v1 = new Vertex(0, 0, 0); Vertex v2 = new Vertex(3, 0, 0); Vertex v3 = new Vertex(4, 1, 0); Vertex v4 = new Vertex(4, 2, 0); Vertex v5 = new Vertex(3, 3, 0); Vertex v6 = new Vertex(0, 3, 0); Vertex v7 = new Vertex(-1, 2, 0); Vertex v8 = new Vertex(-1, 1, 0); Edge e1 = new Edge(v1, v2); Edge e2 = new Edge(v2, v3); Edge e3 = new Edge(v3, v4); Edge e4 = new Edge(v4, v5); Edge e5 = new Edge(v5, v6); Edge e6 = new Edge(v6, v7); Edge e7 = new Edge(v7, v8); Edge e8 = new Edge(v8, v1); ArrayList edges = new ArrayList(); edges.add(e1); edges.add(e2); edges.add(e3); edges.add(e4); edges.add(e5); edges.add(e6); edges.add(e7); edges.add(e8); Surface s = new Surface(edges); // offset with first and third edge List which = new ArrayList(); which.add(e1); which.add(e5); List offset = Edge.offset(which, s, -1); Edge e = (Edge)offset.get(1); assertEquals(-1.0, e.getFrom().getX(), 0.0001); assertEquals(2.0, e.getFrom().getY(), 0.0001); assertEquals(0.0, e.getFrom().getZ(), 0.0001); assertEquals(4.0, e.getTo().getX(), 0.0001); assertEquals(2.0, e.getTo().getY(), 0.0001); assertEquals(0.0, e.getTo().getZ(), 0.0001); e = (Edge)offset.get(0); assertEquals(4.0, e.getFrom().getX(), 0.0001); assertEquals(1.0, e.getFrom().getY(), 0.0001); assertEquals(0.0, e.getFrom().getZ(), 0.0001); assertEquals(-1.0, e.getTo().getX(), 0.0001); assertEquals(1.0, e.getTo().getY(), 0.0001); assertEquals(0.0, e.getTo().getZ(), 0.0001); } } Index: AllTests.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test/AllTests.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AllTests.java 12 Jul 2006 12:19:49 -0000 1.2 --- AllTests.java 28 Aug 2006 14:48:25 -0000 1.3 *************** *** 23,26 **** --- 23,27 ---- //$JUnit-BEGIN$ suite.addTestSuite(LineTest.class); + suite.addTestSuite(EdgeTest.class); //$JUnit-END$ return suite; |
From: Michael L. <he...@us...> - 2006-08-28 13:50:10
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26528/src/net/sourceforge/bprocessor/model/modellor Modified Files: LayerModellor.java Log Message: Small changes Index: LayerModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/LayerModellor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LayerModellor.java 10 Aug 2006 13:13:26 -0000 1.1 --- LayerModellor.java 28 Aug 2006 13:50:05 -0000 1.2 *************** *** 122,132 **** public List getAttributes() { LinkedList attributes = new LinkedList(); - attributes.add(new Attribute("Name", "Layer 1")); - attributes.add(new Attribute("Classification", "?")); - attributes.add(new Attribute("Specification", "?")); attributes.add(new Attribute("Surface", surface.getName())); attributes.add(new Attribute("Thickness", new Double(distance))); - attributes.add(new Attribute("Top Offset", new Double(0))); - attributes.add(new Attribute("Bottom Offset", new Double(0))); return attributes; } --- 122,127 ---- |
From: Michael L. <he...@us...> - 2006-08-28 08:20:55
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4804/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: More context for element-modelling Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.144 retrieving revision 1.145 diff -C2 -d -r1.144 -r1.145 *** View.java 28 Aug 2006 07:27:15 -0000 1.144 --- View.java 28 Aug 2006 08:20:52 -0000 1.145 *************** *** 794,797 **** --- 794,837 ---- /** + * @param active Space + * @return Supporting edges + */ + public Collection collectSupportingEdges(Space active) { + if (active == Project.getInstance().world()) { + return new LinkedList(); + } else { + Space empty = active.getOwner().getEmpty(); + Collection envelope = active.getEnvelope(); + Set spaces = new HashSet(); + { + Iterator iter = envelope.iterator(); + while (iter.hasNext()) { + Surface current = (Surface) iter.next(); + Space other; + if (current.getFrontDomain() == active) { + other = current.getBackDomain(); + } else { + other = current.getFrontDomain(); + } + if (other != empty) { + spaces.add(other); + } + } + } + Set surfaces = new HashSet(); + surfaces.addAll(envelope); + { + Iterator iter = spaces.iterator(); + while (iter.hasNext()) { + Space current = (Space) iter.next(); + surfaces.addAll(current.getEnvelope()); + } + } + Collection edges = Surface.edges(surfaces); + return edges; + } + } + + /** * Draw the model normally * @param gld The GLDrawable *************** *** 1039,1047 **** private void drawEdges(GLDrawable gld) { drawGeneralEdges(gld, tempEdges); - Space active = Project.getInstance().getActiveSpace(); if (active != Project.getInstance().world()) { ! Collection envelope = active.getEnvelope(); ! Collection edges = Surface.edges(envelope); drawConstructionEdges(gld, edges); } --- 1079,1085 ---- private void drawEdges(GLDrawable gld) { drawGeneralEdges(gld, tempEdges); Space active = Project.getInstance().getActiveSpace(); if (active != Project.getInstance().world()) { ! Collection edges = collectSupportingEdges(active); drawConstructionEdges(gld, edges); } *************** *** 1781,1786 **** if (selectionMode != OBJECTS) { ! Collection envelope = space.getEnvelope(); ! Collection envelopeEdges = Surface.edges(envelope); edges.addAll(envelopeEdges); Collection envelopeVertices = Edge.vertices(envelopeEdges); --- 1819,1823 ---- if (selectionMode != OBJECTS) { ! Collection envelopeEdges = collectSupportingEdges(space); edges.addAll(envelopeEdges); Collection envelopeVertices = Edge.vertices(envelopeEdges); |
From: Michael L. <he...@us...> - 2006-08-28 07:27:29
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11814/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Made it possible to use surrounding edges when extruding in element-model Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.143 retrieving revision 1.144 diff -C2 -d -r1.143 -r1.144 *** View.java 28 Aug 2006 05:53:53 -0000 1.143 --- View.java 28 Aug 2006 07:27:15 -0000 1.144 *************** *** 78,81 **** --- 78,85 ---- public static final int HANDLES = 3; + /** SUPPORT flag */ + public static final int SUPPORT = 4; + + /** IGNORE */ public static final boolean IGNORE = true; *************** *** 1784,1787 **** --- 1788,1794 ---- } + if (selectionMode == SUPPORT) { + selectionMode = OBJECTS; + } gl = gld.getGL(); |
From: Michael L. <he...@us...> - 2006-08-28 07:27:20
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11814/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java Log Message: Made it possible to use surrounding edges when extruding in element-model Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** AbstractTool.java 28 Aug 2006 05:53:53 -0000 1.93 --- AbstractTool.java 28 Aug 2006 07:27:15 -0000 1.94 *************** *** 544,548 **** int y = event.getY(); View view = glv.getView(); ! target = view.getObjectAtPoint(x, y, ignore, View.OBJECTS, new Plane(0, 0, 1, 0)); } --- 544,548 ---- int y = event.getY(); View view = glv.getView(); ! target = view.getObjectAtPoint(x, y, ignore, View.SUPPORT, new Plane(0, 0, 1, 0)); } |
From: Michael L. <he...@us...> - 2006-08-28 06:51:34
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27332/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Selection.java Log Message: "View entire model" looks at selection and active space Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Camera.java 13 Jul 2006 13:31:26 -0000 1.19 --- Camera.java 28 Aug 2006 06:51:29 -0000 1.20 *************** *** 400,404 **** */ public void viewEntireModel(double aspect) { ! Set allVertices = Project.getInstance().world().collect(); if (!allVertices.isEmpty()) { //Computing center and radius of the minimal bounding sphere --- 400,412 ---- */ public void viewEntireModel(double aspect) { ! Set allVertices; ! ! if (Selection.primary().isEmpty()) { ! Space space = Project.getInstance().getActiveSpace(); ! allVertices = space.collect(); ! } else { ! allVertices = Selection.primary().collect(); ! } ! if (!allVertices.isEmpty()) { //Computing center and radius of the minimal bounding sphere Index: Selection.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Selection.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Selection.java 28 Aug 2006 05:53:58 -0000 1.13 --- Selection.java 28 Aug 2006 06:51:29 -0000 1.14 *************** *** 269,272 **** --- 269,286 ---- /** + * + * @return Collection of Vertex + */ + public Set collect() { + Set vertices = new HashSet(); + Iterator iter = iterator(); + while (iter.hasNext()) { + Geometric current = (Geometric) iter.next(); + vertices.addAll(current.collect()); + } + return vertices; + } + + /** * @return String */ |
From: Michael L. <he...@us...> - 2006-08-28 06:51:28
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27315/src/net/sourceforge/bprocessor/gl/tool Modified Files: ToolFactory.java Log Message: "View entire model" looks at selection and active space Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** ToolFactory.java 14 Aug 2006 08:37:56 -0000 1.58 --- ToolFactory.java 28 Aug 2006 06:51:25 -0000 1.59 *************** *** 246,251 **** Action zoomAction = new ToolAction(glv, 0, "Biconzomeall.gif") { public void actionPerformed(ActionEvent agr0) { ! double apsect = glv.getView().getAspect(); ! Project.getInstance().getCurrentCamera().viewEntireModel(apsect); this.glv.repaint(); } --- 246,251 ---- Action zoomAction = new ToolAction(glv, 0, "Biconzomeall.gif") { public void actionPerformed(ActionEvent agr0) { ! double aspect = glv.getView().getAspect(); ! Project.getInstance().getCurrentCamera().viewEntireModel(aspect); this.glv.repaint(); } |
From: Michael L. <he...@us...> - 2006-08-28 05:54:13
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31897/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java LinkAttribute.java Log Message: Changed selection to only contain "geometric" objects Index: LinkAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/LinkAttribute.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** LinkAttribute.java 23 Aug 2006 13:43:12 -0000 1.11 --- LinkAttribute.java 28 Aug 2006 05:54:04 -0000 1.12 *************** *** 34,37 **** --- 34,38 ---- import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Entity; + import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; *************** *** 302,306 **** */ public void mouseClicked(MouseEvent event) { ! Selection.primary().set(attribute().getValue()); } --- 303,312 ---- */ public void mouseClicked(MouseEvent event) { ! Object object = attribute().getValue(); ! if (object instanceof Geometric) { ! Selection.primary().set(object); ! } else { ! AttributeView.instance().display(object); ! } } Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** AttributeView.java 18 Aug 2006 11:25:01 -0000 1.36 --- AttributeView.java 28 Aug 2006 05:54:04 -0000 1.37 *************** *** 27,30 **** --- 27,33 ---- /** The logger */ private static Logger log = Logger.getLogger(AttributeView.class); + + /** The instance */ + private static AttributeView instance; /** The font used in plain */ *************** *** 53,56 **** --- 56,89 ---- /** + * + * @return Instance of AttributeView + */ + public static AttributeView instance() { + if (instance == null) { + instance = new AttributeView(); + } + return instance; + } + + /** + * + * @param object Object + */ + public void display(Object object) { + this.removeAll(); + if (object != null) { + if (object instanceof Parametric) { + this.add(BorderLayout.NORTH, new GenericPanel((Parametric)object)); + } else { + AttributePanel ap = new AttributePanel(); + ap.display(object); + this.add(BorderLayout.CENTER, ap); + } + } + revalidate(); + repaint(); + } + + /** * @param object The changed object */ *************** *** 59,74 **** Selection selection = Selection.primary(); if (object == selection) { ! this.removeAll(); if (selection.size() == 1) { ! Object o = selection.iterator().next(); ! ! if (o instanceof Parametric) { ! this.add(BorderLayout.NORTH, new GenericPanel((Parametric)o)); ! } else { ! AttributePanel ap = new AttributePanel(); ! ap.display(o); ! this.add(BorderLayout.CENTER, ap); ! } } } else { if (this.getComponents().length > 0) { --- 92,100 ---- Selection selection = Selection.primary(); if (object == selection) { ! Object o = null; if (selection.size() == 1) { ! o = selection.iterator().next(); } + display(o); } else { if (this.getComponents().length > 0) { *************** *** 88,94 **** } } } - revalidate(); - repaint(); } } --- 114,120 ---- } } + revalidate(); + repaint(); } } } |
From: Michael L. <he...@us...> - 2006-08-28 05:54:09
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31887/src/net/sourceforge/bprocessor/model Modified Files: Selection.java Log Message: Changed selection to only contain "geometric" objects Index: Selection.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Selection.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Selection.java 10 Aug 2006 13:07:57 -0000 1.12 --- Selection.java 28 Aug 2006 05:53:58 -0000 1.13 *************** *** 70,73 **** --- 70,76 ---- */ public boolean add(Object object) { + if (!(object instanceof Geometric)) { + throw new Error("Illegal object added to selection " + object.getClass().getName()); + } if (mark.add(object)) { selection.add(object); |
From: Michael L. <he...@us...> - 2006-08-28 05:54:07
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31897/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Changed selection to only contain "geometric" objects Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** GUI.java 18 Aug 2006 11:25:02 -0000 1.39 --- GUI.java 28 Aug 2006 05:54:04 -0000 1.40 *************** *** 399,404 **** registerPanel(tp, SPLIT_LEFT); ! AttributeView av = new AttributeView(); ! registerPanel(av, SPLIT_RIGHT); } --- 399,403 ---- registerPanel(tp, SPLIT_LEFT); ! registerPanel(AttributeView.instance(), SPLIT_RIGHT); } |
From: Michael L. <he...@us...> - 2006-08-28 05:54:07
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31897/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Changed selection to only contain "geometric" objects Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** GenericTreeView.java 23 Aug 2006 13:43:11 -0000 1.37 --- GenericTreeView.java 28 Aug 2006 05:54:04 -0000 1.38 *************** *** 45,48 **** --- 45,49 ---- import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; + import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Observer; import net.sourceforge.bprocessor.model.ParameterBlock; *************** *** 55,58 **** --- 56,60 ---- import net.sourceforge.bprocessor.model.modellor.Modellor; import net.sourceforge.bprocessor.gui.GUI; + import net.sourceforge.bprocessor.gui.attrview.AttributeView; /** *************** *** 251,255 **** */ public void select(Object target) { ! Selection.primary().set(target); } --- 253,261 ---- */ public void select(Object target) { ! if (target instanceof Geometric) { ! Selection.primary().set(target); ! } else { ! AttributeView.instance().display(target); ! } } *************** *** 524,529 **** if (created != null) { current.setModellor(created); ! Selection.primary().clear(); ! Selection.primary().add(created); current.changed(); } else { --- 530,534 ---- if (created != null) { current.setModellor(created); ! AttributeView.instance().display(created); current.changed(); } else { |
From: Michael L. <he...@us...> - 2006-08-28 05:54:05
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31859/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Changed selection to only contain "geometric" objects Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.142 retrieving revision 1.143 diff -C2 -d -r1.142 -r1.143 *** View.java 24 Aug 2006 11:51:05 -0000 1.142 --- View.java 28 Aug 2006 05:53:53 -0000 1.143 *************** *** 23,26 **** --- 23,27 ---- import net.sourceforge.bprocessor.model.Point; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Vertex; *************** *** 593,597 **** ClippingPlane cp = (ClippingPlane)clipit.next(); // draw the clipping planes ! Collection selection = glv.getTool().getSelection(); if (cp == target) { drawObject(cp); --- 594,598 ---- ClippingPlane cp = (ClippingPlane)clipit.next(); // draw the clipping planes ! Collection selection = Selection.primary(); if (cp == target) { drawObject(cp); *************** *** 793,797 **** */ private void drawNormalMode(GLDrawable gld) { ! Collection selection = glv.getTool().getSelection(); gl.glEnable(GL.GL_DEPTH_TEST); // draw selection --- 794,798 ---- */ private void drawNormalMode(GLDrawable gld) { ! Collection selection = Selection.primary(); gl.glEnable(GL.GL_DEPTH_TEST); // draw selection *************** *** 1738,1742 **** */ void labelSelection(boolean clickable) { ! Collection selection = glv.getTool().getSelection(); if (selection.size() == 1) { Iterator iter = selection.iterator(); --- 1739,1743 ---- */ void labelSelection(boolean clickable) { ! Collection selection = Selection.primary(); if (selection.size() == 1) { Iterator iter = selection.iterator(); |
From: Michael L. <he...@us...> - 2006-08-28 05:54:05
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31859/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java MoveTool.java SpaceTool.java RotationTool.java Log Message: Changed selection to only contain "geometric" objects Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** SpaceTool.java 10 Aug 2006 13:13:35 -0000 1.25 --- SpaceTool.java 28 Aug 2006 05:53:53 -0000 1.26 *************** *** 31,34 **** --- 31,35 ---- import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; *************** *** 150,154 **** Space space = null; ! Iterator iter = selection.iterator(); while (iter.hasNext()) { Object current = iter.next(); --- 151,155 ---- Space space = null; ! Iterator iter = Selection.primary().iterator(); while (iter.hasNext()) { Object current = iter.next(); *************** *** 174,178 **** offsetItem.addActionListener(new MenuAction() { public void actionPerformed(ActionEvent event) { ! addOffsetConstraint(selection); } } --- 175,179 ---- offsetItem.addActionListener(new MenuAction() { public void actionPerformed(ActionEvent event) { ! addOffsetConstraint(Selection.primary()); } } *************** *** 359,363 **** private JPopupMenu seperatorPopup() { JPopupMenu sepPop = new JPopupMenu(); ! Iterator selIt = new HashSet(selection).iterator(); if (selIt.hasNext()) { Object o = selIt.next(); --- 360,364 ---- private JPopupMenu seperatorPopup() { JPopupMenu sepPop = new JPopupMenu(); ! Iterator selIt = new HashSet(Selection.primary()).iterator(); if (selIt.hasNext()) { Object o = selIt.next(); *************** *** 395,399 **** ! Iterator selIt = new HashSet(selection).iterator(); Surface surface = null; Space space = null; --- 396,400 ---- ! Iterator selIt = new HashSet(Selection.primary()).iterator(); Surface surface = null; Space space = null; *************** *** 449,453 **** public void actionPerformed(ActionEvent arg0) { if (space != null) { ! selection.clear(); glv.getView().makeTarget(null); Project.getInstance().setActiveSpace(space); --- 450,454 ---- public void actionPerformed(ActionEvent arg0) { if (space != null) { ! Selection.primary().clear(); glv.getView().makeTarget(null); Project.getInstance().setActiveSpace(space); *************** *** 460,465 **** if (space != null) { Space spaceCopy = space.copy(); ! selection.clear(); ! selection.add(spaceCopy); glv.changeTool(Tool.MOVE_TOOL); } --- 461,466 ---- if (space != null) { Space spaceCopy = space.copy(); ! Selection.primary().clear(); ! Selection.primary().add(spaceCopy); glv.changeTool(Tool.MOVE_TOOL); } *************** *** 529,533 **** */ public void delete() { ! Iterator it = selection.iterator(); List edges = new ArrayList(); List vertices = new ArrayList(); --- 530,534 ---- */ public void delete() { ! Iterator it = Selection.primary().iterator(); List edges = new ArrayList(); List vertices = new ArrayList(); *************** *** 547,551 **** } } ! selection.clear(); glv.getView().makeTarget(null); Project.getInstance().delete(surfaces); --- 548,552 ---- } } ! Selection.primary().clear(); glv.getView().makeTarget(null); Project.getInstance().delete(surfaces); *************** *** 559,563 **** */ public void escape() { ! selection.clear(); glv.getView().makeTarget(null); Project.getInstance().setActiveSpace(null); --- 560,564 ---- */ public void escape() { ! Selection.primary().clear(); glv.getView().makeTarget(null); Project.getInstance().setActiveSpace(null); Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** AbstractTool.java 10 Aug 2006 13:08:01 -0000 1.92 --- AbstractTool.java 28 Aug 2006 05:53:53 -0000 1.93 *************** *** 81,89 **** /** The snap variable */ ! protected static final double EPSILON = 0.4; ! ! /** The selected objects */ ! protected static Collection selection; ! /** The 3DView */ protected GLView glv = null; --- 81,86 ---- /** The snap variable */ ! protected static final double EPSILON = 0.4; ! /** The 3DView */ protected GLView glv = null; *************** *** 104,111 **** private Cursor orbitCursor; - static { - selection = Selection.primary(); - } - /** --- 101,104 ---- *************** *** 471,475 **** */ public Collection getSelection() { ! return selection; } --- 464,468 ---- */ public Collection getSelection() { ! return Selection.primary(); } Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** MoveTool.java 14 Aug 2006 08:41:57 -0000 1.65 --- MoveTool.java 28 Aug 2006 05:53:53 -0000 1.66 *************** *** 24,27 **** --- 24,28 ---- import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 95,99 **** protected void updateFeedback() { if (start == null) { ! if (!selection.isEmpty()) { if (current != null) { makeTarget(current); --- 96,100 ---- protected void updateFeedback() { if (start == null) { ! if (!Selection.primary().isEmpty()) { if (current != null) { makeTarget(current); *************** *** 128,132 **** protected void moved(MouseEvent e) { if (start == null) { ! if (selection.isEmpty()) { findTarget(e, View.HANDLES); glv.getView().makeTarget(target); --- 129,133 ---- protected void moved(MouseEvent e) { if (start == null) { ! if (Selection.primary().isEmpty()) { findTarget(e, View.HANDLES); glv.getView().makeTarget(target); *************** *** 164,168 **** protected void pressed(MouseEvent e) { if (start == null) { ! if (selection.isEmpty()) { if (target != null) { entities = new HashSet(); --- 165,169 ---- protected void pressed(MouseEvent e) { if (start == null) { ! if (Selection.primary().isEmpty()) { if (target != null) { entities = new HashSet(); *************** *** 181,185 **** } else { entities = new HashSet(); ! entities.addAll(selection); current = findIntersection(e).copy(); from = current.vertex(); --- 182,186 ---- } else { entities = new HashSet(); ! entities.addAll(Selection.primary()); current = findIntersection(e).copy(); from = current.vertex(); Index: RotationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationTool.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** RotationTool.java 9 Aug 2006 15:15:03 -0000 1.16 --- RotationTool.java 28 Aug 2006 05:53:53 -0000 1.17 *************** *** 149,153 **** } clear(); ! collect(selection, vertices); // find the size of the handles --- 149,153 ---- } clear(); ! collect(Selection.primary(), vertices); // find the size of the handles |
From: Michael L. <he...@us...> - 2006-08-24 11:51:13
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6151/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Surface.java Log Message: Improved hit-detection in element-editing mode Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** Surface.java 23 Aug 2006 13:43:19 -0000 1.104 --- Surface.java 24 Aug 2006 11:51:10 -0000 1.105 *************** *** 75,78 **** --- 75,93 ---- /** + * Extract all edges from collection of surfaces + * @param surfaces Collection of surfaces + * @return Collection of edges + */ + public static Collection edges(Collection surfaces) { + Set edges = new HashSet(); + Iterator iter = surfaces.iterator(); + while (iter.hasNext()) { + Surface current = (Surface) iter.next(); + edges.addAll(current.getEdges()); + } + return edges; + } + + /** * Get the name * @return The name Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** Edge.java 23 Aug 2006 13:43:19 -0000 1.51 --- Edge.java 24 Aug 2006 11:51:10 -0000 1.52 *************** *** 66,69 **** --- 66,85 ---- return null; } + + /** + * Extract all vertices from a collection of edges + * @param edges Collection of edges + * @return Collection of vertices + */ + public static Collection vertices(Collection edges) { + Set vertices = new HashSet(); + Iterator iter = edges.iterator(); + while (iter.hasNext()) { + Edge current = (Edge) iter.next(); + vertices.add(current.getFrom()); + vertices.add(current.getTo()); + } + return vertices; + } /** |
From: Michael L. <he...@us...> - 2006-08-24 11:51:13
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5967/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Improved hit-detection in element-editing mode Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.141 retrieving revision 1.142 diff -C2 -d -r1.141 -r1.142 *** View.java 23 Aug 2006 13:43:15 -0000 1.141 --- View.java 24 Aug 2006 11:51:05 -0000 1.142 *************** *** 830,838 **** Space active = Project.getInstance().getActiveSpace(); ! if (active != null) { ! drawSpace(active, gld); ! } else { ! drawSpace(Project.getInstance().world(), gld); ! } //Draw edges --- 830,834 ---- Space active = Project.getInstance().getActiveSpace(); ! drawSpace(active, gld); //Draw edges *************** *** 1038,1063 **** private void drawEdges(GLDrawable gld) { drawGeneralEdges(gld, tempEdges); - Collection all = Project.getInstance().getEdges(); Space active = Project.getInstance().getActiveSpace(); if (active != Project.getInstance().world()) { ! Set edges = new HashSet(); ! { ! Iterator iter = all.iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! if (current.getStrippled()) { ! edges.add(current); ! } ! } ! } ! { ! Collection envelope = active.getEnvelope(); ! Iterator iter = envelope.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! edges.addAll(current.getEdges()); ! } ! } drawConstructionEdges(gld, edges); } --- 1034,1042 ---- private void drawEdges(GLDrawable gld) { drawGeneralEdges(gld, tempEdges); Space active = Project.getInstance().getActiveSpace(); if (active != Project.getInstance().world()) { ! Collection envelope = active.getEnvelope(); ! Collection edges = Surface.edges(envelope); drawConstructionEdges(gld, edges); } *************** *** 1787,1810 **** */ private void drawSelectionMode(GLDrawable gld) { - Collection surfaces = Project.getInstance().getSurfaces(); - Collection edges = Project.getInstance().getEdges(); - Collection vertices = Project.getInstance().getVertices(); - Space space = Project.getInstance().getActiveSpace(); gl = gld.getGL(); initNames(gl); if (selectMode == VERTICES || selectMode == ALL) { ! Iterator it = vertices.iterator(); ! gl.glColor3fv(lineColor); ! while (it.hasNext()) { ! Vertex v = (Vertex)it.next(); ! pushName(gl, v); ! drawVertexHit(v); ! popName(gl); ! } ! Iterator tempVerticesIt = tempVertices.iterator(); ! while (tempVerticesIt.hasNext()) { ! Vertex v = (Vertex)tempVerticesIt.next(); pushName(gl, v); drawVertexHit(v); --- 1766,1794 ---- */ private void drawSelectionMode(GLDrawable gld) { Space space = Project.getInstance().getActiveSpace(); + Collection surfaces = space.getSurfaces(); + Collection edges = new LinkedList(); + edges.addAll(space.getEdges()); + edges.addAll(tempEdges); + Collection vertices = new LinkedList(); + vertices.addAll(space.getVertices()); + vertices.addAll(tempVertices); + + if (selectionMode != OBJECTS) { + Collection envelope = space.getEnvelope(); + Collection envelopeEdges = Surface.edges(envelope); + edges.addAll(envelopeEdges); + Collection envelopeVertices = Edge.vertices(envelopeEdges); + vertices.addAll(envelopeVertices); + } + + gl = gld.getGL(); initNames(gl); if (selectMode == VERTICES || selectMode == ALL) { ! Iterator iter = vertices.iterator(); ! while (iter.hasNext()) { ! Vertex v = (Vertex)iter.next(); pushName(gl, v); drawVertexHit(v); *************** *** 1813,1859 **** } if (selectMode == EDGES || selectMode == ALL) { ! if (space != null) { ! Set es = new HashSet(); ! { ! Set surfs = space.getEnvelope(); ! Iterator surfsIt = surfs.iterator(); ! while (surfsIt.hasNext()) { ! Surface current = (Surface) surfsIt.next(); ! es.addAll(current.getEdges()); ! } ! } ! ! // Collection surfs = space.getSurfaces(); ! // Iterator surfsIt = surfs.iterator(); ! // while (surfsIt.hasNext()) { ! // Surface current = (Surface) surfsIt.next(); ! // es.addAll(current.getEdges()); ! // } ! ! es.addAll(space.getEdges()); ! ! Iterator it = es.iterator(); ! gl.glColor3fv(lineColor); ! while (it.hasNext()) { ! Edge e = (Edge)it.next(); ! pushName(gl, e); ! drawEdge(e); ! popName(gl); ! } ! } else { ! Iterator it = edges.iterator(); ! gl.glColor3fv(lineColor); ! while (it.hasNext()) { ! Edge e = (Edge)it.next(); ! pushName(gl, e); ! drawEdge(e); ! popName(gl); ! } ! } ! ! ! Iterator tempEdgeIt = tempEdges.iterator(); ! while (tempEdgeIt.hasNext()) { ! Edge e = (Edge)tempEdgeIt.next(); pushName(gl, e); drawEdge(e); --- 1797,1803 ---- } if (selectMode == EDGES || selectMode == ALL) { ! Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! Edge e = (Edge)iter.next(); pushName(gl, e); drawEdge(e); *************** *** 1862,1868 **** } if (selectMode == SURFACES || selectMode == ALL) { - - gl.glColor3fv(SURFACE_COLOR); - if (space != null) { Set ss = new HashSet(); --- 1806,1809 ---- |
From: Michael L. <he...@us...> - 2006-08-24 09:19:16
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9476/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Improved hit-detection in element-editing Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** AbstractPencil.java 18 Aug 2006 08:24:16 -0000 1.59 --- AbstractPencil.java 24 Aug 2006 09:19:09 -0000 1.60 *************** *** 181,188 **** Space space = Project.getInstance().getActiveSpace(); Vertex v = intersection.vertex(); ! Set vertices = space.findByLocation(v.getX(), v.getY(), v.getZ(), 0.0000001); ! if (!vertices.isEmpty()) { ! v = (Vertex) vertices.iterator().next(); ! intersection = new Intersection(v, Intersection.VERTEX, v); } } --- 181,197 ---- Space space = Project.getInstance().getActiveSpace(); Vertex v = intersection.vertex(); ! if (intersection.type() == Intersection.VERTEX) { ! if (v.getOwner() != space) { ! intersection = new Intersection(v.copy(), Intersection.EDGE_INTERSECTION, null); ! } ! } ! ! v = intersection.vertex(); ! if (v.getOwner() != space) { ! Set vertices = space.findByLocation(v.getX(), v.getY(), v.getZ(), 0.0000001); ! if (!vertices.isEmpty()) { ! v = (Vertex) vertices.iterator().next(); ! intersection = new Intersection(v, Intersection.VERTEX, v); ! } } } |
From: Michael L. <he...@us...> - 2006-08-23 13:43:25
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17565/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Mad some changed to the naming scheme Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.140 retrieving revision 1.141 diff -C2 -d -r1.140 -r1.141 *** View.java 18 Aug 2006 08:24:16 -0000 1.140 --- View.java 23 Aug 2006 13:43:15 -0000 1.141 *************** *** 876,879 **** --- 876,881 ---- grid(cs); + drawConstructorPlanes(); + gl.glDisable(GL.GL_DEPTH_TEST); { *************** *** 1063,1066 **** --- 1065,1086 ---- /** + * Draw constructor planes. + * + */ + private void drawConstructorPlanes() { + Space active = Project.getInstance().getActiveSpace(); + while (active != null) { + Iterator iter = active.getConstructors().iterator(); + while (iter.hasNext()) { + Constructor current = (Constructor) iter.next(); + if (current instanceof CoordinateSystem) { + drawConstructorPlane((CoordinateSystem) current); + } + } + active = active.getOwner(); + } + } + + /** * Draw all constructors in this level and all above */ *************** *** 1132,1135 **** --- 1152,1185 ---- /** + * + * @param cs CoordinateSystem + */ + private void drawConstructorPlane(CoordinateSystem cs) { + if (cs.isActive() && cs.onlyPlane()) { + Vertex i = cs.getI(); + Vertex j = cs.getJ(); + Vertex origin = cs.getOrigin(); + Vertex v = i.copy(); + Vertex u = j.copy(); + v.scale(5); + u.scale(5); + Vertex a = origin.add(u).minus(v); + Vertex b = origin.add(u).add(v); + Vertex c = origin.minus(u).add(v); + Vertex d = origin.minus(u).minus(v); + gl.glColor4fv(CLIP_PLANE_INTERIOR_COLOR); + gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); + gl.glPolygonOffset(1f, 1f); + gl.glBegin(GL.GL_QUADS); + gl.glVertex3d(a.getX(), a.getY(), a.getZ()); + gl.glVertex3d(b.getX(), b.getY(), b.getZ()); + gl.glVertex3d(c.getX(), c.getY(), c.getZ()); + gl.glVertex3d(d.getX(), d.getY(), d.getZ()); + gl.glEnd(); + gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); + } + } + + /** * draw the coordinatesystem * @param cs The coordinatesystem *************** *** 1159,1162 **** --- 1209,1213 ---- drawConstructorLine(cs.getOrigin(), j, dist); } + active = false; if (cs.isActive() && active) { Vertex origin = cs.getOrigin(); |