[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view View.java,1.70,1.71
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Michael L. <he...@us...> - 2006-03-10 16:41:36
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10207/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: MultiExtrusionTool now used Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** View.java 7 Mar 2006 22:31:05 -0000 1.70 --- View.java 10 Mar 2006 16:41:26 -0000 1.71 *************** *** 1341,1344 **** --- 1341,1345 ---- Collection vertices = Project.getInstance().getVertices(); + Space space = Project.getInstance().getActiveSpace(); gl = gld.getGL(); initNames(gl); *************** *** 1362,1373 **** } if (selectMode == EDGES || selectMode == ALL) { ! Iterator it = edges.iterator(); ! gl.glColor3fv(lineColor); ! while (it.hasNext()) { ! Edge e = (Edge)it.next(); ! pushName(gl, e); ! drawEdge(e); ! popName(gl); } Iterator tempEdgeIt = tempEdges.iterator(); while (tempEdgeIt.hasNext()) { --- 1363,1405 ---- } if (selectMode == EDGES || selectMode == ALL) { ! ! if (space != null) { ! Set es = new HashSet(); ! { ! Set surfs = space.getEnvelope(); ! Iterator surfsIt = surfs.iterator(); ! while (surfsIt.hasNext()) { ! Surface current = (Surface) surfsIt.next(); ! es.addAll(current.getEdges()); ! } ! } ! if (space.getInterior() != null) { ! Collection surfs = space.getInterior().getSurfaces(); ! Iterator surfsIt = surfs.iterator(); ! while (surfsIt.hasNext()) { ! Surface current = (Surface) surfsIt.next(); ! es.addAll(current.getEdges()); ! } ! } ! Iterator it = es.iterator(); ! gl.glColor3fv(lineColor); ! while (it.hasNext()) { ! Edge e = (Edge)it.next(); ! pushName(gl, e); ! drawEdge(e); ! popName(gl); ! } ! } else { ! Iterator it = edges.iterator(); ! gl.glColor3fv(lineColor); ! while (it.hasNext()) { ! Edge e = (Edge)it.next(); ! pushName(gl, e); ! drawEdge(e); ! popName(gl); ! } } + + Iterator tempEdgeIt = tempEdges.iterator(); while (tempEdgeIt.hasNext()) { *************** *** 1379,1390 **** } if (selectMode == SURFACES || selectMode == ALL) { ! Iterator it = surfaces.iterator(); gl.glColor3fv(SURFACE_COLOR); ! while (it.hasNext()) { ! Surface s = (Surface)it.next(); ! pushName(gl, s); ! drawSurface(s); ! popName(gl); } Iterator tempSurfaceIt = tempSurfaces.iterator(); while (tempSurfaceIt.hasNext()) { --- 1411,1441 ---- } if (selectMode == SURFACES || selectMode == ALL) { ! gl.glColor3fv(SURFACE_COLOR); ! ! if (space != null) { ! Set ss = new HashSet(); ! if (space.getInterior() != null) { ! Collection surfs = space.getInterior().getSurfaces(); ! ss.addAll(surfs); ! } ! Iterator it = ss.iterator(); ! while (it.hasNext()) { ! Surface s = (Surface)it.next(); ! pushName(gl, s); ! drawSurface(s); ! popName(gl); ! } ! } else { ! Iterator it = surfaces.iterator(); ! while (it.hasNext()) { ! Surface s = (Surface)it.next(); ! pushName(gl, s); ! drawSurface(s); ! popName(gl); ! } } + + Iterator tempSurfaceIt = tempSurfaces.iterator(); while (tempSurfaceIt.hasNext()) { *************** *** 1743,1749 **** * @param unWantedEntities Entities to be ignored * @param intersections Are intersections wanted * @return Selection */ ! private Object processSelect(Collection unWantedEntities, boolean intersections) { int bufferOffset = 0; int names = 0; --- 1794,1803 ---- * @param unWantedEntities Entities to be ignored * @param intersections Are intersections wanted + * @param xy The default interseection plane + * @param all Return all edges * @return Selection */ ! private Object processSelect(Collection unWantedEntities, ! boolean intersections, Plane xy, boolean all) { int bufferOffset = 0; int names = 0; *************** *** 1824,1828 **** if (vertex != null) { if (nearestSurface < nearestVertex) { ! if (!plane.contains(vertex)) { vertex = null; } --- 1878,1882 ---- if (vertex != null) { if (nearestSurface < nearestVertex) { ! if (plane != null && !plane.contains(vertex)) { vertex = null; } *************** *** 1831,1835 **** if (edge != null) { if (nearestSurface < nearestEdge) { ! if (!plane.contains(edge)) { edge = null; } --- 1885,1889 ---- if (edge != null) { if (nearestSurface < nearestEdge) { ! if (plane != null && !plane.contains(edge)) { edge = null; } *************** *** 1912,1921 **** return new Intersection(intersection, Intersection.SURFACE, surface); } else { - Plane xy = new Plane(0, 0, 1, 0); Vertex intersection = xy.intersection(ray); if (intersection != null) { // FIXME The plane intersection should take care // of the following round off ! intersection.setZ(0.0); return new Intersection(intersection, Intersection.PLANE_INTERSECTION, null); } --- 1966,1977 ---- return new Intersection(intersection, Intersection.SURFACE, surface); } else { Vertex intersection = xy.intersection(ray); if (intersection != null) { // FIXME The plane intersection should take care // of the following round off ! double values[] = xy.getDoublev(); ! if (values[3] == 0) { ! intersection.setZ(0.0); ! } return new Intersection(intersection, Intersection.PLANE_INTERSECTION, null); } *************** *** 1929,1932 **** --- 1985,1996 ---- return vertex; } else if (edge != null) { + if (all) { + // FIXME this is a temporary hack to make move work + List result = new LinkedList(); + result.add(edge); + edges.remove(edge); + result.addAll(edges); + return result; + } return edge; } else if (surface != null) { *************** *** 1948,1955 **** * @param unWantedEntities the collection of unwanted entities * @param intersections Are intersections wanted * @return entity under the point. */ public Object getObjectAtPoint(double x, double y, ! Collection unWantedEntities, boolean intersections) { this.x = x; this.y = y; --- 2012,2020 ---- * @param unWantedEntities the collection of unwanted entities * @param intersections Are intersections wanted + * @param xy The default plane to intersect with * @return entity under the point. */ public Object getObjectAtPoint(double x, double y, ! Collection unWantedEntities, boolean intersections, Plane xy) { this.x = x; this.y = y; *************** *** 1959,1963 **** glv.repaint(true); ! Object object = processSelect(unWantedEntities, intersections); clearNames(); return object; --- 2024,2028 ---- glv.repaint(true); ! Object object = processSelect(unWantedEntities, intersections, xy, false); clearNames(); return object; *************** *** 1971,1975 **** */ public Object getObjectAtPoint(double x, double y) { ! return getObjectAtPoint(x, y, new HashSet(), false); } --- 2036,2040 ---- */ public Object getObjectAtPoint(double x, double y) { ! return getObjectAtPoint(x, y, new HashSet(), false, new Plane(0, 0, 1, 0)); } *************** *** 2043,2049 **** List selection = new LinkedList(); ! Object object = processSelect(new HashSet(), false); if (object != null) { ! selection.add(object); } clearNames(); --- 2108,2118 ---- List selection = new LinkedList(); ! Object object = processSelect(new HashSet(), false, new Plane(0, 0, 1, 0), true); if (object != null) { ! if (object instanceof List) { ! selection = (List) object; ! } else { ! selection.add(object); ! } } clearNames(); *************** *** 2066,2070 **** List selection = new LinkedList(); ! Object object = processSelect(new HashSet(), false); if (object != null) { selection.add(object); --- 2135,2139 ---- List selection = new LinkedList(); ! Object object = processSelect(new HashSet(), false, new Plane(0, 0, 1, 0), false); if (object != null) { selection.add(object); |