[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model CoordinateSystem.java, 1.66, 1.67
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2007-12-03 17:53:05
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17564/src/net/sourceforge/bprocessor/model Modified Files: CoordinateSystem.java Log Message: Added geometry inference on instances... Do work for selection and such but screws move and others a bit up >:- Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** CoordinateSystem.java 22 Nov 2007 10:26:00 -0000 1.66 --- CoordinateSystem.java 3 Dec 2007 17:52:59 -0000 1.67 *************** *** 540,543 **** --- 540,571 ---- /** + * Untranslate a surface + * @param surface the surface + * @return the untranslated surface + */ + public Surface unTranslate(Surface surface) { + Surface res = (Surface)surface.copy(new HashMap()); + for (Vertex current : res.getVertices()) { + Vertex v = this.unTranslate(current); + current.set(v); + } + return res; + } + + /** + * Translate a surface to this coordinatesystem + * @param surface The surface + * @return The translated surface + */ + public Surface translate(Surface surface) { + Surface res = (Surface)surface.copy(new HashMap()); + for (Vertex current : res.getVertices()) { + Vertex v = this.translate(current); + current.set(v); + } + return res; + } + + /** * Translate an edge * @param edge The edge *************** *** 545,549 **** */ public Edge translate(Edge edge) { ! return new Edge(translate(edge.getFrom()), translate(edge.getTo())); } --- 573,580 ---- */ public Edge translate(Edge edge) { ! Edge res = edge.copy(); ! res.setFrom(translate(edge.getFrom())); ! res.setTo(translate(edge.getTo())); ! return res; } *************** *** 554,558 **** */ public Edge unTranslate(Edge edge) { ! return new Edge(unTranslate(edge.getFrom()), unTranslate(edge.getTo())); } --- 585,592 ---- */ public Edge unTranslate(Edge edge) { ! Edge res = edge.copy(); ! res.setFrom(unTranslate(edge.getFrom())); ! res.setTo(unTranslate(edge.getTo())); ! return res; } |