[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Persistence.java, 1.27, 1.28
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Michael L. <he...@us...> - 2006-12-05 20:40:54
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23411/src/net/sourceforge/bprocessor/model Modified Files: Persistence.java Log Message: Coordinate values are rounded to 10 decimals Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Persistence.java 4 Dec 2006 14:41:55 -0000 1.27 --- Persistence.java 5 Dec 2006 20:40:52 -0000 1.28 *************** *** 943,946 **** --- 943,959 ---- } + + /** + * + * @param value double + * @return rounded value + */ + private static double round(double value) { + double factor = 10000000000.0; + double d = value * factor; + long l = Math.round(d); + return (double) l / factor; + } + /** * Create an xml VertexImpl and place it in the map *************** *** 956,962 **** } map.put(vertex, xml); ! xml.setX(vertex.getX()); ! xml.setY(vertex.getY()); ! xml.setZ(vertex.getZ()); return xml; } --- 969,975 ---- } map.put(vertex, xml); ! xml.setX(round(vertex.getX())); ! xml.setY(round(vertex.getY())); ! xml.setZ(round(vertex.getZ())); return xml; } |