[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool MoveTool.java,1.19,1.20 ExtrudeTool.ja
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2005-12-19 07:51:41
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6606/src/net/sourceforge/bprocessor/gl/tool Modified Files: MoveTool.java ExtrudeTool.java ExtrusionTool.java TapeMeasureTool.java CatmullClark.java AbstractTool.java CameraFlyTool.java PencilTool.java ToolFactory.java CameraWalkTool.java Log Message: Name removed Surface, Edge, and Vertex Work done on extrudetool Index: ExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrudeTool.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ExtrudeTool.java 12 Dec 2005 14:33:22 -0000 1.2 --- ExtrudeTool.java 19 Dec 2005 07:51:29 -0000 1.3 *************** *** 10,13 **** --- 10,15 ---- import java.awt.Cursor; import java.awt.event.MouseEvent; + import java.util.Iterator; + import java.util.Set; import net.sourceforge.bprocessor.gl.GLView; *************** *** 16,19 **** --- 18,22 ---- import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Plane; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 43,46 **** --- 46,55 ---- private double t = 0; + /** The upper limit */ + private double upperLimit; + + /** The lower limity */ + private double lowerLimit; + /** * Direction (1 or -1) *************** *** 72,78 **** double x = prevX; double y = View.getHeight() - prevY; ! Vertex near = new Vertex("near", x, y, 0.0); ! Vertex far = new Vertex("far", x, y, 1.0); ! Edge ray = new Edge("ray", near, far); ray = trans.unProject(ray); dragplane = extrudeSurface.plane().orthogonalPlane(ray); --- 81,87 ---- double x = prevX; double y = View.getHeight() - prevY; ! Vertex near = new Vertex(x, y, 0.0); ! Vertex far = new Vertex(x, y, 1.0); ! Edge ray = new Edge(near, far); ray = trans.unProject(ray); dragplane = extrudeSurface.plane().orthogonalPlane(ray); *************** *** 98,111 **** */ private void moveTo(double to) { ! if (direction > 0) { ! if (to < 0) { ! to = 0; ! } ! } else { ! if (to > 0) { ! to = 0; ! } } - double delta = to - t; move(delta); --- 107,116 ---- */ private void moveTo(double to) { ! if (to > upperLimit) { ! to = upperLimit; ! } ! if (to < lowerLimit) { ! to = lowerLimit; } double delta = to - t; move(delta); *************** *** 113,116 **** --- 118,169 ---- } + /** + * Find the limits of this extusion + * + */ + protected void findLimits() { + + if (direction > 0) { + lowerLimit = 0.0; + upperLimit = Double.POSITIVE_INFINITY; + } + if (direction < 0) { + upperLimit = 0.0; + lowerLimit = Double.NEGATIVE_INFINITY; + } + + Set surfaces = Project.getInstance().getSurfaces(); + Iterator iter = surfaces.iterator(); + Vertex normal = dragSurface.normal(); + Vertex origin = extrudeSurface.getFirstVertex(); + normal.scale(1 / normal.length()); + while (iter.hasNext()) { + Surface current = (Surface) iter.next(); + if (current != extrudeSurface && current != dragSurface) { + Vertex n = current.normal(); + Vertex cross = normal.cross(n); + if (cross.isZero()) { + Vertex o = current.getFirstVertex(); + Vertex vector = o.minus(origin); + double d = vector.dot(normal); + if (direction > 0) { + if (d > 0.0000001) { + if (d < upperLimit) { + upperLimit = d; + } + } + } + if (direction < 0) { + if (d < -0.0000001) { + if (d > lowerLimit) { + lowerLimit = d; + } + } + } + } + } + } + } + /** *************** *** 143,146 **** --- 196,200 ---- direction = -1; } + findLimits(); } } else { *************** *** 156,159 **** --- 210,214 ---- protected void released(MouseEvent e) { super.released(e); + holeAnalysis(dragSurface); dragplane = null; dragSurface = null; Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** MoveTool.java 12 Dec 2005 14:33:22 -0000 1.19 --- MoveTool.java 19 Dec 2005 07:51:29 -0000 1.20 *************** *** 128,133 **** dragPlane = findMovePlane(target); initial = glv.getView().toPlaneCoords(new double[] {previousX, previousY}, dragPlane); ! parentPos = new Vertex("parent", initial.getX(), initial.getY(), initial.getZ()); ! from = new Vertex("from", initial.getX(), initial.getY(), initial.getZ()); vertices = new HashSet(); --- 128,133 ---- dragPlane = findMovePlane(target); initial = glv.getView().toPlaneCoords(new double[] {previousX, previousY}, dragPlane); ! parentPos = new Vertex(initial.getX(), initial.getY(), initial.getZ()); ! from = new Vertex(initial.getX(), initial.getY(), initial.getZ()); vertices = new HashSet(); *************** *** 170,176 **** double x = previousX; double y = View.getHeight() - previousY; ! Vertex near = new Vertex("near", x, y, 0.0); ! Vertex far = new Vertex("far", x, y, 1.0); ! Edge ray = new Edge("ray", near, far); ray = trans.unProject(ray); return temp.orthogonalPlane(ray); --- 170,176 ---- double x = previousX; double y = View.getHeight() - previousY; ! Vertex near = new Vertex(x, y, 0.0); ! Vertex far = new Vertex(x, y, 1.0); ! Edge ray = new Edge(near, far); ray = trans.unProject(ray); return temp.orthogonalPlane(ray); Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ToolFactory.java 15 Dec 2005 12:37:00 -0000 1.20 --- ToolFactory.java 19 Dec 2005 07:51:30 -0000 1.21 *************** *** 116,120 **** pencil = new PencilTool(glv, pencilcursor); move = new MoveTool(glv, pencilcursor); ! extrusion = new ExtrusionTool(glv, pencilcursor); clipplane = new ClipplaneTool(glv, pencilcursor); rotation = new CameraTool(glv, rotationCursor); --- 116,120 ---- pencil = new PencilTool(glv, pencilcursor); move = new MoveTool(glv, pencilcursor); ! extrusion = new ExtrudeTool(glv, pencilcursor); clipplane = new ClipplaneTool(glv, pencilcursor); rotation = new CameraTool(glv, rotationCursor); Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** ExtrusionTool.java 12 Dec 2005 14:33:22 -0000 1.34 --- ExtrusionTool.java 19 Dec 2005 07:51:29 -0000 1.35 *************** *** 184,190 **** double x = prevX; double y = View.getHeight() - prevY; ! Vertex near = new Vertex("near", x, y, 0.0); ! Vertex far = new Vertex("far", x, y, 1.0); ! Edge ray = new Edge("ray", near, far); ray = trans.unProject(ray); dragplane = selectedSurface.plane().orthogonalPlane(ray); --- 184,190 ---- double x = prevX; double y = View.getHeight() - prevY; ! Vertex near = new Vertex(x, y, 0.0); ! Vertex far = new Vertex(x, y, 1.0); ! Edge ray = new Edge(near, far); ray = trans.unProject(ray); dragplane = selectedSurface.plane().orthogonalPlane(ray); Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** PencilTool.java 12 Dec 2005 14:33:22 -0000 1.49 --- PencilTool.java 19 Dec 2005 07:51:30 -0000 1.50 *************** *** 38,48 **** /** The x axis */ ! private Edge xAxis = new Edge("x", new Vertex("", -50, 0, 0), new Vertex("", 50, 0, 0)); /** The y axis */ ! private Edge yAxis = new Edge("y", new Vertex("", 0, -50, 0), new Vertex("", 0, 50, 0)); /**The z axis */ ! private Edge zAxis = new Edge("z", new Vertex("", 0, 0, -50), new Vertex("", 0, 0, 50)); /** The constructors from the current vertex */ --- 38,48 ---- /** The x axis */ ! private Edge xAxis = new Edge(new Vertex(-50, 0, 0), new Vertex(50, 0, 0)); /** The y axis */ ! private Edge yAxis = new Edge(new Vertex(0, -50, 0), new Vertex(0, 50, 0)); /**The z axis */ ! private Edge zAxis = new Edge(new Vertex(0, 0, -50), new Vertex(0, 0, 50)); /** The constructors from the current vertex */ *************** *** 144,148 **** protected void intern(Vertex vertex) { if (vertex.getId() == null) { - vertex.setName("V" + vertexNum++); Project.getInstance().intern(vertex); } --- 144,147 ---- *************** *** 213,226 **** private Set makeXYZConstructors(Vertex v) { if (v != null) { ! Edge x = new Edge("xconst", ! xAxis.getFrom().add(v), xAxis.getTo().add(v)); x.setConstructor(true); ! Edge y = new Edge("yconst", ! yAxis.getFrom().add(v), yAxis.getTo().add(v)); y.setConstructor(true); ! Edge z = new Edge("zconst", ! zAxis.getFrom().add(v), zAxis.getTo().add(v)); z.setConstructor(true); --- 212,222 ---- private Set makeXYZConstructors(Vertex v) { if (v != null) { ! Edge x = new Edge(xAxis.getFrom().add(v), xAxis.getTo().add(v)); x.setConstructor(true); ! Edge y = new Edge(yAxis.getFrom().add(v), yAxis.getTo().add(v)); y.setConstructor(true); ! Edge z = new Edge(zAxis.getFrom().add(v), zAxis.getTo().add(v)); z.setConstructor(true); *************** *** 252,258 **** minus.scale(-1); Vertex firstTo = minus.copy(); ! Edge first = new Edge("first", firstFrom, firstTo); minus.scale(1 / minus.length()); ! Vertex ortho = new Vertex("ortho", 0, 0, 0); if (minus.getX() != 0) { if (minus.getY() != 0) { --- 248,254 ---- minus.scale(-1); Vertex firstTo = minus.copy(); ! Edge first = new Edge(firstFrom, firstTo); minus.scale(1 / minus.length()); ! Vertex ortho = new Vertex(0, 0, 0); if (minus.getX() != 0) { if (minus.getY() != 0) { *************** *** 276,280 **** ortho.scale(-1); Vertex secondTo = ortho.copy(); ! Edge second = new Edge("second", secondFrom, secondTo); ortho.scale(1 / ortho.length()); --- 272,276 ---- ortho.scale(-1); Vertex secondTo = ortho.copy(); ! Edge second = new Edge(secondFrom, secondTo); ortho.scale(1 / ortho.length()); *************** *** 285,289 **** cross.scale(-1); Vertex thirdTo = cross.copy(); ! Edge third = new Edge("third", thirdFrom, thirdTo); first.setTo(first.getTo().add(v)); --- 281,285 ---- cross.scale(-1); Vertex thirdTo = cross.copy(); ! Edge third = new Edge(thirdFrom, thirdTo); first.setTo(first.getTo().add(v)); *************** *** 361,366 **** intern(vertex); from = vertex; ! to = new Vertex("Mouse", vertex.getX(), vertex.getY(), vertex.getZ()); ! active = new Edge("E" + edgeNum++, from, to); glv.getView().setActiveEdge(active); } else { --- 357,362 ---- intern(vertex); from = vertex; ! to = new Vertex(vertex.getX(), vertex.getY(), vertex.getZ()); ! active = new Edge(from, to); glv.getView().setActiveEdge(active); } else { *************** *** 374,378 **** from = vertex; ! active = new Edge("E" + edgeNum++, from, to); glv.getView().setActiveEdge(active); --- 370,374 ---- from = vertex; ! active = new Edge(from, to); glv.getView().setActiveEdge(active); *************** *** 388,414 **** Vertex to = ((Edge) edges.get(edges.size() - 1)).getTo(); if (from == to) { ! Surface surface = new Surface("S" + surfaceNum++, edges); ! ! ! Set surfaces = Project.getInstance().getSurfaces(); ! Iterator iter = surfaces.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! if (current.surrounds(surface)) { ! current.addHole(surface); ! } else if (surface.surrounds(current)) { ! surface.addHole(current); ! } ! } intern(surface); - - exterior = null; - - if (exterior != null) { - exterior.addHole(surface); - Project.getInstance().update(exterior); - Project.getInstance().update(surface); - } - } else { Geometry.insert(edges); --- 384,390 ---- Vertex to = ((Edge) edges.get(edges.size() - 1)).getTo(); if (from == to) { ! Surface surface = new Surface(edges); ! holeAnalysis(surface); intern(surface); } else { Geometry.insert(edges); *************** *** 548,554 **** View v = glv.getView(); Transformation transformation = v.transformation(); ! Vertex near = new Vertex("near", x, y, 0.0); ! Vertex far = new Vertex("far", x, y, 1.0); ! Edge ray = new Edge("ray", near, far); ray = transformation.unProject(ray); CoordinateSystem system = null; --- 524,530 ---- View v = glv.getView(); Transformation transformation = v.transformation(); ! Vertex near = new Vertex(x, y, 0.0); ! Vertex far = new Vertex(x, y, 1.0); ! Edge ray = new Edge(near, far); ray = transformation.unProject(ray); CoordinateSystem system = null; *************** *** 563,567 **** Vertex vertex = plane.intersection(ray); system = surface.coordinateSystem(); - vertex.setName("current"); current = vertex; if (active != null) { --- 539,542 ---- *************** *** 581,585 **** Edge intersection = edge.intersection(ray); Vertex vertex = intersection.getFrom(); - vertex.setName("current"); current = vertex; splitE1 = edge; --- 556,559 ---- *************** *** 593,609 **** // of the following round off vertex.setZ(0.0); - vertex.setName("xy-plane"); current = vertex; } else { // just to take an initial bug ! current = new Vertex("", 0, 0, 0); } } if (current.getId() == null) { if (snap) { ! Vertex origin = new Vertex("", 0, 0, 0); ! Vertex i = new Vertex("", 1, 0, 0); ! Vertex j = new Vertex("", 0, 1, 0); ! Vertex n = new Vertex("", 0, 0, 1); system = new CoordinateSystem(i, j, n, origin); //snapInSystem(system, current); --- 567,582 ---- // of the following round off vertex.setZ(0.0); current = vertex; } else { // just to take an initial bug ! current = new Vertex(0, 0, 0); } } if (current.getId() == null) { if (snap) { ! Vertex origin = new Vertex(0, 0, 0); ! Vertex i = new Vertex(1, 0, 0); ! Vertex j = new Vertex(0, 1, 0); ! Vertex n = new Vertex(0, 0, 1); system = new CoordinateSystem(i, j, n, origin); //snapInSystem(system, current); Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** AbstractTool.java 15 Dec 2005 13:02:47 -0000 1.39 --- AbstractTool.java 19 Dec 2005 07:51:30 -0000 1.40 *************** *** 81,84 **** --- 81,85 ---- selection = new HashSet(); } + /** *************** *** 142,145 **** --- 143,166 ---- return center; } + + /** + * See if surface has become a hole in a surface in + * the project. + * @param surface The surface + */ + protected void holeAnalysis(Surface surface) { + Set surfaces = Project.getInstance().getSurfaces(); + Iterator iter = surfaces.iterator(); + while (iter.hasNext()) { + Surface current = (Surface) iter.next(); + if (current != surface) { + if (current.surrounds(surface)) { + current.addHole(surface); + } else if (surface.surrounds(current)) { + surface.addHole(current); + } + } + } + } /** *************** *** 368,372 **** protected Vertex createVertex(double[] coord) { if (coord.length == 3) { ! Vertex v = new Vertex("V" + vertexNum); vertexNum++; --- 389,393 ---- protected Vertex createVertex(double[] coord) { if (coord.length == 3) { ! Vertex v = new Vertex(); vertexNum++; *************** *** 390,395 **** protected Vertex createVertex(Vertex vertex) { if (vertex != null) { ! Vertex v = new Vertex("V" + vertexNum, ! vertex.getX(), vertex.getY(), vertex.getZ()); --- 411,415 ---- protected Vertex createVertex(Vertex vertex) { if (vertex != null) { ! Vertex v = new Vertex(vertex.getX(), vertex.getY(), vertex.getZ()); *************** *** 434,438 **** */ protected Edge createEdge(Vertex from, Vertex to) { ! Edge e = new Edge("E" + edgeNum++); e.setTo(to); e.setFrom(from); --- 454,458 ---- */ protected Edge createEdge(Vertex from, Vertex to) { ! Edge e = new Edge(); e.setTo(to); e.setFrom(from); *************** *** 463,468 **** */ protected Surface createSurface(List list) { ! Surface s = new Surface("S" + surfaceNum++); ! s.setEdges(list); Project.getInstance().intern(s); return s; --- 483,487 ---- */ protected Surface createSurface(List list) { ! Surface s = new Surface(list); Project.getInstance().intern(s); return s; Index: CameraWalkTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraWalkTool.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CameraWalkTool.java 15 Dec 2005 12:37:00 -0000 1.1 --- CameraWalkTool.java 19 Dec 2005 07:51:30 -0000 1.2 *************** *** 75,83 **** public void keyPressed(KeyEvent e) { Camera c = glv.getView().getCamera(); ! Vertex up = new Vertex("", c.getRoll()[0], c.getRoll()[1], c.getRoll()[2]); double x = c.getCenter()[0] - c.getCamera()[0]; double y = c.getCenter()[1] - c.getCamera()[1]; double z = c.getCenter()[2] - c.getCamera()[2]; ! Vertex forward = new Vertex("", x, y, z); forward.scale(2 / forward.length()); Vertex sidewards = up.cross(forward); --- 75,83 ---- public void keyPressed(KeyEvent e) { Camera c = glv.getView().getCamera(); ! Vertex up = new Vertex(c.getRoll()[0], c.getRoll()[1], c.getRoll()[2]); double x = c.getCenter()[0] - c.getCamera()[0]; double y = c.getCenter()[1] - c.getCamera()[1]; double z = c.getCenter()[2] - c.getCamera()[2]; ! Vertex forward = new Vertex(x, y, z); forward.scale(2 / forward.length()); Vertex sidewards = up.cross(forward); Index: CameraFlyTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraFlyTool.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CameraFlyTool.java 15 Dec 2005 12:37:00 -0000 1.3 --- CameraFlyTool.java 19 Dec 2005 07:51:30 -0000 1.4 *************** *** 75,83 **** public void keyPressed(KeyEvent e) { Camera c = glv.getView().getCamera(); ! Vertex up = new Vertex("", c.getRoll()[0], c.getRoll()[1], c.getRoll()[2]); double x = c.getCenter()[0] - c.getCamera()[0]; double y = c.getCenter()[1] - c.getCamera()[1]; double z = c.getCenter()[2] - c.getCamera()[2]; ! Vertex forward = new Vertex("", x, y, z); forward.scale(2 / forward.length()); Vertex sidewards = up.cross(forward); --- 75,83 ---- public void keyPressed(KeyEvent e) { Camera c = glv.getView().getCamera(); ! Vertex up = new Vertex(c.getRoll()[0], c.getRoll()[1], c.getRoll()[2]); double x = c.getCenter()[0] - c.getCamera()[0]; double y = c.getCenter()[1] - c.getCamera()[1]; double z = c.getCenter()[2] - c.getCamera()[2]; ! Vertex forward = new Vertex(x, y, z); forward.scale(2 / forward.length()); Vertex sidewards = up.cross(forward); Index: TapeMeasureTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasureTool.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TapeMeasureTool.java 12 Dec 2005 14:33:22 -0000 1.4 --- TapeMeasureTool.java 19 Dec 2005 07:51:30 -0000 1.5 *************** *** 30,40 **** /** The x axis */ ! private Edge xAxis = new Edge("x", new Vertex("", -50, 0, 0), new Vertex("", 50, 0, 0)); /** The y axis */ ! private Edge yAxis = new Edge("y", new Vertex("", 0, -50, 0), new Vertex("", 0, 50, 0)); /**The z axis */ ! private Edge zAxis = new Edge("z", new Vertex("", 0, 0, -50), new Vertex("", 0, 0, 50)); /** The current edge */ --- 30,40 ---- /** The x axis */ ! private Edge xAxis = new Edge(new Vertex(-50, 0, 0), new Vertex(50, 0, 0)); /** The y axis */ ! private Edge yAxis = new Edge(new Vertex(0, -50, 0), new Vertex(0, 50, 0)); /**The z axis */ ! private Edge zAxis = new Edge(new Vertex(0, 0, -50), new Vertex(0, 0, 50)); /** The current edge */ *************** *** 83,95 **** if (currentEdge.equals(xAxis)) { movePlane = new Plane(0, 0, 1, 0); ! edgeNormal = new Vertex("", 0, 1, 0); move(e); } else if (currentEdge.equals(yAxis)) { movePlane = new Plane(0, 0, 1, 0); ! edgeNormal = new Vertex("", 1, 0, 0); move(e); } else if (currentEdge.equals(zAxis)) { movePlane = new Plane(0, 1, 0, 0); ! edgeNormal = new Vertex("", 1, 0, 0); move(e); } else { --- 83,95 ---- if (currentEdge.equals(xAxis)) { movePlane = new Plane(0, 0, 1, 0); ! edgeNormal = new Vertex(0, 1, 0); move(e); } else if (currentEdge.equals(yAxis)) { movePlane = new Plane(0, 0, 1, 0); ! edgeNormal = new Vertex(1, 0, 0); move(e); } else if (currentEdge.equals(zAxis)) { movePlane = new Plane(0, 1, 0, 0); ! edgeNormal = new Vertex(1, 0, 0); move(e); } else { *************** *** 127,133 **** View v = glv.getView(); Transformation transformation = v.transformation(); ! Vertex near = new Vertex("near", x, y, 0.0); ! Vertex far = new Vertex("far", x, y, 1.0); ! Edge ray = new Edge("ray", near, far); ray = transformation.unProject(ray); Vertex intersect = movePlane.intersection(ray); --- 127,133 ---- View v = glv.getView(); Transformation transformation = v.transformation(); ! Vertex near = new Vertex(x, y, 0.0); ! Vertex far = new Vertex(x, y, 1.0); ! Edge ray = new Edge(near, far); ray = transformation.unProject(ray); Vertex intersect = movePlane.intersection(ray); *************** *** 181,192 **** double y = View.getHeight() - e.getY(); Transformation transformation = v.transformation(); ! Vertex near = new Vertex("near", x, y, 0.0); ! Vertex far = new Vertex("far", x, y, 1.0); ! Edge ray = new Edge("ray", near, far); ray = transformation.unProject(ray); Edge intersection = currentEdge.intersection(ray); edgePoint = intersection.getFrom(); constructionPoint = edgePoint.copy(); ! edgeToConstruction = new Edge("lengthEdge", edgePoint, constructionPoint); edgeToConstruction.setConstructor(true); v.addTempEdge(edgeToConstruction); --- 181,192 ---- double y = View.getHeight() - e.getY(); Transformation transformation = v.transformation(); ! Vertex near = new Vertex(x, y, 0.0); ! Vertex far = new Vertex(x, y, 1.0); ! Edge ray = new Edge(near, far); ray = transformation.unProject(ray); Edge intersection = currentEdge.intersection(ray); edgePoint = intersection.getFrom(); constructionPoint = edgePoint.copy(); ! edgeToConstruction = new Edge(edgePoint, constructionPoint); edgeToConstruction.setConstructor(true); v.addTempEdge(edgeToConstruction); Index: CatmullClark.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CatmullClark.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CatmullClark.java 30 Nov 2005 23:04:54 -0000 1.3 --- CatmullClark.java 19 Dec 2005 07:51:30 -0000 1.4 *************** *** 83,87 **** Vertex from = (Vertex) vertexmap.get(current.getFrom()); Vertex to = (Vertex) vertexmap.get(current.getTo()); ! Edge edge = new Edge("", from, to); edgemap.put(current, edge); } --- 83,87 ---- Vertex from = (Vertex) vertexmap.get(current.getFrom()); Vertex to = (Vertex) vertexmap.get(current.getTo()); ! Edge edge = new Edge(from, to); edgemap.put(current, edge); } *************** *** 99,103 **** edges.add(edge); } ! surfaces.add(new Surface("", edges)); } } --- 99,103 ---- edges.add(edge); } ! surfaces.add(new Surface(edges)); } } *************** *** 235,239 **** } if (edge == null) { ! edge = new Edge("", from, to); fl.add(edge); tl.add(edge); --- 235,239 ---- } if (edge == null) { ! edge = new Edge(from, to); fl.add(edge); tl.add(edge); *************** *** 256,260 **** edges.add(e3); edges.add(e4); ! return new Surface("", edges); } --- 256,260 ---- edges.add(e3); edges.add(e4); ! return new Surface(edges); } *************** *** 373,377 **** Edge current = (Edge) iter.next(); double[] values = current.center(); ! Vertex center = new Vertex("", values[0], values[1], values[2]); edgepoints.add(center); edgemap.put(current, center); --- 373,377 ---- Edge current = (Edge) iter.next(); double[] values = current.center(); ! Vertex center = new Vertex(values[0], values[1], values[2]); edgepoints.add(center); edgemap.put(current, center); |