bprocessor-commit Mailing List for B-processor (Page 27)
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...> - 2008-01-15 15:43:40
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15194/src/net/sourceforge/bprocessor/gl/tool Modified Files: SelectStrategy.java Log Message: new selection impl Index: SelectStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectStrategy.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** SelectStrategy.java 13 Dec 2007 12:00:49 -0000 1.24 --- SelectStrategy.java 15 Jan 2008 15:43:36 -0000 1.25 *************** *** 10,13 **** --- 10,15 ---- import java.util.Collection; import java.util.HashSet; + import java.util.LinkedList; + import java.util.List; import java.util.Set; *************** *** 20,23 **** --- 22,26 ---- import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.model.ClippingPlane; + import net.sourceforge.bprocessor.model.Command; import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.Edge; *************** *** 36,39 **** --- 39,45 ---- private static Logger log = Logger.getLogger(SelectStrategy.class); + + private Collection<Geometric> initial; + /** The GLView **/ private Editor editor; *************** *** 96,101 **** */ public void moved(MouseEvent e) { - // target = glv.getView().getObjectAtPoint(e.getX(), e.getY(), View.OBJECTS); - // glv.getView().makeTarget(target); } --- 102,105 ---- *************** *** 116,119 **** --- 120,124 ---- activated = true; } + initial = new HashSet(Selection.primary()); } *************** *** 140,165 **** } int newX = e.getX(); ! Set l = editor.getView().getObjectInArea(x, y, e.getX(), e.getY()); ! l.removeAll(box); ! l.remove(Project.getInstance().getActiveCoordinateSystem()); ! if (newX > x) { ! Set<Geometric> remove = new HashSet<Geometric>(); ! for (Object o : l) { ! if (o instanceof Geometric) { ! Geometric geo = (Geometric)o; ! Set<Vertex> vertices = geo.collect(); ! if (!l.containsAll(vertices)) { ! remove.add(geo); } } } ! l.removeAll(remove); ! } ! editor.getView().makeTarget(null); ! if (!e.isShiftDown()) { ! Selection.primary().set(l); ! } else { ! Selection.primary().addAll(l); } } --- 145,240 ---- } int newX = e.getX(); ! Collection geometrics = editor.getView().getObjectInArea(x, y, e.getX(), e.getY()); ! geometrics.removeAll(box); ! geometrics.remove(Project.getInstance().getActiveCoordinateSystem()); ! ! { ! Set<Vertex> vertices = new HashSet(); ! Set<Edge> edges = new HashSet(); ! Set<Surface> surfaces = new HashSet(); ! Container owner = Project.getInstance().getActiveSpace(); ! ! if (newX > x) { ! for (Object current : geometrics) { ! if (current instanceof Vertex) { ! Vertex vertex = (Vertex) current; ! if (vertex.getOwner() == owner) { ! vertices.add(vertex); ! } ! } ! } ! } else { ! for (Object current : geometrics) { ! if (current instanceof Edge) { ! Edge edge = (Edge) current; ! if (edge.getOwner() == owner) { ! edges.add(edge); ! } } } } ! ! Command.Inverse inv = new Command.Inverse(new LinkedList(owner.getSurfaces())); ! ! for (Vertex current : vertices) { ! List<Edge> adjacent = inv.edges(current); ! for (Edge edge : adjacent) { ! if (vertices.contains(edge.otherVertex(current))) { ! edges.add(edge); ! } ! } ! } ! ! for (Edge current : edges) { ! List<Surface> adjacent = inv.surfaces(current); ! for (Surface surface : adjacent) { ! if (edges.containsAll(surface.getEdges())) { ! surfaces.add(surface); ! } ! } ! } ! ! edges.addAll(Surface.edges(surfaces)); ! vertices.addAll(Edge.vertices(edges)); ! ! Collection<Geometric> objects = new LinkedList(); ! objects.addAll(surfaces); ! objects.addAll(edges); ! objects.addAll(vertices); ! ! if (!e.isShiftDown()) { ! Selection.primary().set(objects); ! } else { ! Collection<Geometric> tentative = new HashSet(initial); ! ! for (Geometric current : objects) { ! if (initial.contains(current)) { ! tentative.remove(current); ! } else { ! tentative.add(current); ! } ! } ! ! surfaces.clear(); ! edges.clear(); ! vertices.clear(); ! for (Geometric current : tentative) { ! if (current instanceof Surface) { ! surfaces.add((Surface) current); ! } else if (current instanceof Edge) { ! edges.add((Edge) current); ! } else if (current instanceof Vertex) { ! vertices.add((Vertex) current); ! } ! } ! edges.addAll(Surface.edges(surfaces)); ! vertices.addAll(Edge.vertices(edges)); ! tentative.clear(); ! tentative.addAll(surfaces); ! tentative.addAll(edges); ! tentative.addAll(vertices); ! Selection.primary().set(tentative); ! } } } *************** *** 178,181 **** --- 253,257 ---- } multipleSelection = false; + initial = null; } else { Selection selection = Selection.primary(); |
From: Michael L. <he...@us...> - 2008-01-15 15:43:39
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15194/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: new selection impl Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.276 retrieving revision 1.277 diff -C2 -d -r1.276 -r1.277 *** View.java 14 Jan 2008 14:00:17 -0000 1.276 --- View.java 15 Jan 2008 15:43:36 -0000 1.277 *************** *** 1642,1646 **** * @return All geometry in the selection */ ! private Set getAllGeometryInSelection() { Set selection = new HashSet(); int bufferOffset = 0; --- 1642,1646 ---- * @return All geometry in the selection */ ! private Collection getAllGeometryInSelection() { Set selection = new HashSet(); int bufferOffset = 0; *************** *** 1668,1687 **** * @return The objects in the area */ ! public Set getObjectInArea(double x1, double y1, double x2, double y2) { double x = (x1 - x2); double y = (y1 - y2); - // save default selection box int[] tempsize = selectionSize; - // set new selection size selectionSize = new int[] {(int)Math.abs(x) < 6 ? 6 : (int)Math.abs(x), (int)Math.abs(y) < 6 ? 6 : (int)Math.abs(y)}; - // Do selection on vertices this.x = x1 - (x / 2); this.y = y1 - (y / 2); picking = 10; editor.repaint(true); ! Set selection = getAllGeometryInSelection(); ! //restore default selection box selectionSize = tempsize; return selection; --- 1668,1683 ---- * @return The objects in the area */ ! public Collection getObjectInArea(double x1, double y1, double x2, double y2) { double x = (x1 - x2); double y = (y1 - y2); int[] tempsize = selectionSize; selectionSize = new int[] {(int)Math.abs(x) < 6 ? 6 : (int)Math.abs(x), (int)Math.abs(y) < 6 ? 6 : (int)Math.abs(y)}; this.x = x1 - (x / 2); this.y = y1 - (y / 2); picking = 10; editor.repaint(true); ! Collection selection = getAllGeometryInSelection(); selectionSize = tempsize; return selection; |
From: Michael L. <he...@us...> - 2008-01-14 14:00:34
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6448/src/net/sourceforge/bprocessor/model Modified Files: Vertex.java Command.java Log Message: Selection buffer extends Vertex can be corner Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** Command.java 10 Jan 2008 09:54:05 -0000 1.62 --- Command.java 14 Jan 2008 14:00:27 -0000 1.63 *************** *** 563,598 **** Vertex vertexpoint = vertexmap.get(current); ! ! if (crease.size() < 2) { ! List<Vertex> vs = new LinkedList(); ! for (Edge edge : es) { ! vs.add(edge.otherVertex(current)); ! } ! List<Vertex> fs = new LinkedList(); ! for (Surface surface : ss) { ! fs.add(facemap.get(surface)); ! } ! Vertex a1 = Vertex.center(vs); ! Vertex a2 = Vertex.center(fs); ! double x = ((n - 2) * current.x) / n + a1.x / n + a2.x / n; ! double y = ((n - 2) * current.y) / n + a1.y / n + a2.y / n; ! double z = ((n - 2) * current.z) / n + a1.z / n + a2.z / n; ! vertexpoint.setX(x); ! vertexpoint.setY(y); ! vertexpoint.setZ(z); ! } else if (crease.size() == 2) { ! double x = 6 * current.x; ! double y = 6 * current.y; ! double z = 6 * current.z; ! for (Edge edge : crease) { ! Vertex v = edge.otherVertex(current); ! x += v.x; ! y += v.y; ! z += v.z; } - vertexpoint.setX(x / 8); - vertexpoint.setY(y / 8); - vertexpoint.setZ(z / 8); } } --- 563,599 ---- Vertex vertexpoint = vertexmap.get(current); ! if (!current.isCorner()) { ! if (crease.size() < 2) { ! List<Vertex> vs = new LinkedList(); ! for (Edge edge : es) { ! vs.add(edge.otherVertex(current)); ! } ! List<Vertex> fs = new LinkedList(); ! for (Surface surface : ss) { ! fs.add(facemap.get(surface)); ! } ! Vertex a1 = Vertex.center(vs); ! Vertex a2 = Vertex.center(fs); ! double x = ((n - 2) * current.x) / n + a1.x / n + a2.x / n; ! double y = ((n - 2) * current.y) / n + a1.y / n + a2.y / n; ! double z = ((n - 2) * current.z) / n + a1.z / n + a2.z / n; ! vertexpoint.setX(x); ! vertexpoint.setY(y); ! vertexpoint.setZ(z); ! } else if (crease.size() == 2) { ! double x = 6 * current.x; ! double y = 6 * current.y; ! double z = 6 * current.z; ! for (Edge edge : crease) { ! Vertex v = edge.otherVertex(current); ! x += v.x; ! y += v.y; ! z += v.z; ! } ! vertexpoint.setX(x / 8); ! vertexpoint.setY(y / 8); ! vertexpoint.setZ(z / 8); } } } Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** Vertex.java 17 Dec 2007 13:09:17 -0000 1.76 --- Vertex.java 14 Jan 2008 14:00:25 -0000 1.77 *************** *** 43,46 **** --- 43,48 ---- protected double z; + protected boolean corner; + /** * Find vertex that coincides with the vertex *************** *** 172,175 **** --- 174,193 ---- /** + * Sets the corner value + * @param value new value + */ + public void setCorner(boolean value) { + corner = value; + } + + /** + * Returns the corner + * @return true if this vertex is a corner + */ + public boolean isCorner() { + return corner; + } + + /** * Return x, y, z in a double array * @return Values *************** *** 241,244 **** --- 259,263 ---- public Vertex copy() { Vertex vertex = new Vertex(x, y, z); + vertex.setCorner(isCorner()); return vertex; } *************** *** 436,439 **** --- 455,460 ---- } else if (a.getName().equals("Z")) { setZ(((Double)a.getValue()).doubleValue()); + } else if (a.getName().equals("corner")) { + setCorner(((Boolean) a.getValue()).booleanValue()); } } *************** *** 451,454 **** --- 472,476 ---- res.add(new Attribute("Y", new Double(getY()))); res.add(new Attribute("Z", new Double(getZ()))); + res.add(new Attribute("corner", Boolean.valueOf(isCorner()))); return res; } |
From: Michael L. <he...@us...> - 2008-01-14 14:00:22
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6410/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Selection buffer extends Vertex can be corner Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.275 retrieving revision 1.276 diff -C2 -d -r1.275 -r1.276 *** View.java 7 Jan 2008 14:52:02 -0000 1.275 --- View.java 14 Jan 2008 14:00:17 -0000 1.276 *************** *** 733,737 **** hits = gl.glRenderMode(GL.GL_RENDER); if (hits < 0) { - System.out.println("overflow in selection buffer!"); selectionLength *= 2; picking = 10; --- 733,736 ---- *************** *** 1682,1690 **** this.y = y1 - (y / 2); picking = 10; - int lengthTemp = selectionLength; - selectionLength = 2056; editor.repaint(true); Set selection = getAllGeometryInSelection(); - selectionLength = lengthTemp; //restore default selection box selectionSize = tempsize; --- 1681,1686 ---- |
From: Michael L. <he...@us...> - 2008-01-11 09:22:06
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16396/src/net/sourceforge/bprocessor/model Modified Files: Surface.java SurfaceAnalysis.java Log Message: Improved space-assignment in space-analysis Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.215 retrieving revision 1.216 diff -C2 -d -r1.215 -r1.216 *** Surface.java 10 Jan 2008 09:54:05 -0000 1.215 --- Surface.java 11 Jan 2008 09:22:08 -0000 1.216 *************** *** 35,39 **** */ public class Surface extends Geometric implements Parametric { ! private static final boolean AUTOMATIC = true; private static Logger log = Logger.getLogger(Surface.class); --- 35,39 ---- */ public class Surface extends Geometric implements Parametric { ! private static final boolean AUTOMATIC = false; private static Logger log = Logger.getLogger(Surface.class); Index: SurfaceAnalysis.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SurfaceAnalysis.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** SurfaceAnalysis.java 10 Jan 2008 09:54:05 -0000 1.15 --- SurfaceAnalysis.java 11 Jan 2008 09:22:08 -0000 1.16 *************** *** 21,24 **** --- 21,26 ---- */ public class SurfaceAnalysis { + private static final boolean VERBOSE = false; + /** * *************** *** 162,165 **** --- 164,170 ---- */ public Collection<Surface> surfaceAnalysis(Container space, Collection<Edge> start) { + if (VERBOSE) { + System.out.println("analyze " + start); + } Collection<CoordinateSystem> systems = planeAnalysis(space, start); Collection<Surface> added = new LinkedList(); *************** *** 191,194 **** --- 196,204 ---- public Collection<Surface> surfaceAnalysis(Container space, CoordinateSystem system, Collection<Edge> start) { + + if (VERBOSE) { + System.out.println(" plane " + system.getN()); + } + Plane plane = system.plane(); Map<Vertex, VertexNode> vmap = new LinkedHashMap(); *************** *** 298,302 **** --- 308,331 ---- } + private boolean isVoid(Space space) { + if (space != null) { + return space.isVoid(); + } else { + return true; + } + } + private void assign(Surface surface, Collection<Surface> surfaces) { + if (VERBOSE) { + System.out.println(" assign " + surface); + for (Surface current : surfaces) { + String name = current.getName(); + Space front = current.getFrontDomain(); + Space back = current.getBackDomain(); + String desc = "[" + name + " " + front + " | " + back + "]"; + System.out.println(" " + desc); + } + } + Container back = null; Material backmaterial = null; *************** *** 307,324 **** Vertex n2 = other.normal(); if (n1.dot(n2) > 0) { ! if (back == null) { back = other.getBackDomain(); backmaterial = other.getBackMaterial(); } ! if (front == null) { front = other.getFrontDomain(); frontmaterial = other.getFrontMaterial(); } } else { ! if (back == null) { back = other.getFrontDomain(); backmaterial = other.getFrontMaterial(); } ! if (front == null) { front = other.getBackDomain(); frontmaterial = other.getBackMaterial(); --- 336,353 ---- Vertex n2 = other.normal(); if (n1.dot(n2) > 0) { ! if (isVoid(back)) { back = other.getBackDomain(); backmaterial = other.getBackMaterial(); } ! if (isVoid(front)) { front = other.getFrontDomain(); frontmaterial = other.getFrontMaterial(); } } else { ! if (isVoid(back)) { back = other.getFrontDomain(); backmaterial = other.getFrontMaterial(); } ! if (isVoid(front)) { front = other.getBackDomain(); frontmaterial = other.getBackMaterial(); *************** *** 326,329 **** --- 355,361 ---- } } + if (VERBOSE) { + System.out.println(" " + front + " | " + back); + } surface.setBackDomain(back); surface.setBackMaterial(backmaterial); *************** *** 343,346 **** --- 375,382 ---- Set<Surface> added, Set<Surface> removed) { if (!marked(start.left)) { + if (VERBOSE) { + System.out.println(" left-side " + start.edge); + } + SurfaceNode s = new SurfaceNode(); s.mark = true; *************** *** 367,370 **** --- 403,410 ---- } if (!marked(start.right)) { + if (VERBOSE) { + System.out.println(" right-side " + start.edge); + } + SurfaceNode s = new SurfaceNode(); s.mark = true; |
From: Michael L. <he...@us...> - 2008-01-10 09:55:07
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19625/src/net/sourceforge/bprocessor/gl/view Modified Files: PopupMenu.java Log Message: Fixed bug in pencil analysis Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/PopupMenu.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PopupMenu.java 8 Jan 2008 10:49:16 -0000 1.8 --- PopupMenu.java 10 Jan 2008 09:53:56 -0000 1.9 *************** *** 756,759 **** --- 756,760 ---- menu.add(action); } + menu.add(getAnalysisMenu()); return menu; } *************** *** 763,768 **** * @return JPopupMenu */ ! private JPopupMenu getAnalysisMenu() { ! JPopupMenu menu = new JPopupMenu(); AbstractAction planeanalysis = new AbstractAction("Plane Analysis") { public void actionPerformed(ActionEvent arg0) { --- 764,769 ---- * @return JPopupMenu */ ! private JMenu getAnalysisMenu() { ! JMenu menu = new JMenu("Analysis"); AbstractAction planeanalysis = new AbstractAction("Plane Analysis") { public void actionPerformed(ActionEvent arg0) { |
From: Michael L. <he...@us...> - 2008-01-10 09:54:07
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19819/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Command.java SurfaceAnalysis.java Log Message: Fixed bug in pencil analysis Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.214 retrieving revision 1.215 diff -C2 -d -r1.214 -r1.215 *** Surface.java 19 Dec 2007 09:03:41 -0000 1.214 --- Surface.java 10 Jan 2008 09:54:05 -0000 1.215 *************** *** 78,103 **** } double y = Double.MAX_VALUE; ! Edge e1 = null; ! Edge e2 = null; ! Edge previous = edges.get(0); ! Iterator iter = edges.iterator(); ! iter.next(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! Vertex v = Edge.commonVertex(previous, current); ! v = system.translate(v); ! if (v.getY() <= y) { ! y = v.getY(); ! e1 = previous; ! e2 = current; } - previous = current; } ! if (e1 == null || e2 == null) { ! return PARALLEL; } ! Vertex common = Edge.commonVertex(e1, e2); ! Vertex from = e1.otherVertex(common); ! Vertex to = e2.otherVertex(common); from = system.translate(from); common = system.translate(common); --- 78,122 ---- } double y = Double.MAX_VALUE; ! ! List<Vertex> vertices = Command.Offset.vertices(edges); ! int inx0 = 0; ! int inx = 0; ! int inx1 = 0; ! ! for (int i = 0; i < vertices.size(); i++) { ! Vertex current = system.translate(vertices.get(i)); ! if (current.getY() <= y) { ! inx = i; ! y = current.getY(); } } ! ! if (inx == 0) { ! inx0 = vertices.size() - 1; ! } else { ! inx0 = inx - 1; } ! search: ! { ! for (int i = inx + 1; i < vertices.size(); i++) { ! Vertex current = system.translate(vertices.get(i)); ! if (current.getY() > y) { ! inx1 = i; ! break search; ! } ! } ! for (int i = 0; i < inx0; i++) { ! Vertex current = system.translate(vertices.get(i)); ! if (current.getY() > y) { ! inx1 = i; ! break search; ! } ! } ! } ! ! Vertex from = vertices.get(inx0); ! Vertex common = vertices.get(inx); ! Vertex to = vertices.get(inx1); ! from = system.translate(from); common = system.translate(common); *************** *** 107,112 **** Vertex cross = u.cross(v); cross.normalize(); - double determinant = system.determinant(); // if the cross points into the screen (along the negative z), --- 126,131 ---- Vertex cross = u.cross(v); cross.normalize(); + double determinant = system.determinant(); // if the cross points into the screen (along the negative z), *************** *** 487,491 **** } } else { ! Edge previous = edges[i - 1]; if (previous.contains(current.getTo())) { lst.add(e2); --- 506,510 ---- } } else { ! Edge previous = edges[i - 1]; if (previous.contains(current.getTo())) { lst.add(e2); Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** Command.java 8 Jan 2008 10:49:19 -0000 1.61 --- Command.java 10 Jan 2008 09:54:05 -0000 1.62 *************** *** 1145,1149 **** } ! private static List<Vertex> vertices(List<Edge> edges) { List<Vertex> vertices = new ArrayList(); if (edges.size() > 1) { --- 1145,1154 ---- } ! /** ! * ! * @param edges Edges ! * @return vertices ! */ ! public static List<Vertex> vertices(List<Edge> edges) { List<Vertex> vertices = new ArrayList(); if (edges.size() > 1) { Index: SurfaceAnalysis.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SurfaceAnalysis.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** SurfaceAnalysis.java 13 Dec 2007 12:00:32 -0000 1.14 --- SurfaceAnalysis.java 10 Jan 2008 09:54:05 -0000 1.15 *************** *** 704,707 **** --- 704,714 ---- surfaces.add(surface); } + + /** + * {@inheritDoc} + */ + public String toString() { + return "{node " + surfaces + "}"; + } } } |
From: Michael L. <he...@us...> - 2008-01-10 09:54:04
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19635/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Fixed bug in pencil analysis Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.138 retrieving revision 1.139 diff -C2 -d -r1.138 -r1.139 *** GenericTreeView.java 19 Dec 2007 11:40:48 -0000 1.138 --- GenericTreeView.java 10 Jan 2008 09:54:00 -0000 1.139 *************** *** 443,449 **** /** ! * ContainerNode */ ! public class ContainerNode extends GenericNode { protected Collection< ? extends Entity> content; private boolean sort; --- 443,449 ---- /** ! * */ ! public class CompositeNode extends GenericNode { protected Collection< ? extends Entity> content; private boolean sort; *************** *** 453,467 **** * @param label Object */ ! public ContainerNode(Object label) { super(label); } /** ! * Constructor for ContainerNode * @param content 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> content, boolean sort) { super(label); this.content = content; --- 453,467 ---- * @param label Object */ ! public CompositeNode(Object label) { super(label); } /** ! * Constructor for CompositeNode * @param content User collection to put in ! * @param label The label for the composite node * @param sort Sort the children? */ ! public CompositeNode(Object label, Collection< ? extends Entity> content, boolean sort) { super(label); this.content = content; *************** *** 496,500 **** /** ! * Remove the children from container node * @param children the children to remove */ --- 496,500 ---- /** ! * Remove the children from composite node * @param children the children to remove */ *************** *** 623,627 **** * SpaceNode */ ! public class SpaceNode extends EntityNode { /** * Constructor for SpaceNode --- 623,627 ---- * SpaceNode */ ! public abstract class SpaceNode extends EntityNode { /** * Constructor for SpaceNode *************** *** 630,669 **** public SpaceNode(Space space) { super(space); - if (space.isInstance()) { - makeInstanceContent((Instance) space); - } else if (space.isContainer()) { - makeContainerContent((Container) space); - } else { - Set surfaces = space.getEnvelope(); - add(new SurfaceContainer("Envelope", surfaces, false)); - } } /** ! * Make the tree content for the space that is a container ! * @param space the space */ ! private void makeContainerContent(Container space) { ! add(new EnvelopeContainer("Envelope", space)); ! String lvlstr = Container.levelToString(space.getLevel() + 1); ! add(new ElementContainer(lvlstr + "s", space.getElements())); ! if (Project.doDisplayGeometry()) { ! add(new GeometryNode("Geometry", space)); ! } ! ContainerNode cn = new ConstructorContainer("Constructors", space.getConstructors()); ! add(cn); ! if (space.getModellor() != null) { ! add(new ModellorNode(space.getModellor())); } } ! /** * Generate the tree content for a space that is a instance * @param space The space */ ! private void makeInstanceContent(Instance space) { Set surfaces = space.getEnvelope(); add(new SurfaceContainer("Envelope", surfaces, false)); ! SpaceNode proto = new SpaceNode(space.getProto()); add(proto); CoordinateSystem cs = space.getInstanceAnchor(); --- 630,677 ---- public SpaceNode(Space space) { super(space); } /** ! * Return the displaystring for this EntityNode ! * @return Display string */ ! public String toString() { ! String nid = ((Space)userObject).getDisplayName(); ! return nid; ! } ! ! /** ! * Return icon ! * @return icon ! */ ! public ImageIcon icon() { ! if (((Space)userObject).isConstructionSpace()) { ! return constructionspaceicon; ! } else { ! return functionalspaceicon; } } ! } ! ! /** ! * ! */ ! public class InstanceNode extends SpaceNode { ! /** ! * @param instance Instance ! */ ! public InstanceNode(Instance instance) { ! super(instance); ! makeInstanceContent(instance); ! } ! /** * Generate the tree content for a space that is a instance * @param space The space */ ! protected void makeInstanceContent(Instance space) { Set surfaces = space.getEnvelope(); add(new SurfaceContainer("Envelope", surfaces, false)); ! SpaceNode proto = new ContainerNode(space.getProto()); add(proto); CoordinateSystem cs = space.getInstanceAnchor(); *************** *** 672,676 **** } } ! /** * Update the node with the given object --- 680,738 ---- } } ! ! /** ! * Update the node with the given object ! * @param o The object ! */ ! public void update(Object o) { ! if (o instanceof Instance) { ! Instance instance = (Instance) o; ! if (this.getChildCount() == 3) { ! ((GenericNode)getChildAt(0)).update(instance.getEnvelope()); ! ((GenericNode)getChildAt(1)).update(instance.getProto()); ! ((GenericNode)getChildAt(2)).update(instance.getInstanceAnchor()); ! } else { ! removeAllChildren(); ! makeInstanceContent(instance); ! model.nodeStructureChanged(this); ! } ! userObject = instance; ! model.nodeChanged(this); ! } ! } ! ! ! } ! ! /** ! * ! */ ! public class ContainerNode extends SpaceNode { ! /** ! * @param container Container ! */ ! public ContainerNode(Container container) { ! super(container); ! makeContainerContent(container); ! } ! ! /** ! * Make the tree content for the space that is a container ! * @param space the space ! */ ! protected void makeContainerContent(Container space) { ! add(new EnvelopeContainer("Envelope", space)); ! String lvlstr = Container.levelToString(space.getLevel() + 1); ! add(new ElementContainer(lvlstr + "s", space.getElements())); ! CompositeNode cn = new ConstructorContainer("Constructors", space.getConstructors()); ! add(cn); ! if (Project.doDisplayGeometry()) { ! add(new GeometryNode("Geometry", space)); ! } ! if (space.getModellor() != null) { ! add(new ModellorNode(space.getModellor())); ! } ! } ! /** * Update the node with the given object *************** *** 679,756 **** public void update(Object o) { if (o instanceof Container) { ! Space s = (Container)o; ! if (s.isInstance()) { ! Instance instance = (Instance) s; ! if (this.getChildCount() == 3) { ! ((GenericNode)getChildAt(0)).update(instance.getEnvelope()); ! ((GenericNode)getChildAt(1)).update(instance.getProto()); ! ((GenericNode)getChildAt(2)).update(instance.getInstanceAnchor()); ! } else { ! removeAllChildren(); ! makeInstanceContent(instance); ! model.nodeStructureChanged(this); ! } ! } else if (s.isContainer()) { ! Container space = (Container)userObject; ! if (space.isContainer()) { ! int inx = 0; ! ((GenericNode)getChildAt(inx++)).update(space.getEnvelope()); ! ((GenericNode)getChildAt(inx++)).update(space.getElements()); ! if (Project.doDisplayGeometry()) { ! ((GenericNode)getChildAt(inx++)).update(space); ! } ! ((GenericNode)getChildAt(inx++)).update(space.getConstructors()); ! int placement = inx; ! if (s.getModellor() != null) { ! if (getChildCount() >= placement + 1) { ! ((GenericNode)getChildAt(placement)).update(space.getModellor()); ! } else { ! add(new ModellorNode(s.getModellor())); ! model.nodesWereInserted(this, new int[]{placement}); ! } ! } else { ! if (getChildCount() == placement + 1) { ! TreeNode node = getChildAt(placement); ! remove(placement); ! model.nodesWereRemoved(this, new int[]{placement}, new Object[]{node}); ! } ! } } else { ! removeAllChildren(); ! makeContainerContent((Container) s); ! model.nodeStructureChanged(this); } } else { ! if (this.getChildCount() == 1) { ! ((GenericNode)getChildAt(0)).update(s.getEnvelope()); ! } else { ! removeAllChildren(); ! add(new SurfaceContainer("Envelope", s.getEnvelope(), false)); ! model.nodeStructureChanged(this); } } ! userObject = s; model.nodeChanged(this); } } ! /** ! * Return the displaystring for this EntityNode ! * @return Display string */ ! public String toString() { ! String nid = ((Space)userObject).getDisplayName(); ! return nid; } /** ! * Return icon ! * @return icon */ ! public ImageIcon icon() { ! if (((Space)userObject).isConstructionSpace()) { ! return constructionspaceicon; ! } else { ! return functionalspaceicon; } } --- 741,802 ---- public void update(Object o) { if (o instanceof Container) { ! Container space = (Container)o; ! int inx = 0; ! ((GenericNode)getChildAt(inx++)).update(space.getEnvelope()); ! ((GenericNode)getChildAt(inx++)).update(space.getElements()); ! ((GenericNode)getChildAt(inx++)).update(space.getConstructors()); ! if (Project.doDisplayGeometry()) { ! ((GenericNode)getChildAt(inx++)).update(space); ! } ! ! int placement = inx; ! if (space.getModellor() != null) { ! if (getChildCount() >= placement + 1) { ! ((GenericNode)getChildAt(placement)).update(space.getModellor()); } else { ! add(new ModellorNode(space.getModellor())); ! model.nodesWereInserted(this, new int[]{placement}); } } else { ! if (getChildCount() == placement + 1) { ! TreeNode node = getChildAt(placement); ! remove(placement); ! model.nodesWereRemoved(this, new int[]{placement}, new Object[]{node}); } } ! userObject = space; model.nodeChanged(this); } } ! } ! ! /** ! * ! */ ! public class VoidNode extends SpaceNode { /** ! * @param space Space */ ! public VoidNode(Space space) { ! super(space); ! add(new SurfaceContainer("Envelope", space.getEnvelope(), false)); } /** ! * Update the node with the given object ! * @param o The object */ ! public void update(Object o) { ! if (o instanceof Space) { ! Space s = (Space)o; ! if (this.getChildCount() == 1) { ! ((GenericNode)getChildAt(0)).update(s.getEnvelope()); ! } else { ! removeAllChildren(); ! add(new SurfaceContainer("Envelope", s.getEnvelope(), false)); ! model.nodeStructureChanged(this); ! } ! userObject = s; ! model.nodeChanged(this); } } *************** *** 839,843 **** if (constructor instanceof CoordinateSystem) { CoordinateSystem system = (CoordinateSystem) constructor; ! add(new ContainerNode("Relations", system.relations(), true)); update(system); } --- 885,889 ---- if (constructor instanceof CoordinateSystem) { CoordinateSystem system = (CoordinateSystem) constructor; ! add(new CompositeNode("Relations", system.relations(), true)); update(system); } *************** *** 936,940 **** * SurfaceContainer */ ! public class SurfaceContainer extends ContainerNode { /** * Constructor for SurfaceContainer --- 982,986 ---- * SurfaceContainer */ ! public class SurfaceContainer extends CompositeNode { /** * Constructor for SurfaceContainer *************** *** 964,968 **** * SurfaceContainer */ ! public class EnvelopeContainer extends ContainerNode { private Container space; /** --- 1010,1014 ---- * SurfaceContainer */ ! public class EnvelopeContainer extends CompositeNode { private Container space; /** *************** *** 995,999 **** * ElementContainer */ ! public class ElementContainer extends ContainerNode { /** * Constructor --- 1041,1045 ---- * ElementContainer */ ! public class ElementContainer extends CompositeNode { /** * Constructor *************** *** 1007,1011 **** /** {@inheritDoc} */ public EntityNode nodeFor(Object entity) { ! return new SpaceNode((Space) entity); } --- 1053,1066 ---- /** {@inheritDoc} */ public EntityNode nodeFor(Object entity) { ! Space space = (Space) entity; ! if (space.isVoid()) { ! return new VoidNode(space); ! } else if (space instanceof Container) { ! return new ContainerNode((Container) space); ! } else if (space instanceof Instance) { ! return new InstanceNode((Instance) space); ! } else { ! return new EntityNode(space); ! } } *************** *** 1056,1060 **** * Menu container for materials */ ! public class MaterialContainer extends ContainerNode { /** * Create a container for materials --- 1111,1115 ---- * Menu container for materials */ ! public class MaterialContainer extends CompositeNode { /** * Create a container for materials *************** *** 1105,1109 **** * Constructor Container */ ! public class ConstructorContainer extends ContainerNode { /** * Constructor --- 1160,1164 ---- * Constructor Container */ ! public class ConstructorContainer extends CompositeNode { /** * Constructor *************** *** 1132,1136 **** * EdgeContainer */ ! public class EdgeContainer extends ContainerNode { /** * Constructor for EdgeContainer --- 1187,1191 ---- * EdgeContainer */ ! public class EdgeContainer extends CompositeNode { /** * Constructor for EdgeContainer *************** *** 1160,1164 **** * CameraNode */ ! public class ProjectNode extends ContainerNode { /** * Constructor for EdgeContainer --- 1215,1219 ---- * CameraNode */ ! public class ProjectNode extends CompositeNode { /** * Constructor for EdgeContainer *************** *** 1188,1192 **** /** {@inheritDoc} */ public EntityNode nodeFor(Object entity) { ! return new SpaceNode((Space) entity); } } --- 1243,1256 ---- /** {@inheritDoc} */ public EntityNode nodeFor(Object entity) { ! Space space = (Space) entity; ! if (space.isVoid()) { ! return new VoidNode(space); ! } else if (space instanceof Container) { ! return new ContainerNode((Container) space); ! } else if (space instanceof Instance) { ! return new InstanceNode((Instance) space); ! } else { ! return new EntityNode(space); ! } } } *************** *** 1195,1199 **** * Component Container */ ! public class ComponentContainer extends ContainerNode { /** * Constructor for Catalog objects --- 1259,1263 ---- * Component Container */ ! public class ComponentContainer extends CompositeNode { /** * Constructor for Catalog objects *************** *** 1251,1255 **** * CameraNode */ ! public class CameraNode extends ContainerNode { /** * Constructor for EdgeContainer --- 1315,1319 ---- * CameraNode */ ! public class CameraNode extends CompositeNode { /** * Constructor for EdgeContainer *************** *** 1276,1280 **** * VertexContainer */ ! public class VertexContainer extends ContainerNode { /** * Constructor for EdgeContainer --- 1340,1344 ---- * VertexContainer */ ! public class VertexContainer extends CompositeNode { /** * Constructor for EdgeContainer *************** *** 1304,1308 **** * ParameterBlockNode */ ! public class ParameterBlockNode extends ContainerNode { /** * Constructor --- 1368,1372 ---- * ParameterBlockNode */ ! public class ParameterBlockNode extends CompositeNode { /** * Constructor *************** *** 1364,1368 **** * ConstraintContainer */ ! public class ConstraintContainer extends ContainerNode { /** * Constructor for ConstraintContainer --- 1428,1432 ---- * ConstraintContainer */ ! public class ConstraintContainer extends CompositeNode { /** * Constructor for ConstraintContainer *************** *** 1378,1382 **** * RelationContainer */ ! public class RelationContainer extends ContainerNode { /** * Constructs a RelationContainer --- 1442,1446 ---- * RelationContainer */ ! public class RelationContainer extends CompositeNode { /** * Constructs a RelationContainer |
From: Michael L. <he...@us...> - 2008-01-08 10:49:16
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13192/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Command.java Log Message: Improvement to bounding-sphere Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** Camera.java 7 Jan 2008 15:24:01 -0000 1.56 --- Camera.java 8 Jan 2008 10:49:19 -0000 1.57 *************** *** 483,503 **** */ public void zoomOn(Collection<? extends Geometric> c, double aspect, double d) { ! Set<Vertex> allVertices = new HashSet<Vertex>(); ! for (Geometric g : c) { ! if (g instanceof Container) { ! Container s = (Container)g; ! if (s.getEnvelope().isEmpty()) { ! allVertices.addAll(s.collectInterior()); ! } else { ! allVertices.addAll(Geometry.collect(s.getEnvelope())); ! } ! } else { ! allVertices.addAll(g.collect()); ! } ! } ! if (!allVertices.isEmpty()) { ! Command.BoundingSphere sphere = new Command.BoundingSphere(allVertices); double radius = sphere.radius(); Vertex modelCenter = sphere.center(); --- 483,491 ---- */ public void zoomOn(Collection<? extends Geometric> c, double aspect, double d) { ! Set<Vertex> all = Geometry.collect(c); ! if (!all.isEmpty()) { ! Command.BoundingSphere sphere = new Command.BoundingSphere(all); double radius = sphere.radius(); Vertex modelCenter = sphere.center(); Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** Command.java 17 Dec 2007 13:09:16 -0000 1.60 --- Command.java 8 Jan 2008 10:49:19 -0000 1.61 *************** *** 2138,2141 **** --- 2138,2144 ---- center = v1.add(v2).scale(0.5); + center.x = (xmin.x + xmax.x) / 2; + center.y = (ymin.y + ymax.y) / 2; + center.z = (zmin.z + zmax.z) / 2; radius = dia / 2; |
From: Michael L. <he...@us...> - 2008-01-08 10:49:15
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13179/src/net/sourceforge/bprocessor/gl/view Modified Files: PopupMenu.java Log Message: Improvement to bounding-sphere Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/PopupMenu.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PopupMenu.java 7 Jan 2008 14:52:02 -0000 1.7 --- PopupMenu.java 8 Jan 2008 10:49:16 -0000 1.8 *************** *** 52,55 **** --- 52,56 ---- import net.sourceforge.bprocessor.model.SurfaceAnalysis; import net.sourceforge.bprocessor.model.Vertex; + import net.sourceforge.bprocessor.model.Command.BoundingSphere; import net.sourceforge.bprocessor.model.modellor.Modellor; *************** *** 707,712 **** { AbstractAction action = new AbstractAction("Bounding Sphere") { public void actionPerformed(ActionEvent event) { ! } }; --- 708,755 ---- { AbstractAction action = new AbstractAction("Bounding Sphere") { + private Container circle(Vertex i, Vertex j, Vertex origin, double radius) { + Container union = new Container("Circle", Container.CONSTRUCTION, true); + union.setUnion(true); + LinkedList<Vertex> vertices = new LinkedList(); + int n = 64; + for (int s = 0; s < n; s++) { + double angle = 2 * s * Math.PI / n; + double x = radius * Math.cos(angle); + double y = radius * Math.sin(angle); + Vertex vertex = origin.add(i.scale(x)).add(j.scale(y)); + vertices.add(vertex); + union.add(vertex); + } + List<Edge> edges = new LinkedList(); + Vertex previous = vertices.getLast(); + for (Vertex current : vertices) { + Edge edge = new Edge(previous, current); + previous = current; + edges.add(edge); + union.add(edge); + } + return union; + } public void actionPerformed(ActionEvent event) { ! Set<Vertex> all = Project.getInstance().world().collect(); ! BoundingSphere sphere = new BoundingSphere(all); ! CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); ! Vertex i = system.getI(); ! Vertex j = system.getJ(); ! Vertex k = system.getN(); ! Vertex origin = sphere.center(); ! double radius = sphere.radius(); ! { ! Space circle = circle(i, j, origin, radius); ! Project.getInstance().world().add(circle); ! } ! { ! Space circle = circle(j, k, origin, radius); ! Project.getInstance().world().add(circle); ! } ! { ! Space circle = circle(k, i, origin, radius); ! Project.getInstance().world().add(circle); ! } } }; |
From: Michael L. <he...@us...> - 2008-01-07 15:24:16
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31808/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Log Message: fixed zoomon to correspond to new focalwidth calculations Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** Camera.java 7 Jan 2008 14:52:06 -0000 1.55 --- Camera.java 7 Jan 2008 15:24:01 -0000 1.56 *************** *** 480,485 **** * @param aspect the acspect ratio of the view. * @param c the Collection of object to zoom on to. */ ! public void zoomOn(Collection<? extends Geometric> c, double aspect) { Set<Vertex> allVertices = new HashSet<Vertex>(); for (Geometric g : c) { --- 480,486 ---- * @param aspect the acspect ratio of the view. * @param c the Collection of object to zoom on to. + * @param d adjust of focalwidth */ ! public void zoomOn(Collection<? extends Geometric> c, double aspect, double d) { Set<Vertex> allVertices = new HashSet<Vertex>(); for (Geometric g : c) { *************** *** 503,507 **** //Setting up camera ! double halfFocal = this.getFocalwidth() / 2.0; double halfFocalVerTan = Math.tan(Math.toRadians(halfFocal)); double halfFocalHorTan = halfFocalVerTan * aspect; --- 504,508 ---- //Setting up camera ! double halfFocal = d * getFocalwidth() / 2.0; double halfFocalVerTan = Math.tan(Math.toRadians(halfFocal)); double halfFocalHorTan = halfFocalVerTan * aspect; *************** *** 700,704 **** Collection<Surface> c = new LinkedList<Surface>(); c.add(s); ! currentCamera.zoomOn(c, 1.0); } --- 701,705 ---- Collection<Surface> c = new LinkedList<Surface>(); c.add(s); ! currentCamera.zoomOn(c, 1.0, 1.0); } |
From: Michael L. <he...@us...> - 2008-01-07 15:23:51
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31789/src/net/sourceforge/bprocessor/gl/tool Modified Files: ToolFactory.java Log Message: fixed zoomon to correspond to new focalwidth calculations Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** ToolFactory.java 27 Dec 2007 23:14:24 -0000 1.102 --- ToolFactory.java 7 Jan 2008 15:23:55 -0000 1.103 *************** *** 8,11 **** --- 8,12 ---- import net.sourceforge.bprocessor.gl.Editor; + import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.gui.Toolbar; *************** *** 237,246 **** public void actionPerformed(ActionEvent agr0) { double aspect = editor.getView().getAspect(); if (Selection.primary().isEmpty()) { List list = new LinkedList(); list.add(Project.getInstance().getActiveSpace()); ! Project.getInstance().getCurrentCamera().zoomOn(list, aspect); } else { ! Project.getInstance().getCurrentCamera().zoomOn(Selection.primary(), aspect); } this.editor.repaint(); --- 238,248 ---- public void actionPerformed(ActionEvent agr0) { double aspect = editor.getView().getAspect(); + double d = View.getHeight() / Camera.STANDARD_HEIGHT; if (Selection.primary().isEmpty()) { List list = new LinkedList(); list.add(Project.getInstance().getActiveSpace()); ! Project.getInstance().getCurrentCamera().zoomOn(list, aspect, d); } else { ! Project.getInstance().getCurrentCamera().zoomOn(Selection.primary(), aspect, d); } this.editor.repaint(); |
From: Michael L. <he...@us...> - 2008-01-07 15:23:51
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31789/src/net/sourceforge/bprocessor/gl/view Modified Files: GLPreviewPanel.java Log Message: fixed zoomon to correspond to new focalwidth calculations Index: GLPreviewPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/GLPreviewPanel.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GLPreviewPanel.java 12 Dec 2007 13:07:14 -0000 1.6 --- GLPreviewPanel.java 7 Jan 2008 15:23:54 -0000 1.7 *************** *** 77,81 **** this.camera = new Camera("Preview", new double[]{0, 0, 0}, new double[]{100, 100, 100}, new double[]{0, 0, 1}, Camera.PERSPECTIVE); ! camera.zoomOn(cams, (double)150 / (double)200); repaint(); } --- 77,81 ---- this.camera = new Camera("Preview", new double[]{0, 0, 0}, new double[]{100, 100, 100}, new double[]{0, 0, 1}, Camera.PERSPECTIVE); ! camera.zoomOn(cams, (double)150 / (double)200, 1.0); repaint(); } |
From: Michael L. <he...@us...> - 2008-01-07 14:52:09
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19726/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Log Message: renamed CONVETIONAL to STANDARD Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** Camera.java 17 Dec 2007 13:09:16 -0000 1.54 --- Camera.java 7 Jan 2008 14:52:06 -0000 1.55 *************** *** 42,46 **** /** The standard window height */ ! public static final int CONVETIONAL_WINDOW_HEIGHT = 600; /** The logger */ --- 42,46 ---- /** The standard window height */ ! public static final int STANDARD_HEIGHT = 448; /** The logger */ *************** *** 734,738 **** int dpi = Toolkit.getDefaultToolkit().getScreenResolution(); double dpm = (dpi / 2.54) * 100; ! double windowheight = CONVETIONAL_WINDOW_HEIGHT / dpm; return tal / windowheight; } --- 734,738 ---- int dpi = Toolkit.getDefaultToolkit().getScreenResolution(); double dpm = (dpi / 2.54) * 100; ! double windowheight = STANDARD_HEIGHT / dpm; return tal / windowheight; } *************** *** 745,749 **** int dpi = Toolkit.getDefaultToolkit().getScreenResolution(); double dpm = (dpi / 2.54) * 100; ! double window = CONVETIONAL_WINDOW_HEIGHT / dpm; double length = current.getFactor() * window; length /= Math.tan(Math.toRadians(current.getFocalwidth())); --- 745,749 ---- int dpi = Toolkit.getDefaultToolkit().getScreenResolution(); double dpm = (dpi / 2.54) * 100; ! double window = STANDARD_HEIGHT / dpm; double length = current.getFactor() * window; length /= Math.tan(Math.toRadians(current.getFocalwidth())); |
From: Michael L. <he...@us...> - 2008-01-07 14:52:06
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19472/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java PopupMenu.java Log Message: renamed CONVETIONAL to STANDARD Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/PopupMenu.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PopupMenu.java 30 Dec 2007 23:21:17 -0000 1.6 --- PopupMenu.java 7 Jan 2008 14:52:02 -0000 1.7 *************** *** 705,708 **** --- 705,716 ---- menu.add(action); } + { + AbstractAction action = new AbstractAction("Bounding Sphere") { + public void actionPerformed(ActionEvent event) { + + } + }; + menu.add(action); + } return menu; } Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.274 retrieving revision 1.275 diff -C2 -d -r1.274 -r1.275 *** View.java 2 Jan 2008 11:31:09 -0000 1.274 --- View.java 7 Jan 2008 14:52:02 -0000 1.275 *************** *** 820,829 **** far = far < 20 ? 20 : far; double focalwidth = camera.getFocalwidth(); ! double d = View.height / Camera.CONVETIONAL_WINDOW_HEIGHT; if (camera.getType() == Camera.ORTHOGRAPHIC) { int dpi = Toolkit.getDefaultToolkit().getScreenResolution(); double relation = 2.54; double dpm = (dpi / relation) * 100; ! double windowInMeters = 600 / dpm; double tal = d * camera.getFactor() * windowInMeters / 2; gl.glOrtho(-tal * aspect, tal * aspect, -tal, tal, near, far); --- 820,829 ---- far = far < 20 ? 20 : far; double focalwidth = camera.getFocalwidth(); ! double d = View.height / Camera.STANDARD_HEIGHT; if (camera.getType() == Camera.ORTHOGRAPHIC) { int dpi = Toolkit.getDefaultToolkit().getScreenResolution(); double relation = 2.54; double dpm = (dpi / relation) * 100; ! double windowInMeters = Camera.STANDARD_HEIGHT / dpm; double tal = d * camera.getFactor() * windowInMeters / 2; gl.glOrtho(-tal * aspect, tal * aspect, -tal, tal, near, far); |
From: rimestad <rim...@us...> - 2008-01-02 11:31:07
|
Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5229/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java Log Message: Made the planes, spanned by coordinatesystems when showplane is true, generate a intersection when hitdetection is made Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** Display.java 30 Dec 2007 23:29:10 -0000 1.77 --- Display.java 2 Jan 2008 11:31:09 -0000 1.78 *************** *** 717,728 **** } if (system.showPlane()) { - int dist = 10; gl.glDepthMask(false); ! List<Vertex> corners = new LinkedList<Vertex>(); ! corners.add(system.unTranslate(new Vertex(dist / 2, dist / 2, 0))); ! corners.add(system.unTranslate(new Vertex(dist / 2, -dist / 2, 0))); ! corners.add(system.unTranslate(new Vertex(-dist / 2, -dist / 2, 0))); ! corners.add(system.unTranslate(new Vertex(-dist / 2, dist / 2, 0))); ! apply(misty, 0.3f); drawQuad(corners, false); gl.glDepthMask(true); --- 717,723 ---- } if (system.showPlane()) { gl.glDepthMask(false); ! List<Vertex> corners = system.getXYPlane(camera.distance(system.center()) * 8); ! apply(misty, 0.45f); drawQuad(corners, false); gl.glDepthMask(true); *************** *** 839,842 **** --- 834,846 ---- Collection<Edge> guides = current.guides(grid.size()); selectEdges(guides); + if (current instanceof CoordinateSystem) { + CoordinateSystem cs = (CoordinateSystem)current; + if (cs.showPlane()) { + List<Vertex> vertices = cs.getXYPlane(camera.distance(cs.center()) * 8); + push(current); + drawQuad(vertices, false); + pop(); + } + } } } Index: View.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.273 retrieving revision 1.274 diff -C2 -d -r1.273 -r1.274 *** View.java 28 Dec 2007 11:17:05 -0000 1.273 --- View.java 2 Jan 2008 11:31:09 -0000 1.274 *************** *** 1438,1525 **** } if (intersections) { ! Transformation transformation = this.transformation(); ! Vertex near = new Vertex(x, height - y, 0.0); ! Vertex far = new Vertex(x, height - y, 1.0); ! Edge ray = new Edge(near, far); ! ray = transformation.unProject(ray); ! if (vertex != null) { ! Vertex intersection = (Vertex)vertex.getLastInPath(); ! if (vertex.getPathLength() > 1) { ! intersection = (Vertex)vertex.translateOut(intersection); } ! return new Intersection(intersection, Intersection.VERTEX, intersection); ! } else { ! if (glo != null) { ! return glo.intersection(ray); ! } else if (edge != null) { ! Edge current = (Edge)edge.getLastInPath(); ! if (edge.getPathLength() > 1) { ! current = (Edge)edge.translateOut(current); ! } ! if (!current.getStrippled()) { ! Vertex m = current.getFrom().add(current.getTo()); ! m.scaleIt(0.5); ! Vertex projected = transformation.project(m); ! double dx = x - projected.getX(); ! double dy = (height - y) - projected.getY(); ! double distance = Math.sqrt(dx * dx + dy * dy); ! if (distance < 5) { ! return new Intersection(m, Intersection.EDGE_MIDPOINT, current); ! } ! } ! Edge e1 = current; ! Vertex v1 = e1.getTo().minus(e1.getFrom()); ! Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! Edge e2 = (Edge) iter.next(); ! Vertex v2 = e2.getTo().minus(e2.getFrom()); ! Vertex cross = v1.cross(v2); ! if (!cross.isZero()) { ! Edge intersect = e1.shortestEdge(e2); ! if (intersect != null) { ! if (intersect.getLength() < 0.0000001) { ! Vertex i = intersect.getFrom(); ! Vertex projected = transformation.project(i); ! double dx = x - projected.getX(); ! double dy = (height - y) - projected.getY(); ! double distance = Math.sqrt(dx * dx + dy * dy); ! if (distance < 5) { ! return new Intersection(i, Intersection.EDGE_INTERSECTION, current); ! } ! } ! } ! } } ! { ! if (lastSurface != null) { ! if (!unWantedEntities.contains(lastSurface)) { ! Plane plane = lastSurface.plane(); ! Vertex intersection = plane.intersection(current); ! if (intersection != null) { ! Vertex projected = transformation.project(intersection); ! double dx = x - projected.getX(); ! double dy = (height - y) - projected.getY(); ! double distance = Math.sqrt(dx * dx + dy * dy); ! if (distance < 5) { ! return new Intersection(intersection, ! Intersection.SURFACE_INTERSECTION, lastSurface); ! } } } } } ! { ! Edge intersect = current.shortestEdge(ray); ! Vertex intersection = intersect.getFrom(); ! return new Intersection(intersection, Intersection.EDGE, current); ! } ! } else { ! if (surface != null) { ! Surface theSurface = (Surface)surface.getLastInPath(); ! if (surface.getPathLength() > 1) { ! theSurface = (Surface)(surface.translateOut(theSurface)); ! } ! Plane plane = theSurface.plane(); ! for (Edge current : (Collection<Edge>) edges) { Vertex intersection = plane.intersection(current); if (intersection != null) { --- 1438,1519 ---- } if (intersections) { ! return findIntersected(unWantedEntities, xy, surface, vertex, edge, ! glo, object, edges); ! } else { ! if (object != null) { ! return object; ! } else if (vertex != null) { ! return vertex.getFirstInPath(); ! } else if (edge != null) { ! return edge.getFirstInPath(); ! } else if (surface != null) { ! return surface.getFirstInPath(); ! } else if (glo != null) { ! return glo; ! } ! } ! return null; ! } ! ! private Intersection findIntersected(Collection unWantedEntities, Plane xy, ! SelectionPath surface, SelectionPath vertex, SelectionPath edge, ! GlObject glo, Object object, Collection<Edge> edges) { ! Transformation transformation = this.transformation(); ! Vertex near = new Vertex(x, height - y, 0.0); ! Vertex far = new Vertex(x, height - y, 1.0); ! Edge ray = new Edge(near, far); ! ray = transformation.unProject(ray); ! if (vertex != null) { ! Vertex intersection = (Vertex)vertex.getLastInPath(); ! if (vertex.getPathLength() > 1) { ! intersection = (Vertex)vertex.translateOut(intersection); ! } ! return new Intersection(intersection, Intersection.VERTEX, intersection); ! } else { ! if (glo != null) { ! return glo.intersection(ray); ! } else if (edge != null) { ! Edge current = (Edge)edge.getLastInPath(); ! if (edge.getPathLength() > 1) { ! current = (Edge)edge.translateOut(current); } ! if (!current.getStrippled()) { ! Vertex m = current.getFrom().add(current.getTo()); ! m.scaleIt(0.5); ! Vertex projected = transformation.project(m); ! double dx = x - projected.getX(); ! double dy = (height - y) - projected.getY(); ! double distance = Math.sqrt(dx * dx + dy * dy); ! if (distance < 5) { ! return new Intersection(m, Intersection.EDGE_MIDPOINT, current); } ! } ! Edge e1 = current; ! Vertex v1 = e1.getTo().minus(e1.getFrom()); ! Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! Edge e2 = (Edge) iter.next(); ! Vertex v2 = e2.getTo().minus(e2.getFrom()); ! Vertex cross = v1.cross(v2); ! if (!cross.isZero()) { ! Edge intersect = e1.shortestEdge(e2); ! if (intersect != null) { ! if (intersect.getLength() < 0.0000001) { ! Vertex i = intersect.getFrom(); ! Vertex projected = transformation.project(i); ! double dx = x - projected.getX(); ! double dy = (height - y) - projected.getY(); ! double distance = Math.sqrt(dx * dx + dy * dy); ! if (distance < 5) { ! return new Intersection(i, Intersection.EDGE_INTERSECTION, current); } } } } ! } ! { ! if (lastSurface != null) { ! if (!unWantedEntities.contains(lastSurface)) { ! Plane plane = lastSurface.plane(); Vertex intersection = plane.intersection(current); if (intersection != null) { *************** *** 1530,1566 **** if (distance < 5) { return new Intersection(intersection, ! Intersection.SURFACE_INTERSECTION, theSurface); } } } ! Vertex intersection = plane.intersection(ray); ! return new Intersection(intersection, Intersection.SURFACE, theSurface); ! } else if (object instanceof ClippingPlane) { ! // find out what is intersected ! Plane p = ((ClippingPlane)object).getPlane(); ! Vertex intersection = p.intersection(ray); ! if (intersection != null) { ! return new Intersection(intersection, Intersection.PLANE_INTERSECTION, p); ! } ! } else { ! Vertex intersection = xy.intersection(ray); if (intersection != null) { ! return new Intersection(intersection, Intersection.PLANE_INTERSECTION, xy); } } } } - } else { - if (object != null) { - return object; - } else if (vertex != null) { - return vertex.getFirstInPath(); - } else if (edge != null) { - return edge.getFirstInPath(); - } else if (surface != null) { - return surface.getFirstInPath(); - } else if (glo != null) { - return glo; - } } return null; --- 1524,1581 ---- if (distance < 5) { return new Intersection(intersection, ! Intersection.SURFACE_INTERSECTION, lastSurface); } } } ! } ! } ! { ! Edge intersect = current.shortestEdge(ray); ! Vertex intersection = intersect.getFrom(); ! return new Intersection(intersection, Intersection.EDGE, current); ! } ! } else { ! if (surface != null) { ! Surface theSurface = (Surface)surface.getLastInPath(); ! if (surface.getPathLength() > 1) { ! theSurface = (Surface)(surface.translateOut(theSurface)); ! } ! Plane plane = theSurface.plane(); ! for (Edge current : (Collection<Edge>) edges) { ! Vertex intersection = plane.intersection(current); if (intersection != null) { ! Vertex projected = transformation.project(intersection); ! double dx = x - projected.getX(); ! double dy = (height - y) - projected.getY(); ! double distance = Math.sqrt(dx * dx + dy * dy); ! if (distance < 5) { ! return new Intersection(intersection, ! Intersection.SURFACE_INTERSECTION, theSurface); ! } } } + Vertex intersection = plane.intersection(ray); + return new Intersection(intersection, Intersection.SURFACE, theSurface); + } else if (object instanceof ClippingPlane) { + // find out what is intersected + Plane p = ((ClippingPlane)object).getPlane(); + Vertex intersection = p.intersection(ray); + if (intersection != null) { + return new Intersection(intersection, Intersection.PLANE_INTERSECTION, p); + } + } else if (object instanceof CoordinateSystem) { + // find out what is intersected + Plane p = ((CoordinateSystem)object).plane(); + Vertex intersection = p.intersection(ray); + if (intersection != null) { + return new Intersection(intersection, Intersection.PLANE_INTERSECTION, p); + } + } else { + Vertex intersection = xy.intersection(ray); + if (intersection != null) { + return new Intersection(intersection, Intersection.PLANE_INTERSECTION, xy); + } } } } return null; |
From: rimestad <rim...@us...> - 2008-01-02 11:31:07
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4865/src/net/sourceforge/bprocessor/model Modified Files: CoordinateSystem.java Log Message: Made the planes, spanned by coordinatesystems when showplane is true, generate a intersection when hitdetection is made Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** CoordinateSystem.java 30 Dec 2007 23:29:06 -0000 1.75 --- CoordinateSystem.java 2 Jan 2008 11:31:03 -0000 1.76 *************** *** 1094,1096 **** --- 1094,1110 ---- Geometry.rotate(angle, dir.getX(), dir.getY(), dir.getZ(), getN(), zero); } + + /** + * Return a list with four verties at the corners of the plane in XY with size dist: + * @param dist the size of the plane + * @return The four corners + */ + public List<Vertex> getXYPlane(double dist) { + List<Vertex> corners = new LinkedList<Vertex>(); + corners.add(this.unTranslate(new Vertex(dist / 2, dist / 2, 0))); + corners.add(this.unTranslate(new Vertex(dist / 2, -dist / 2, 0))); + corners.add(this.unTranslate(new Vertex(-dist / 2, -dist / 2, 0))); + corners.add(this.unTranslate(new Vertex(-dist / 2, dist / 2, 0))); + return corners; + } } |
From: rimestad <rim...@us...> - 2007-12-30 23:29:17
|
Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18744/src/net/sourceforge/bprocessor/gl/tool Modified Files: EdgeMoveTool.java AbstractPencil.java AltMoveTool.java Log Message: Renamed onlyPlane to showPlane Index: EdgeMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool/EdgeMoveTool.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** EdgeMoveTool.java 13 Dec 2007 12:00:49 -0000 1.8 --- EdgeMoveTool.java 30 Dec 2007 23:29:10 -0000 1.9 *************** *** 158,162 **** if (!coordMap.containsKey(surface)) { CoordinateSystem system = surface.coordinateSystem(); ! system.onlyPlane(false); system.setActive(true); coordMap.put(surface, system); --- 158,162 ---- if (!coordMap.containsKey(surface)) { CoordinateSystem system = surface.coordinateSystem(); ! system.showPlane(false); system.setActive(true); coordMap.put(surface, system); Index: AltMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool/AltMoveTool.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** AltMoveTool.java 13 Dec 2007 12:00:49 -0000 1.17 --- AltMoveTool.java 30 Dec 2007 23:29:10 -0000 1.18 *************** *** 120,124 **** if (system == null) { system = surface.coordinateSystem(); ! system.onlyPlane(true); system.setActive(true); } --- 120,124 ---- if (system == null) { system = surface.coordinateSystem(); ! system.showPlane(true); system.setActive(true); } Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** AbstractPencil.java 30 Dec 2007 23:24:32 -0000 1.105 --- AbstractPencil.java 30 Dec 2007 23:29:10 -0000 1.106 *************** *** 602,610 **** if (cs.isEditable()) { if (hooverConstructor != null) { ! hooverConstructor.onlyPlane(false); } ! if (!cs.onlyPlane()) { hooverConstructor = (CoordinateSystem)p; ! hooverConstructor.onlyPlane(true); } } --- 602,610 ---- if (cs.isEditable()) { if (hooverConstructor != null) { ! hooverConstructor.showPlane(false); } ! if (!cs.showPlane()) { hooverConstructor = (CoordinateSystem)p; ! hooverConstructor.showPlane(true); } } *************** *** 818,822 **** hooverEdge = null; if (hooverConstructor != null) { ! hooverConstructor.onlyPlane(false); } hooverConstructor = null; --- 818,822 ---- hooverEdge = null; if (hooverConstructor != null) { ! hooverConstructor.showPlane(false); } hooverConstructor = null; |
From: rimestad <rim...@us...> - 2007-12-30 23:29:17
|
Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18744/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: Renamed onlyPlane to showPlane Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** Display.java 30 Dec 2007 23:22:32 -0000 1.76 --- Display.java 30 Dec 2007 23:29:10 -0000 1.77 *************** *** 716,720 **** paint(zaxis, darkgrey); } ! if (system.onlyPlane()) { int dist = 10; gl.glDepthMask(false); --- 716,720 ---- paint(zaxis, darkgrey); } ! if (system.showPlane()) { int dist = 10; gl.glDepthMask(false); |
From: rimestad <rim...@us...> - 2007-12-30 23:29:17
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18488/src/net/sourceforge/bprocessor/model Modified Files: Persistence.java CoordinateSystem.java Log Message: Renamed onlyPlane to showPlane Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** Persistence.java 17 Dec 2007 10:24:27 -0000 1.72 --- Persistence.java 30 Dec 2007 23:29:06 -0000 1.73 *************** *** 563,567 **** CoordinateSystem res = new CoordinateSystem(); CoordinateSystemType cst = (CoordinateSystemType)xml; ! res.onlyPlane(cst.isOnlyplane()); List ijn = cst.getIjn().getVertex(); Vertex i = internalizeVertex(null, (VertexType)ijn.get(0), new HashMap(), new LinkedList()); --- 563,567 ---- CoordinateSystem res = new CoordinateSystem(); CoordinateSystemType cst = (CoordinateSystemType)xml; ! res.showPlane(cst.isOnlyplane()); List ijn = cst.getIjn().getVertex(); Vertex i = internalizeVertex(null, (VertexType)ijn.get(0), new HashMap(), new LinkedList()); *************** *** 1155,1159 **** private static CoordinateSystemType externalizeCoordinateSystem(CoordinateSystem cs, Map map) { CoordinateSystemType xml = new CoordinateSystemTypeImpl(); ! xml.setOnlyplane(cs.onlyPlane()); VertexesType vt = new VertexesTypeImpl(); List ijn = vt.getVertex(); --- 1155,1159 ---- private static CoordinateSystemType externalizeCoordinateSystem(CoordinateSystem cs, Map map) { CoordinateSystemType xml = new CoordinateSystemTypeImpl(); ! xml.setOnlyplane(cs.showPlane()); VertexesType vt = new VertexesTypeImpl(); List ijn = vt.getVertex(); Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** CoordinateSystem.java 30 Dec 2007 23:24:27 -0000 1.74 --- CoordinateSystem.java 30 Dec 2007 23:29:06 -0000 1.75 *************** *** 720,724 **** } //setActive(((Boolean)(((Attribute)attributes.get(16)).getValue())).booleanValue()); ! onlyPlane(((Boolean)(((Attribute)attributes.get(16)).getValue())).booleanValue()); setEditable(((Boolean)(((Attribute)attributes.get(17)).getValue())).booleanValue()); update(); --- 720,724 ---- } //setActive(((Boolean)(((Attribute)attributes.get(16)).getValue())).booleanValue()); ! showPlane(((Boolean)(((Attribute)attributes.get(16)).getValue())).booleanValue()); setEditable(((Boolean)(((Attribute)attributes.get(17)).getValue())).booleanValue()); update(); *************** *** 750,754 **** res.add(new Attribute("Active", Boolean.FALSE)); }*/ ! if (onlyPlane()) { res.add(new Attribute("Show plane", Boolean.TRUE)); } else { --- 750,754 ---- res.add(new Attribute("Active", Boolean.FALSE)); }*/ ! if (showPlane()) { res.add(new Attribute("Show plane", Boolean.TRUE)); } else { *************** *** 765,781 **** /** ! * Check of onlyPlane boolean ! * @return True if coordinatesystem only should be drawn as a plane */ ! public boolean onlyPlane() { return showPlane; } /** ! * Setter for onlyPlane ! * @param what The value for onlyPlane */ ! public void onlyPlane(boolean what) { ! showPlane = what; } --- 765,781 ---- /** ! * Is the plane shown for this coordinatesystem ! * @return thue if the plane is shown */ ! public boolean showPlane() { return showPlane; } /** ! * Setter for showPlane field ! * @param show should the plane (xy) be shown */ ! public void showPlane(boolean show) { ! showPlane = show; } *************** *** 859,863 **** to = o.add(j); list.add(new Guide(from, to)); ! if (!onlyPlane()) { Vertex n = getN().copy(); n.scaleIt(size); --- 859,863 ---- to = o.add(j); list.add(new Guide(from, to)); ! if (!showPlane()) { Vertex n = getN().copy(); n.scaleIt(size); |
From: rimestad <rim...@us...> - 2007-12-30 23:26:00
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16848/src/net/sourceforge/bprocessor/model Modified Files: CoordinateSystem.java Log Message: when hoovering over a coordinatesystem it is shows its xy plane... still need to implement intersection with it... Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** CoordinateSystem.java 17 Dec 2007 18:35:22 -0000 1.73 --- CoordinateSystem.java 30 Dec 2007 23:24:27 -0000 1.74 *************** *** 41,45 **** /** True if the coordinate system should be treated as a plane */ ! private boolean onlyPlane; /** Relations */ --- 41,45 ---- /** True if the coordinate system should be treated as a plane */ ! private boolean showPlane; /** Relations */ *************** *** 201,205 **** j = new Vertex(0, 1, 0); n = new Vertex(0, 0, 1); ! onlyPlane = false; relations = new LinkedList<Relation>(); } --- 201,205 ---- j = new Vertex(0, 1, 0); n = new Vertex(0, 0, 1); ! showPlane = false; relations = new LinkedList<Relation>(); } *************** *** 217,221 **** this.j = j; this.n = n; ! onlyPlane = false; relations = new LinkedList<Relation>(); } --- 217,221 ---- this.j = j; this.n = n; ! showPlane = false; relations = new LinkedList<Relation>(); } *************** *** 719,725 **** this.n = n; } ! setActive(((Boolean)(((Attribute)attributes.get(16)).getValue())).booleanValue()); ! onlyPlane(((Boolean)(((Attribute)attributes.get(17)).getValue())).booleanValue()); ! setEditable(((Boolean)(((Attribute)attributes.get(18)).getValue())).booleanValue()); update(); } --- 719,725 ---- this.n = n; } ! //setActive(((Boolean)(((Attribute)attributes.get(16)).getValue())).booleanValue()); ! onlyPlane(((Boolean)(((Attribute)attributes.get(16)).getValue())).booleanValue()); ! setEditable(((Boolean)(((Attribute)attributes.get(17)).getValue())).booleanValue()); update(); } *************** *** 745,757 **** res.add(new Attribute("z", new Double(getN().getZ()))); ! if (isActive()) { res.add(new Attribute("Active", Boolean.TRUE)); } else { res.add(new Attribute("Active", Boolean.FALSE)); ! } if (onlyPlane()) { ! res.add(new Attribute("Only plane", Boolean.TRUE)); } else { ! res.add(new Attribute("Only plane", Boolean.FALSE)); } res.add(new Attribute("Editable", Boolean.valueOf(isEditable()))); --- 745,757 ---- res.add(new Attribute("z", new Double(getN().getZ()))); ! /*if (isActive()) { res.add(new Attribute("Active", Boolean.TRUE)); } else { res.add(new Attribute("Active", Boolean.FALSE)); ! }*/ if (onlyPlane()) { ! res.add(new Attribute("Show plane", Boolean.TRUE)); } else { ! res.add(new Attribute("Show plane", Boolean.FALSE)); } res.add(new Attribute("Editable", Boolean.valueOf(isEditable()))); *************** *** 769,773 **** */ public boolean onlyPlane() { ! return onlyPlane; } --- 769,773 ---- */ public boolean onlyPlane() { ! return showPlane; } *************** *** 777,781 **** */ public void onlyPlane(boolean what) { ! onlyPlane = what; } --- 777,781 ---- */ public void onlyPlane(boolean what) { ! showPlane = what; } |
From: rimestad <rim...@us...> - 2007-12-30 23:25:59
|
Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16856/src/net/sourceforge/bprocessor/gl/tool Modified Files: ConstructorTool.java AbstractPencil.java Log Message: when hoovering over a coordinatesystem it is shows its xy plane... still need to implement intersection with it... Index: ConstructorTool.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool/ConstructorTool.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ConstructorTool.java 7 Dec 2007 12:48:31 -0000 1.18 --- ConstructorTool.java 30 Dec 2007 23:24:32 -0000 1.19 *************** *** 76,80 **** Vertex k = i.cross(j); CoordinateSystem cs = new CoordinateSystem(i, j, k, p1); - cs.onlyPlane(true); cs.normalize(); Project.getInstance().getActiveSpace().add(cs); --- 76,79 ---- Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** AbstractPencil.java 20 Dec 2007 11:44:57 -0000 1.104 --- AbstractPencil.java 30 Dec 2007 23:24:32 -0000 1.105 *************** *** 129,132 **** --- 129,134 ---- /** A highlight for the lockingedge */ private Edge lockHighlightEdge; + + private CoordinateSystem hooverConstructor; private static final boolean FALSE = false; *************** *** 235,239 **** (Intersection) editor.getView().getObjectAtPoint(e.getX(), e.getY(), unwanted, View.INTERSECTIONS, work); - if (intersection != null) { Container space = Project.getInstance().getActiveSpace(); --- 237,240 ---- *************** *** 474,478 **** } } - if (hooverEdge != null) { Edge edge = hooverEdge; --- 475,478 ---- *************** *** 593,596 **** --- 593,615 ---- hooverEdge = (Edge) current.object(); } + if (current.object() instanceof Geometric) { + Geometric l = (Geometric)current.object(); + Geometric g = l.parent(); + if (g != null) { + Geometric p = g.parent(); + if (p instanceof CoordinateSystem) { + CoordinateSystem cs = (CoordinateSystem)p; + if (cs.isEditable()) { + if (hooverConstructor != null) { + hooverConstructor.onlyPlane(false); + } + if (!cs.onlyPlane()) { + hooverConstructor = (CoordinateSystem)p; + hooverConstructor.onlyPlane(true); + } + } + } + } + } switch (current.type()) { *************** *** 798,801 **** --- 817,824 ---- incident = null; hooverEdge = null; + if (hooverConstructor != null) { + hooverConstructor.onlyPlane(false); + } + hooverConstructor = null; lock = false; lockingEdge = null; |
From: rimestad <rim...@us...> - 2007-12-30 23:25:58
|
Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16056/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: changed drawQuad to that a list with 4 vertices and not at surface and changed drawing of onlyplane coordinatesystems Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** Display.java 28 Dec 2007 11:17:05 -0000 1.75 --- Display.java 30 Dec 2007 23:22:32 -0000 1.76 *************** *** 596,601 **** ! private static void drawQuad(Surface surface, boolean reverse) { ! List<Vertex> vertices = surface.getVertices(); Iterator<Vertex> iter = vertices.iterator(); Vertex v0 = iter.next(); --- 596,600 ---- ! private static void drawQuad(List<Vertex> vertices, boolean reverse) { Iterator<Vertex> iter = vertices.iterator(); Vertex v0 = iter.next(); *************** *** 622,626 **** private static void draw(Surface surface, boolean reverse) { if (surface.getEdges().size() == 4 && surface.getHoles().size() == 0) { ! drawQuad(surface, reverse); } else { glu.gluTessBeginPolygon(tesselator, null); --- 621,625 ---- private static void draw(Surface surface, boolean reverse) { if (surface.getEdges().size() == 4 && surface.getHoles().size() == 0) { ! drawQuad(surface.getVertices(), reverse); } else { glu.gluTessBeginPolygon(tesselator, null); *************** *** 717,722 **** paint(zaxis, darkgrey); } } ! private static void draw(CoordinateSystem system) { Vertex origin = system.getOrigin(); --- 716,733 ---- paint(zaxis, darkgrey); } + if (system.onlyPlane()) { + int dist = 10; + gl.glDepthMask(false); + List<Vertex> corners = new LinkedList<Vertex>(); + corners.add(system.unTranslate(new Vertex(dist / 2, dist / 2, 0))); + corners.add(system.unTranslate(new Vertex(dist / 2, -dist / 2, 0))); + corners.add(system.unTranslate(new Vertex(-dist / 2, -dist / 2, 0))); + corners.add(system.unTranslate(new Vertex(-dist / 2, dist / 2, 0))); + apply(misty, 0.3f); + drawQuad(corners, false); + gl.glDepthMask(true); + } } ! private static void draw(CoordinateSystem system) { Vertex origin = system.getOrigin(); |
From: rimestad <rim...@us...> - 2007-12-30 23:25:58
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16436/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Hopefully only one active coordinatesystem in the model Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.153 retrieving revision 1.154 diff -C2 -d -r1.153 -r1.154 *** Project.java 17 Dec 2007 14:20:37 -0000 1.153 --- Project.java 30 Dec 2007 23:23:20 -0000 1.154 *************** *** 795,798 **** --- 795,800 ---- */ public void setActiveCoordinateSystem(CoordinateSystem activeCoordinateSystem) { + this.activeCoordinateSystem.setActive(false); + activeCoordinateSystem.setActive(true); this.activeCoordinateSystem = activeCoordinateSystem; } |
From: rimestad <rim...@us...> - 2007-12-30 23:25:56
|
Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15677/src/net/sourceforge/bprocessor/gl/view Modified Files: PopupMenu.java Log Message: reset and align axis dont alter active coordinatesystem but keep it as it is Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view/PopupMenu.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PopupMenu.java 20 Dec 2007 14:19:51 -0000 1.5 --- PopupMenu.java 30 Dec 2007 23:21:17 -0000 1.6 *************** *** 527,538 **** if (entities.size() == 1) { Geometric geometric = entities.iterator().next(); ! CoordinateSystem system = systemFor(geometric); ! Vertex i = system.getI(); ! Vertex j = system.getJ(); ! Vertex n = system.getN(); ! Vertex o = system.getOrigin(); ! CoordinateSystem active = Project.getInstance().getActiveCoordinateSystem(); ! active.setIJN(i, j, n); ! active.setOrigin(o); Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); --- 527,531 ---- if (entities.size() == 1) { Geometric geometric = entities.iterator().next(); ! Project.getInstance().setActiveCoordinateSystem(systemFor(geometric)); Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); *************** *** 671,683 **** AbstractAction action = new AbstractAction("Reset Axes") { public void actionPerformed(ActionEvent event) { ! CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); ! Vertex i = new Vertex(1, 0, 0); ! Vertex j = new Vertex(0, 1, 0); ! Vertex n = new Vertex(0, 0, 1); ! Vertex o = new Vertex(0, 0, 0); ! system.setIJN(i, j, n); ! system.setOrigin(o); ! Project.getInstance().changed(Project.getInstance()); ! Project.getInstance().checkpoint(); } }; --- 664,677 ---- AbstractAction action = new AbstractAction("Reset Axes") { public void actionPerformed(ActionEvent event) { ! Project project = Project.getInstance(); ! for (Constructor current : project.world().getConstructors()) { ! if (current.getId() == 1) { ! project.setActiveCoordinateSystem( ! (CoordinateSystem)current); ! break; ! } ! } ! project.changed(project); ! project.checkpoint(); } }; |