Thread: [Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool OffsetTool.java, 1.26, 1.27 Extrusion
Status: Pre-Alpha
Brought to you by:
henryml
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25364/src/net/sourceforge/bprocessor/gl/tool Modified Files: OffsetTool.java ExtrusionTool.java ClipplaneTool.java EdgeMoveTool.java FinalMoveTool.java AbstractPencil.java TapeMeasure.java AbstractTool.java CameraFlyTool.java ArcTool.java RectTool.java AltMoveTool.java CameraWalkTool.java ControlledMoveTool.java Log Message: renamed scaleInPlace to scaleIt Index: EdgeMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/EdgeMoveTool.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** EdgeMoveTool.java 18 Nov 2007 21:30:17 -0000 1.6 --- EdgeMoveTool.java 11 Dec 2007 14:49:11 -0000 1.7 *************** *** 182,186 **** Vertex norm = ray.getDirection(); norm.normalize(); ! norm.scaleInPlace(-1); dragplane = new Plane(norm.getX(), norm.getY(), norm.getZ(), start.vertex()); } else { --- 182,186 ---- Vertex norm = ray.getDirection(); norm.normalize(); ! norm.scaleIt(-1); dragplane = new Plane(norm.getX(), norm.getY(), norm.getZ(), start.vertex()); } else { Index: OffsetTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** OffsetTool.java 7 Dec 2007 12:48:31 -0000 1.26 --- OffsetTool.java 11 Dec 2007 14:49:11 -0000 1.27 *************** *** 119,127 **** if (offsetSurface.surrounds(current.vertex())) { if (outNormal.dot(current.vertex().minus(edgePoint)) > 0) { ! outNormal.scaleInPlace(-1); } } else { if (outNormal.dot(current.vertex().minus(edgePoint)) < 0) { ! outNormal.scaleInPlace(-1); } } --- 119,127 ---- if (offsetSurface.surrounds(current.vertex())) { if (outNormal.dot(current.vertex().minus(edgePoint)) > 0) { ! outNormal.scaleIt(-1); } } else { if (outNormal.dot(current.vertex().minus(edgePoint)) < 0) { ! outNormal.scaleIt(-1); } } *************** *** 136,145 **** if (s.surrounds(current.vertex())) { if (outNormal.dot(current.vertex().minus(edgePoint)) > 0) { ! outNormal.scaleInPlace(-1); } log.debug("Surrounds"); } else { if (outNormal.dot(current.vertex().minus(edgePoint)) < 0) { ! outNormal.scaleInPlace(-1); } } --- 136,145 ---- if (s.surrounds(current.vertex())) { if (outNormal.dot(current.vertex().minus(edgePoint)) > 0) { ! outNormal.scaleIt(-1); } log.debug("Surrounds"); } else { if (outNormal.dot(current.vertex().minus(edgePoint)) < 0) { ! outNormal.scaleIt(-1); } } *************** *** 201,205 **** Direction d = directionMap.get(origin); Vertex moveDelta = d.getDirection().copy(); ! moveDelta.scaleInPlace(length); Vertex to = origin.add(moveDelta); d.getVertex().set(to); --- 201,205 ---- Direction d = directionMap.get(origin); Vertex moveDelta = d.getDirection().copy(); ! moveDelta.scaleIt(length); Vertex to = origin.add(moveDelta); d.getVertex().set(to); Index: ClipplaneTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ClipplaneTool.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ClipplaneTool.java 18 Nov 2007 21:30:17 -0000 1.15 --- ClipplaneTool.java 11 Dec 2007 14:49:11 -0000 1.16 *************** *** 59,63 **** boolean front = editor.getView().facingFront(system); if (front) { ! n.scaleInPlace(-1); } system = new CoordinateSystem(i, j, n, o); --- 59,63 ---- boolean front = editor.getView().facingFront(system); if (front) { ! n.scaleIt(-1); } system = new CoordinateSystem(i, j, n, o); Index: ControlledMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ControlledMoveTool.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ControlledMoveTool.java 18 Nov 2007 21:30:17 -0000 1.12 --- ControlledMoveTool.java 11 Dec 2007 14:49:11 -0000 1.13 *************** *** 248,252 **** Vertex normal = surface.normal(); Vertex dir = edgeDir.cross(normal); ! dir.scaleInPlace(1 / dir.length()); return dir; } --- 248,252 ---- Vertex normal = surface.normal(); Vertex dir = edgeDir.cross(normal); ! dir.scaleIt(1 / dir.length()); return dir; } *************** *** 266,280 **** if (slideMap != null && slideMap.keySet().containsAll(vertices)) { Vertex directionCopy = direction.copy(); ! directionCopy.scaleInPlace(1 / directionCopy.length()); ! directionCopy.scaleInPlace(delta.dot(directionCopy)); delta = directionCopy; if (delta.length() != 0) { Vertex deltaUnit = delta.copy(); ! deltaUnit.scaleInPlace(1 / delta.length()); Iterator it = vertices.iterator(); while (it.hasNext()) { Vertex vertex = (Vertex)it.next(); Vertex slideDir = ((Vertex)slideMap.get(vertex)).copy(); ! slideDir.scaleInPlace(1 / slideDir.length()); double slideScale; if (delta == null) { --- 266,280 ---- if (slideMap != null && slideMap.keySet().containsAll(vertices)) { Vertex directionCopy = direction.copy(); ! directionCopy.scaleIt(1 / directionCopy.length()); ! directionCopy.scaleIt(delta.dot(directionCopy)); delta = directionCopy; if (delta.length() != 0) { Vertex deltaUnit = delta.copy(); ! deltaUnit.scaleIt(1 / delta.length()); Iterator it = vertices.iterator(); while (it.hasNext()) { Vertex vertex = (Vertex)it.next(); Vertex slideDir = ((Vertex)slideMap.get(vertex)).copy(); ! slideDir.scaleIt(1 / slideDir.length()); double slideScale; if (delta == null) { *************** *** 294,298 **** slideScale = delta.getZ() / (slideDir.dot(deltaUnit) * deltaUnit.getZ()); } ! slideDir.scaleInPlace(slideScale); vertex.move(slideDir.getX(), slideDir.getY(), slideDir.getZ()); } --- 294,298 ---- slideScale = delta.getZ() / (slideDir.dot(deltaUnit) * deltaUnit.getZ()); } ! slideDir.scaleIt(slideScale); vertex.move(slideDir.getX(), slideDir.getY(), slideDir.getZ()); } Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** ExtrusionTool.java 7 Dec 2007 12:48:31 -0000 1.73 --- ExtrusionTool.java 11 Dec 2007 14:49:11 -0000 1.74 *************** *** 443,447 **** Vertex dir = to.minus(from); dir.normalize(); ! dir.scaleInPlace(length); to = from.add(dir); } else { --- 443,447 ---- Vertex dir = to.minus(from); dir.normalize(); ! dir.scaleIt(length); to = from.add(dir); } else { Index: TapeMeasure.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasure.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TapeMeasure.java 7 Dec 2007 12:48:31 -0000 1.10 --- TapeMeasure.java 11 Dec 2007 14:49:11 -0000 1.11 *************** *** 61,65 **** Vertex projected = current.vertex().minus(origin); double t = normal.dot(projected); ! normal.scaleInPlace(t); projected = projected.minus(normal); Edge ortho = new Edge(origin, origin.add(projected)); --- 61,65 ---- Vertex projected = current.vertex().minus(origin); double t = normal.dot(projected); ! normal.scaleIt(t); projected = projected.minus(normal); Edge ortho = new Edge(origin, origin.add(projected)); *************** *** 162,166 **** Vertex direction = lengthEdge.getDirection(); direction.normalize(); ! direction.scaleInPlace(value); Vertex origin = start.vertex().add(direction); Vertex v = originalEdge.getDirection(); --- 162,166 ---- Vertex direction = lengthEdge.getDirection(); direction.normalize(); ! direction.scaleIt(value); Vertex origin = start.vertex().add(direction); Vertex v = originalEdge.getDirection(); Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.141 retrieving revision 1.142 diff -C2 -d -r1.141 -r1.142 *** AbstractTool.java 10 Dec 2007 11:55:54 -0000 1.141 --- AbstractTool.java 11 Dec 2007 14:49:11 -0000 1.142 *************** *** 300,307 **** double z = c.getCenter()[2] - c.getCamera()[2]; Vertex forward = new Vertex(x, y, z); ! forward.scaleInPlace(2 / forward.length()); Vertex sidewards = up.cross(forward); ! sidewards.scaleInPlace(2 / sidewards.length()); ! up.scaleInPlace(2 / up.length()); --- 300,307 ---- double z = c.getCenter()[2] - c.getCamera()[2]; Vertex forward = new Vertex(x, y, z); ! forward.scaleIt(2 / forward.length()); Vertex sidewards = up.cross(forward); ! sidewards.scaleIt(2 / sidewards.length()); ! up.scaleIt(2 / up.length()); Index: ArcTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ArcTool.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ArcTool.java 7 Dec 2007 12:48:31 -0000 1.23 --- ArcTool.java 11 Dec 2007 14:49:11 -0000 1.24 *************** *** 85,89 **** Vertex v1 = m.minus(p); ! v1.scaleInPlace(0.5); Vertex m1 = p.add(v1); --- 85,89 ---- Vertex v1 = m.minus(p); ! v1.scaleIt(0.5); Vertex m1 = p.add(v1); *************** *** 92,100 **** v1.setX(-y); v1.setY(x); ! v1.scaleInPlace(10 / v1.length()); Edge l1 = new Edge(m1.minus(v1), m1.add(v1)); Vertex v2 = m.minus(q); ! v2.scaleInPlace(0.5); Vertex m2 = q.add(v2); --- 92,100 ---- v1.setX(-y); v1.setY(x); ! v1.scaleIt(10 / v1.length()); Edge l1 = new Edge(m1.minus(v1), m1.add(v1)); Vertex v2 = m.minus(q); ! v2.scaleIt(0.5); Vertex m2 = q.add(v2); *************** *** 103,107 **** v2.setX(-y); v2.setY(x); ! v2.scaleInPlace(10 / v2.length()); Edge l2 = new Edge(m2.minus(v2), m2.add(v2)); l1.setStrippled(true); --- 103,107 ---- v2.setX(-y); v2.setY(x); ! v2.scaleIt(10 / v2.length()); Edge l2 = new Edge(m2.minus(v2), m2.add(v2)); l1.setStrippled(true); *************** *** 117,121 **** Vertex u1 = p.minus(center); radius = u1.length(); ! u1.scaleInPlace(1 / radius); tetra1 = Math.acos(u1.getX()); if (u1.getY() < 0) { --- 117,121 ---- Vertex u1 = p.minus(center); radius = u1.length(); ! u1.scaleIt(1 / radius); tetra1 = Math.acos(u1.getX()); if (u1.getY() < 0) { *************** *** 123,127 **** } Vertex u2 = q.minus(center); ! u2.scaleInPlace(1 / radius); tetra2 = Math.acos(u2.getX()); if (u2.getY() < 0) { --- 123,127 ---- } Vertex u2 = q.minus(center); ! u2.scaleIt(1 / radius); tetra2 = Math.acos(u2.getX()); if (u2.getY() < 0) { *************** *** 213,217 **** end = current; Vertex between = end.vertex().minus(first.vertex()); ! between.scaleInPlace(0.5); start = new Intersection(first.vertex().add(between), Intersection.VERTEX, null); } else { --- 213,217 ---- end = current; Vertex between = end.vertex().minus(first.vertex()); ! between.scaleIt(0.5); start = new Intersection(first.vertex().add(between), Intersection.VERTEX, null); } else { Index: CameraWalkTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraWalkTool.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CameraWalkTool.java 18 Nov 2007 21:30:17 -0000 1.11 --- CameraWalkTool.java 11 Dec 2007 14:49:11 -0000 1.12 *************** *** 83,89 **** double z = c.getCenter()[2] - c.getCamera()[2]; Vertex forward = new Vertex(x, y, z); ! forward.scaleInPlace(2 / forward.length()); Vertex sidewards = up.cross(forward); ! sidewards.scaleInPlace(2 / sidewards.length()); if (e.getKeyCode() == KeyEvent.VK_UP) { --- 83,89 ---- double z = c.getCenter()[2] - c.getCamera()[2]; Vertex forward = new Vertex(x, y, z); ! forward.scaleIt(2 / forward.length()); Vertex sidewards = up.cross(forward); ! sidewards.scaleIt(2 / sidewards.length()); if (e.getKeyCode() == KeyEvent.VK_UP) { Index: CameraFlyTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraFlyTool.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** CameraFlyTool.java 18 Nov 2007 21:30:17 -0000 1.13 --- CameraFlyTool.java 11 Dec 2007 14:49:11 -0000 1.14 *************** *** 84,90 **** double z = c.getCenter()[2] - c.getCamera()[2]; Vertex forward = new Vertex(x, y, z); ! forward.scaleInPlace(2 / forward.length()); Vertex sidewards = up.cross(forward); ! sidewards.scaleInPlace(2 / sidewards.length()); if (e.getKeyCode() == KeyEvent.VK_UP) { --- 84,90 ---- double z = c.getCenter()[2] - c.getCamera()[2]; Vertex forward = new Vertex(x, y, z); ! forward.scaleIt(2 / forward.length()); Vertex sidewards = up.cross(forward); ! sidewards.scaleIt(2 / sidewards.length()); if (e.getKeyCode() == KeyEvent.VK_UP) { Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** FinalMoveTool.java 10 Dec 2007 08:34:25 -0000 1.39 --- FinalMoveTool.java 11 Dec 2007 14:49:11 -0000 1.40 *************** *** 307,311 **** Vertex v = to.minus(current); double length = v.length(); ! v.scaleInPlace(1 / length); direction = new Direction(current.copy(), v, Double.NEGATIVE_INFINITY, length); } else { --- 307,311 ---- Vertex v = to.minus(current); double length = v.length(); ! v.scaleIt(1 / length); direction = new Direction(current.copy(), v, Double.NEGATIVE_INFINITY, length); } else { *************** *** 353,357 **** } Vertex u = n.copy(); ! u.scaleInPlace(t); current.set(original.add(u)); } --- 353,357 ---- } Vertex u = n.copy(); ! u.scaleIt(t); current.set(original.add(u)); } *************** *** 433,437 **** private void multiply(int i) { Vertex v = direction.copy(); ! v.scaleInPlace(i); Mesh copy = mesh.copyAndAssign(new HashMap()); for (Vertex current : copy.vertices()) { --- 433,437 ---- private void multiply(int i) { Vertex v = direction.copy(); ! v.scaleIt(i); Mesh copy = mesh.copyAndAssign(new HashMap()); for (Vertex current : copy.vertices()) { *************** *** 448,452 **** double d = (double) i * delta; ! v.scaleInPlace(d / v.length()); Mesh copy = mesh.copyAndAssign(new HashMap()); for (Vertex current : copy.vertices()) { --- 448,452 ---- double d = (double) i * delta; ! v.scaleIt(d / v.length()); Mesh copy = mesh.copyAndAssign(new HashMap()); for (Vertex current : copy.vertices()) { Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** AbstractPencil.java 18 Nov 2007 21:30:17 -0000 1.100 --- AbstractPencil.java 11 Dec 2007 14:49:11 -0000 1.101 *************** *** 737,741 **** Vertex v = current.vertex().minus(before); if (v.length() > Geometry.EPS) { ! v.scaleInPlace(length / v.length()); Vertex to = before.add(v); current = new Intersection(to, Intersection.VERTEX, to); --- 737,741 ---- Vertex v = current.vertex().minus(before); if (v.length() > Geometry.EPS) { ! v.scaleIt(length / v.length()); Vertex to = before.add(v); current = new Intersection(to, Intersection.VERTEX, to); Index: AltMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AltMoveTool.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** AltMoveTool.java 18 Nov 2007 21:30:17 -0000 1.15 --- AltMoveTool.java 11 Dec 2007 14:49:11 -0000 1.16 *************** *** 92,96 **** Vertex normal = system.getN().copy(); double distance = normal.dot(delta); ! normal.scaleInPlace(distance); Vertex to = from.add(normal); makeTarget(current); --- 92,96 ---- Vertex normal = system.getN().copy(); double distance = normal.dot(delta); ! normal.scaleIt(distance); Vertex to = from.add(normal); makeTarget(current); Index: RectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RectTool.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** RectTool.java 7 Dec 2007 12:48:31 -0000 1.28 --- RectTool.java 11 Dec 2007 14:49:11 -0000 1.29 *************** *** 79,84 **** Vertex delta = lastCurrent.minus(current.vertex()); Vertex baseProjection = baseEdge.getDirection(); ! baseProjection.scaleInPlace(1 / baseProjection.length()); ! baseProjection.scaleInPlace(delta.dot(baseProjection)); Vertex movement = baseProjection.minus(delta); movingEdge.move(movement.getX(), movement.getY(), movement.getZ()); --- 79,84 ---- Vertex delta = lastCurrent.minus(current.vertex()); Vertex baseProjection = baseEdge.getDirection(); ! baseProjection.scaleIt(1 / baseProjection.length()); ! baseProjection.scaleIt(delta.dot(baseProjection)); Vertex movement = baseProjection.minus(delta); movingEdge.move(movement.getX(), movement.getY(), movement.getZ()); *************** *** 100,104 **** double length = start.vertex().minus(current.vertex()).length(); Vertex direction = movingEdge.getFrom().minus(baseEdge.getTo()); ! direction.scaleInPlace((length - direction.length()) / direction.length()); movingEdge.move(direction.getX(), direction.getY(), direction.getZ()); Geometry.insertEdges(rectangle); --- 100,104 ---- double length = start.vertex().minus(current.vertex()).length(); Vertex direction = movingEdge.getFrom().minus(baseEdge.getTo()); ! direction.scaleIt((length - direction.length()) / direction.length()); movingEdge.move(direction.getX(), direction.getY(), direction.getZ()); Geometry.insertEdges(rectangle); |