From: Egon W. <eg...@us...> - 2004-02-03 09:14:43
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/datamodel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30374/src/org/openscience/jmol/viewer/datamodel Modified Files: Unitcell.java Log Message: Yes! Jmol-HEAD can now also display Crystal's: Implemented calculation of unit cell vertices Index: Unitcell.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/viewer/datamodel/Unitcell.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Unitcell.java 3 Feb 2004 04:56:16 -0000 1.2 +++ Unitcell.java 3 Feb 2004 09:12:26 -0000 1.3 @@ -24,6 +24,7 @@ */ package org.openscience.jmol.viewer.datamodel; +import org.openscience.cdk.geometry.CrystalGeometryTools; import org.openscience.jmol.viewer.*; import org.openscience.jmol.viewer.g3d.Graphics3D; import javax.vecmath.Point3f; @@ -53,15 +54,24 @@ beta = notionalUnitcell[4]; gamma = notionalUnitcell[5]; // these vertices are wrong, but it is the best that mth can do + double[][] cart = CrystalGeometryTools.notionalToCartesian(a,b,c,alpha,beta,gamma); vertices = new Point3f[] { new Point3f(0, 0, 0), - new Point3f(0, 0, a), - new Point3f(0, b, 0), - new Point3f(0, b, a), - new Point3f(c, 0, 0), - new Point3f(c, 0, a), - new Point3f(c, b, 0), - new Point3f(c, b, a), + new Point3f((float)cart[0][0], (float)cart[0][1], (float)cart[0][2]), // a + new Point3f((float)cart[1][0], (float)cart[1][1], (float)cart[1][2]), // b + new Point3f((float)cart[0][0] + (float)cart[1][0], + (float)cart[0][1] + (float)cart[1][1], + (float)cart[0][2] + (float)cart[1][2]), // a+b + new Point3f((float)cart[2][0], (float)cart[2][1], (float)cart[2][2]), // c + new Point3f((float)cart[0][0] + (float)cart[2][0], + (float)cart[0][1] + (float)cart[2][1], + (float)cart[0][2] + (float)cart[2][2]), // a+c + new Point3f((float)cart[1][0] + (float)cart[2][0], + (float)cart[1][1] + (float)cart[2][1], + (float)cart[1][2] + (float)cart[2][2]), // b+c + new Point3f((float)cart[0][0] + (float)cart[1][0] + (float)cart[2][0], + (float)cart[0][1] + (float)cart[1][1] + (float)cart[2][1], + (float)cart[0][2] + (float)cart[1][2] + (float)cart[2][2]), // a+b+c }; /**************************************************************** * all your changes should be above this line |