Thread: [Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Geometry.java, 1.62, 1.63 Command.ja
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-10-24 16:05:03
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5173/src/net/sourceforge/bprocessor/model Modified Files: Geometry.java Command.java CoordinateSystem.java Log Message: some simplification Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Command.java 24 Oct 2007 07:45:43 -0000 1.14 --- Command.java 24 Oct 2007 16:04:54 -0000 1.15 *************** *** 336,340 **** current.setZ(current.getZ() * sz); } ! locals = system.unTranslate(locals, false); for (int i = 0; i < locals.size(); i++) { Vertex v1 = vertices.get(i); --- 336,340 ---- current.setZ(current.getZ() * sz); } ! locals = system.unTranslate(locals); for (int i = 0; i < locals.size(); i++) { Vertex v1 = vertices.get(i); *************** *** 381,385 **** current.setZ(current.getZ() + sz); } ! locals = system.unTranslate(locals, false); for (int i = 0; i < locals.size(); i++) { Vertex v1 = vertices.get(i); --- 381,385 ---- current.setZ(current.getZ() + sz); } ! locals = system.unTranslate(locals); for (int i = 0; i < locals.size(); i++) { Vertex v1 = vertices.get(i); *************** *** 422,426 **** current.set(rotated); } ! locals = system.unTranslate(locals, false); for (int i = 0; i < locals.size(); i++) { Vertex v1 = vertices.get(i); --- 422,426 ---- current.set(rotated); } ! locals = system.unTranslate(locals); for (int i = 0; i < locals.size(); i++) { Vertex v1 = vertices.get(i); Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** Geometry.java 3 Oct 2007 10:02:18 -0000 1.62 --- Geometry.java 24 Oct 2007 16:04:54 -0000 1.63 *************** *** 983,987 **** CoordinateSystem system) { List<Vertex> vertices = new LinkedList<Vertex>(collect(geometry)); ! List<Vertex> unTranslatedVertices = system.unTranslate(vertices, true); Iterator it = vertices.iterator(); Iterator unTranslatedIt = unTranslatedVertices.iterator(); --- 983,987 ---- CoordinateSystem system) { List<Vertex> vertices = new LinkedList<Vertex>(collect(geometry)); ! List<Vertex> unTranslatedVertices = system.unTranslate(vertices); Iterator it = vertices.iterator(); Iterator unTranslatedIt = unTranslatedVertices.iterator(); Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** CoordinateSystem.java 12 Oct 2007 13:14:46 -0000 1.59 --- CoordinateSystem.java 24 Oct 2007 16:04:54 -0000 1.60 *************** *** 459,466 **** * the global coordinate system * @param vertex The vertex to un-translate - * @param modify True if the existing vertex should be modified false otherwise * @return The un-translated vertex */ ! public Vertex unTranslate(Vertex vertex, boolean modify) { Vertex ii = i.copy(); ii.scale(vertex.getX()); --- 459,465 ---- * the global coordinate system * @param vertex The vertex to un-translate * @return The un-translated vertex */ ! public Vertex unTranslate(Vertex vertex) { Vertex ii = i.copy(); ii.scale(vertex.getX()); *************** *** 469,490 **** Vertex nn = n.copy(); nn.scale(vertex.getZ()); ! Vertex tmp = getOrigin().add(ii).add(jj).add(nn); ! if (modify) { ! vertex.setX(tmp.getX()); ! vertex.setY(tmp.getY()); ! vertex.setZ(tmp.getZ()); ! tmp = vertex; ! } ! return tmp; ! } ! ! /** ! * Return the vertex translated from the CoordinateSystem to ! * the global coordinate system ! * @param vertex The vertex to un-translate ! * @return The un-translated vertex ! */ ! public Vertex unTranslate(Vertex vertex) { ! return unTranslate(vertex, false); } --- 468,473 ---- Vertex nn = n.copy(); nn.scale(vertex.getZ()); ! Vertex result = getOrigin().add(ii).add(jj).add(nn); ! return result; } *************** *** 505,515 **** * Untranslate all vertices in the list * @param vertices The list of vertices - * @param modify true if the existing vertexes should be kept false if they should be copied * @return The untranslated list */ ! public List<Vertex> unTranslate(Collection<Vertex> vertices, boolean modify) { List<Vertex> result = new ArrayList<Vertex>(); for (Vertex current : vertices) { ! result.add(unTranslate(current, modify)); } return result; --- 488,497 ---- * Untranslate all vertices in the list * @param vertices The list of vertices * @return The untranslated list */ ! public List<Vertex> unTranslate(Collection<Vertex> vertices) { List<Vertex> result = new ArrayList<Vertex>(); for (Vertex current : vertices) { ! result.add(unTranslate(current)); } return result; |