[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view View.java, 1.292, 1.293 Display.java,
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2010-02-05 13:33:07
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4483/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java PopupMenu.java Log Message: Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** Display.java 13 Jan 2010 10:58:30 -0000 1.100 --- Display.java 5 Feb 2010 13:32:59 -0000 1.101 *************** *** 928,932 **** paint(space.getAnchor()); } else { ! paint(space.getAnchor()); } translateToCoordinatesystem(space); --- 928,932 ---- paint(space.getAnchor()); } else { ! // paint(space.getAnchor()); } translateToCoordinatesystem(space); Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/PopupMenu.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** PopupMenu.java 9 Sep 2009 10:31:03 -0000 1.37 --- PopupMenu.java 5 Feb 2010 13:32:59 -0000 1.38 *************** *** 521,574 **** return pm; } - - private CoordinateSystem systemFor(Geometric geometric) { - if (geometric instanceof Vertex) { - return systemFor((Vertex) geometric); - } else if (geometric instanceof Surface) { - return systemFor((Surface) geometric); - } else if (geometric instanceof CoordinateSystem) { - return (CoordinateSystem) geometric; - } else { - CoordinateSystem active = Project.getInstance().getActiveCoordinateSystem(); - return active.copy(geometric.center()); - } - } - - private CoordinateSystem systemFor(Vertex vertex) { - Collection<Edge> edges = vertex.getEdges(); - if (edges.size() == 0) { - CoordinateSystem active = Project.getInstance().getActiveCoordinateSystem(); - return active.copy(vertex.copy()); - } else { - double x = 0; - double y = 0; - double z = 0; - for (Edge current : edges) { - Vertex other = current.otherVertex(vertex); - Vertex v = other.minus(vertex); - x += v.getX(); - y += v.getY(); - z += v.getZ(); - } - x /= edges.size(); - y /= edges.size(); - z /= edges.size(); - Vertex n = new Vertex(-x, -y, -z); - Edge edge = edges.iterator().next(); - Vertex other = edge.otherVertex(vertex); - - Vertex v = other.minus(vertex); - Vertex i = n.cross(v); - Vertex j = n.cross(i); - Vertex o = vertex.copy(); - return new CoordinateSystem(i, j, n, o); - } - } - - private CoordinateSystem systemFor(Surface surface) { - Vertex normal = surface.normal(); - Vertex origin = surface.center(); - return CoordinateSystem.systemFor(origin, normal); - } /** --- 521,524 ---- *************** *** 586,590 **** Project.getInstance().changed(current); } ! Project.getInstance().changed(Geometry.collect(entities)); Project.getInstance().checkpoint(); --- 536,540 ---- Project.getInstance().changed(current); } ! Project.getInstance().changed(Geometric.collect(entities)); Project.getInstance().checkpoint(); *************** *** 673,677 **** if (entities.size() == 1) { Geometric geometric = entities.iterator().next(); ! Project.getInstance().setActiveCoordinateSystem(systemFor(geometric)); Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); --- 623,627 ---- if (entities.size() == 1) { Geometric geometric = entities.iterator().next(); ! Project.getInstance().setActiveCoordinateSystem(CoordinateSystem.systemFor(geometric)); Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); *************** *** 684,688 **** AbstractAction action = new GeometricMenuAction(arguments, "Scale...") { public void actionPerformed(ActionEvent event) { ! Set<Vertex> vertices = Geometry.collect(entities); Vertex center = null; --- 634,638 ---- AbstractAction action = new GeometricMenuAction(arguments, "Scale...") { public void actionPerformed(ActionEvent event) { ! Set<Vertex> vertices = Geometric.collect(entities); Vertex center = null; *************** *** 712,716 **** AbstractAction action = new GeometricMenuAction(arguments, "Translate...") { public void actionPerformed(ActionEvent event) { ! Set<Vertex> vertices = Geometry.collect(entities); Vertex center = null; --- 662,666 ---- AbstractAction action = new GeometricMenuAction(arguments, "Translate...") { public void actionPerformed(ActionEvent event) { ! Set<Vertex> vertices = Geometric.collect(entities); Vertex center = null; *************** *** 741,745 **** AbstractAction action = new GeometricMenuAction(arguments, "Rotate...") { public void actionPerformed(ActionEvent event) { ! Set<Vertex> vertices = Geometry.collect(entities); Vertex center = null; --- 691,695 ---- AbstractAction action = new GeometricMenuAction(arguments, "Rotate...") { public void actionPerformed(ActionEvent event) { ! Set<Vertex> vertices = Geometric.collect(entities); Vertex center = null; *************** *** 770,774 **** AbstractAction action = new GeometricMenuAction(arguments, "Transform In") { public void actionPerformed(ActionEvent event) { ! List<Vertex> vertices = new ArrayList(Geometry.collect(entities)); CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system.unTranslateIt(vertices); --- 720,724 ---- AbstractAction action = new GeometricMenuAction(arguments, "Transform In") { public void actionPerformed(ActionEvent event) { ! List<Vertex> vertices = new ArrayList(Geometric.collect(entities)); CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system.unTranslateIt(vertices); *************** *** 785,789 **** AbstractAction action = new GeometricMenuAction(arguments, "Transform Out") { public void actionPerformed(ActionEvent event) { ! List<Vertex> vertices = new ArrayList(Geometry.collect(entities)); CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system.translateIt(vertices); --- 735,739 ---- AbstractAction action = new GeometricMenuAction(arguments, "Transform Out") { public void actionPerformed(ActionEvent event) { ! List<Vertex> vertices = new ArrayList(Geometric.collect(entities)); CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system.translateIt(vertices); Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.292 retrieving revision 1.293 diff -C2 -d -r1.292 -r1.293 *** View.java 5 Oct 2009 10:50:24 -0000 1.292 --- View.java 5 Feb 2010 13:32:59 -0000 1.293 *************** *** 1587,1590 **** --- 1587,1612 ---- } } + + { + System.out.println("-- process select --"); + if (surface != null) { + System.out.println(" surface: " + surface.getLastInPath()); + } else { + System.out.println(" surface: null"); + } + if (vertex != null) { + System.out.println(" vertex: " + vertex.getLastInPath()); + } else { + System.out.println(" vertex: null"); + } + if (edge != null) { + System.out.println(" edge: " + edge.getLastInPath()); + } else { + System.out.println(" edge: null"); + } + System.out.println(" glo: " + glo); + + } + if (surface != null) { if (unWantedEntities.contains(surface.getLastInPath())) { *************** *** 1598,1601 **** --- 1620,1624 ---- if (nearestSurface < nearestVertex) { if (plane != null && !plane.contains((Vertex)vertex.getLastInPath())) { + System.out.println(" surface kills vertex"); vertex = null; } *************** *** 1615,1618 **** --- 1638,1642 ---- if (!((Edge)edge.getLastInPath()).intersects((Vertex)vertex.getLastInPath())) { vertex = null; + System.out.println(" edge kills vertex"); } else { edge = null; *************** *** 1663,1671 **** surface = null; edge = null; ! vertex = null; } if (intersections) { ! return findIntersected(unWantedEntities, xy, surface, vertex, edge, ! glo, object, edges); } else { if (object != null) { --- 1687,1722 ---- surface = null; edge = null; ! ! if (vertex != null) { ! if (!glo.contains((Vertex) vertex.getLastInPath())) { ! vertex = null; ! } else { ! System.out.println(" its a keeper"); ! } ! } ! } if (intersections) { ! { ! System.out.println("-- intersect --"); ! if (surface != null) { ! System.out.println(" surface: " + surface.getLastInPath()); ! } ! if (vertex != null) { ! System.out.println(" vertex: " + vertex.getLastInPath()); ! } ! if (edge != null) { ! System.out.println(" edge: " + edge.getLastInPath()); ! } ! if (glo != null) { ! System.out.println(" glo: " + glo); ! } ! } ! ! Intersection intersection = findIntersected(unWantedEntities, xy, surface, vertex, edge, ! glo, object, edges); ! System.out.println(" intersection: " + intersection); ! ! return intersection; } else { if (object != null) { |