From: <ha...@us...> - 2014-05-27 00:27:02
|
Revision: 19740 http://sourceforge.net/p/jmol/code/19740 Author: hansonr Date: 2014-05-27 00:26:31 +0000 (Tue, 27 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/Jmol/src/javajs/util/P3.java trunk/Jmol/src/javajs/util/P4.java trunk/Jmol/src/javajs/util/T3.java trunk/Jmol/src/javajs/util/T4.java trunk/Jmol/src/javajs/util/V3.java trunk/Jmol/src/org/jmol/script/ScriptEval.java trunk/Jmol/src/org/jmol/symmetry/Symmetry.java trunk/Jmol/src/org/jmol/symmetry/SymmetryOperation.java trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/javajs/util/P3.java =================================================================== --- trunk/Jmol/src/javajs/util/P3.java 2014-05-26 21:13:49 UTC (rev 19739) +++ trunk/Jmol/src/javajs/util/P3.java 2014-05-27 00:26:31 UTC (rev 19740) @@ -33,6 +33,10 @@ */ public class P3 extends T3 { + public P3() { + // ignore T3 + } + public static P3 newP(T3 t) { P3 p = new P3(); p.x = t.x; Modified: trunk/Jmol/src/javajs/util/P4.java =================================================================== --- trunk/Jmol/src/javajs/util/P4.java 2014-05-26 21:13:49 UTC (rev 19739) +++ trunk/Jmol/src/javajs/util/P4.java 2014-05-27 00:26:31 UTC (rev 19740) @@ -32,6 +32,14 @@ */ public class P4 extends T4 { + /** + * + * @j2sIgnore * + */ + public P4() { + // skip T4() constructor + } + public static P4 new4(float x, float y, float z, float w) { P4 pt = new P4(); pt.set4(x, y, z, w); Modified: trunk/Jmol/src/javajs/util/T3.java =================================================================== --- trunk/Jmol/src/javajs/util/T3.java 2014-05-26 21:13:49 UTC (rev 19739) +++ trunk/Jmol/src/javajs/util/T3.java 2014-05-27 00:26:31 UTC (rev 19740) @@ -36,6 +36,10 @@ public float x, y, z; + /** + * @j2sIgnore + * + */ public T3() { } Modified: trunk/Jmol/src/javajs/util/T4.java =================================================================== --- trunk/Jmol/src/javajs/util/T4.java 2014-05-26 21:13:49 UTC (rev 19739) +++ trunk/Jmol/src/javajs/util/T4.java 2014-05-27 00:26:31 UTC (rev 19740) @@ -37,6 +37,8 @@ /** * Constructs and initializes a Tuple4f to (0,0,0,0). + * + * @j2sIgnore * */ public T4() { } Modified: trunk/Jmol/src/javajs/util/V3.java =================================================================== --- trunk/Jmol/src/javajs/util/V3.java 2014-05-26 21:13:49 UTC (rev 19739) +++ trunk/Jmol/src/javajs/util/V3.java 2014-05-27 00:26:31 UTC (rev 19740) @@ -32,6 +32,9 @@ */ public class V3 extends T3 { + public V3() { + // ignore T3 + } public static V3 newV(T3 t) { return V3.new3(t.x, t.y, t.z); } Modified: trunk/Jmol/src/org/jmol/script/ScriptEval.java =================================================================== --- trunk/Jmol/src/org/jmol/script/ScriptEval.java 2014-05-26 21:13:49 UTC (rev 19739) +++ trunk/Jmol/src/org/jmol/script/ScriptEval.java 2014-05-27 00:26:31 UTC (rev 19740) @@ -7575,7 +7575,7 @@ TickInfo tickInfo = tickParamAsStr(index, true, false, false); index = iToken; String id = null; - P3[] points = null; + P3[] oabc = null; Object newUC = null; boolean isOffset = false; boolean isReset = false; @@ -7646,7 +7646,9 @@ //$FALL-THROUGH$ default: if (isArrayParameter(index + 1)) { - points = getPointArray(index, 4); + // Origin vA vB vC + // these are VECTORS, though + oabc = getPointArray(index, 4); index = iToken; } else if (slen == index + 2) { if (getToken(index + 1).tok == T.integer @@ -7664,13 +7666,13 @@ if (mad == Integer.MAX_VALUE) vwr.am.cai = -1; if (newUC != null) - points = vwr.getPts0xyz(newUC); + oabc = vwr.getPts0xyz(newUC); if (icell != Integer.MAX_VALUE) vwr.ms.setUnitCellOffset(vwr.getCurrentUnitCell(), null, icell); else if (id != null) vwr.setCurrentCage(id); - else if (isReset ||points != null) - vwr.setCurrentCagePts(points); + else if (isReset ||oabc != null) + vwr.setCurrentCagePts(oabc); setObjectMad(JC.SHAPE_UCCAGE, "unitCell", mad); if (pt != null) vwr.ms.setUnitCellOffset(vwr.getCurrentUnitCell(), pt, 0); Modified: trunk/Jmol/src/org/jmol/symmetry/Symmetry.java =================================================================== --- trunk/Jmol/src/org/jmol/symmetry/Symmetry.java 2014-05-26 21:13:49 UTC (rev 19739) +++ trunk/Jmol/src/org/jmol/symmetry/Symmetry.java 2014-05-27 00:26:31 UTC (rev 19740) @@ -835,33 +835,23 @@ P3[] pts = new P3[4]; P3 pt = new P3(); M3 m3 = new M3(); - m.getRotationScale(m3); m.getTranslation(pt); if (isRev) { - pts[0] = P3.new3(0, 0, 0); - pts[1] = P3.new3(1, 0, 0); - pts[2] = P3.new3(0, 1, 0); - pts[3] = P3.new3(0, 0, 1); m3.invert(); m3.transpose(); m3.rotate(pt); - for (int i = 0; i < 4; i++) { - m3.rotate(pts[i]); - pts[i].sub(pt); - uc.toCartesian(pts[i], false); - } - } else { - uc.toCartesian(pt, false); - M3 m3b = new M3(); - ((Symmetry)uc).unitCell.matrixFractionalToCartesian.getRotationScale(m3b); - m3.mul2(m3b, m3); - m3.transpose(); - pts[0] = P3.newP(pt); - pts[1] = P3.new3(m3.m00, m3.m01, m3.m02); - pts[2] = P3.new3(m3.m10, m3.m11, m3.m12); - pts[3] = P3.new3(m3.m20, m3.m21, m3.m22); - } + pt.scale(-1); + } + pts[0] = P3.newP(pt); + pts[1] = P3.new3(1, 0, 0); + pts[2] = P3.new3(0, 1, 0); + pts[3] = P3.new3(0, 0, 1); + for (int i = 1; i < 4; i++) { + m3.rotate(pts[i]); + uc.toCartesian(pts[i], false); + System.out.println(pts[i]); + } return pts; } Modified: trunk/Jmol/src/org/jmol/symmetry/SymmetryOperation.java =================================================================== --- trunk/Jmol/src/org/jmol/symmetry/SymmetryOperation.java 2014-05-26 21:13:49 UTC (rev 19739) +++ trunk/Jmol/src/org/jmol/symmetry/SymmetryOperation.java 2014-05-27 00:26:31 UTC (rev 19740) @@ -357,8 +357,11 @@ linearRotTrans[linearRotTrans.length - 1] = 1; // may be a-b,-5a-5b,-c;0,0,0 form int transPt = xyz.indexOf(';') + 1; - if (transPt != 0) + if (transPt != 0) { allowScaling = true; + if (transPt == xyz.length()) + xyz += "0,0,0"; + } int rotPt = -1; String[] myLabels = (op == null || modDim == 0 ? null : op.myLabels); if (myLabels == null) @@ -367,6 +370,7 @@ if (modDim > 0) for (int i = modDim + 3; --i >= 0;) xyz = PT.rep(xyz, labelsXn[i], labelsXnSub[i]); + int xpt = 0; int tpt0 = 0; int rowPt = 0; char ch; @@ -406,13 +410,14 @@ case 'h': tpt0 = rowPt * nRows; int ipt = (ch >= 'x' ? ch - 'x' :ch - 'a' + dimOffset); + xpt = tpt0 + ipt; int val = (isNegative ? -1 : 1); if (allowScaling && iValue != 0) { - linearRotTrans[tpt0 + ipt] = iValue; + linearRotTrans[xpt] = iValue; val = (int) iValue; iValue = 0; } else { - linearRotTrans[tpt0 + ipt] = val; + linearRotTrans[xpt] = val; } strT += plusMinus(strT, val, myLabels[ipt]); break; @@ -463,7 +468,12 @@ } if (ich >= 0 && ich <= 9) { if (isDenominator) { - iValue /= ich; + if (iValue == 0) { + // a/2,.... + linearRotTrans[xpt] /= ich; + } else { + iValue /= ich; + } } else { iValue = iValue * 10 + (isNegative ? -1 : 1) * ich; isNegative = false; Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2014-05-26 21:13:49 UTC (rev 19739) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2014-05-27 00:26:31 UTC (rev 19740) @@ -3102,10 +3102,10 @@ ms.setModelCage(am.cmi, (SymmetryInterface) data[1]); } - public void setCurrentCagePts(P3[] ptsOrMat4) { + public void setCurrentCagePts(T3[] originABC) { try { ms.setModelCage(am.cmi, - ptsOrMat4 == null ? null : Interface.getSymmetry().getUnitCell(ptsOrMat4, false)); + originABC == null ? null : Interface.getSymmetry().getUnitCell(originABC, false)); } catch (Exception e) { // } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |