Revision: 20831 http://sourceforge.net/p/jmol/code/20831 Author: hansonr Date: 2015-10-17 23:11:35 +0000 (Sat, 17 Oct 2015) Log Message: ----------- Jmol.___JmolVersion="14.4.0_2015.10.17"
bug fix: if (...) \n { .... not working bug fix: CIF reader will read empty second model for IUCr files with terminal data_global block bug fix: polyhedra bonds unitcell can cause error in HTML5 bug fix: nucleic backbone should include O atoms on P and C bug fix: nucleic spine should not include C2' bug fix: pmesh/isosurface RESOLUTION 0.0001 with plane can cause loss of some or all of the plane -- resolution 0.0001 creates just a minimum of triangles to construct the plane. bug fix: set testflag4;isosurface ... ; does not generate normals bug fix: (Application) set refreshing false shows Jmol console in model frame (Java bug??) Modified Paths: -------------- branches/v14_4/Jmol/src/org/jmol/adapter/readers/cif/CifReader.java branches/v14_4/Jmol/src/org/jmol/jvxl/readers/VolumeDataReader.java branches/v14_4/Jmol/src/org/jmol/modelsetbio/Resolver.java branches/v14_4/Jmol/src/org/jmol/rendersurface/IsosurfaceRenderer.java branches/v14_4/Jmol/src/org/jmol/script/ScriptCompiler.java branches/v14_4/Jmol/src/org/jmol/shapespecial/Polyhedra.java branches/v14_4/Jmol/src/org/jmol/viewer/JC.java branches/v14_4/Jmol/src/org/jmol/viewer/Jmol.properties branches/v14_4/Jmol/src/org/jmol/viewer/Viewer.java Modified: branches/v14_4/Jmol/src/org/jmol/adapter/readers/cif/CifReader.java =================================================================== --- branches/v14_4/Jmol/src/org/jmol/adapter/readers/cif/CifReader.java 2015-10-17 23:11:03 UTC (rev 20830) +++ branches/v14_4/Jmol/src/org/jmol/adapter/readers/cif/CifReader.java 2015-10-17 23:11:35 UTC (rev 20831) @@ -356,7 +356,10 @@ @Override protected void finalizeSubclassReader() throws Exception { - if (!isMMCIF || !finalizeSubclass()) + // added check for final data_global + if (asc.iSet > 0 && asc.getAtomSetAtomCount(asc.iSet) == 0) + asc.atomSetCount--; + else if (!isMMCIF || !finalizeSubclass()) applySymmetryAndSetTrajectory(); int n = asc.atomSetCount; if (n > 1) Modified: branches/v14_4/Jmol/src/org/jmol/jvxl/readers/VolumeDataReader.java =================================================================== --- branches/v14_4/Jmol/src/org/jmol/jvxl/readers/VolumeDataReader.java 2015-10-17 23:11:03 UTC (rev 20830) +++ branches/v14_4/Jmol/src/org/jmol/jvxl/readers/VolumeDataReader.java 2015-10-17 23:11:35 UTC (rev 20831) @@ -203,6 +203,8 @@ nGrid = gridMax; } } + if (nGrid == 1) + nGrid = 2; ptsPerAngstrom = (nGrid - 1) / range; if (ptsPerAngstrom < minPointsPerAngstrom) { ptsPerAngstrom = minPointsPerAngstrom; Modified: branches/v14_4/Jmol/src/org/jmol/modelsetbio/Resolver.java =================================================================== --- branches/v14_4/Jmol/src/org/jmol/modelsetbio/Resolver.java 2015-10-17 23:11:03 UTC (rev 20830) +++ branches/v14_4/Jmol/src/org/jmol/modelsetbio/Resolver.java 2015-10-17 23:11:35 UTC (rev 20831) @@ -1419,7 +1419,7 @@ "C5'", // 7 - sugar 5' carbon SPINE "C4'", // 8 - sugar ring 4' carbon SPINE "C3'", // 9 - sugar ring 3' carbon SPINE - "O3'", // 10 - sugar 3' oxygen + "O3'", // 10 - sugar 3' oxygen SPINE "C2'", // 11 - sugar ring 2' carbon "C1'", // 12 - sugar ring 1' carbon // Phosphorus is not required for a nucleic group because @@ -1541,8 +1541,8 @@ "H2''", "HO2'", - "O3P", // - third equivalent oxygen on phosphorus of phosphate - "OP3", // - third equivalent oxygen on phosphorus of phosphate -- new designation + "O3P", // 99 - third equivalent oxygen on phosphorus of phosphate + "OP3", //100 - third equivalent oxygen on phosphorus of phosphate -- new designation }; Modified: branches/v14_4/Jmol/src/org/jmol/rendersurface/IsosurfaceRenderer.java =================================================================== --- branches/v14_4/Jmol/src/org/jmol/rendersurface/IsosurfaceRenderer.java 2015-10-17 23:11:03 UTC (rev 20830) +++ branches/v14_4/Jmol/src/org/jmol/rendersurface/IsosurfaceRenderer.java 2015-10-17 23:11:35 UTC (rev 20831) @@ -529,17 +529,15 @@ for (int i = vertexCount; --i >= 0;) { if (vertexValues != null && Float.isNaN(vertexValues[i])) continue; - if (i > 100) - continue; pt1f.setT(vertices[i]); short n = mesh.normixes[i]; // -n is an intensity2sided and does not correspond to a true normal // index if (n >= 0) { - pt1f.scaleAdd2(3, vertexVectors[n], pt1f); - tm.transformPtScrT3(pt1f, pt1f); + pt2f.scaleAdd2(0.3f, vertexVectors[n], pt1f); + tm.transformPtScrT3(pt2f, pt2f); pt1f.set(screens[i].x, screens[i].y, screens[i].z); - g3d.drawLineAB(pt1f, pt1f); + g3d.drawLineAB(pt1f, pt2f); } } } Modified: branches/v14_4/Jmol/src/org/jmol/script/ScriptCompiler.java =================================================================== --- branches/v14_4/Jmol/src/org/jmol/script/ScriptCompiler.java 2015-10-17 23:11:03 UTC (rev 20830) +++ branches/v14_4/Jmol/src/org/jmol/script/ScriptCompiler.java 2015-10-17 23:11:35 UTC (rev 20831) @@ -721,11 +721,10 @@ if (lastFlowCommand == null) { parenCount = setBraceCount = braceCount = 0; ltoken.remove(0); - iBrace++; T t = ContextToken.newContext(true); addTokenToPrefix(setCommand(t)); pushContext(t); - vBraces.addLast(tokenCommand); + addBrace(tokenCommand); } else { parenCount = setBraceCount = 0; setCommand(lastFlowCommand); @@ -813,7 +812,8 @@ } if (endOfLine) { - if (!haveENDIF && flowContext != null && flowContext.checkForceEndIf(-1)) { + if (!haveENDIF && flowContext != null + && flowContext.checkForceEndIf(-1)) { boolean isOneLine = (flowContext.addLine == 0); // if (....) xxxxx; if (isComment) { if (!isOneLine) { @@ -855,6 +855,14 @@ return OK; } + /** + * @param t could be { or } or a command such as FOR or WHILE + */ + private void addBrace(T t) { + vBraces.addLast(t); + iBrace++; + } + private void pushContext(T t) { pushCount++; vPush.addLast(t); @@ -869,16 +877,16 @@ * * more than two tokens: * - * not a script function xxxx.spt(3,4,5) + * xxxx.spt(3,4,5) * * @return true if found */ private boolean wasImpliedScript() { - if (nTokens >= 2 && (tokCommand == T.script || tokCommand == T.macro) && checkImpliedScriptCmd) { + if (checkImpliedScriptCmd && nTokens >= 2 && (tokCommand == T.script || tokCommand == T.macro)) { String s = (nTokens == 2 ? lastToken.value.toString().toUpperCase() : null); - if (nTokens > 2 ? !(tokAt(2) == T.leftparen && ltoken.get(1).value - .toString().endsWith(".spt")) : s.endsWith(".SORT") + if (nTokens > 2 ? !(tokAt(2) == T.leftparen && ltoken.get(1).value.toString().endsWith(".spt")) + : s.endsWith(".SORT") || s.endsWith(".REVERSE") || s.endsWith(".POP") || s.indexOf(".SORT(") >= 0 || s.indexOf(".REVERSE(") >= 0 || s.indexOf(".POP(") >= 0 || s.indexOf(".PUSH(") >= 0 @@ -983,7 +991,7 @@ ltoken.add(0, setCommand(token)); } - private void getPrefixToken() { + private int getPrefixToken() { ident = script.substring(ichToken, ichToken + cchToken); identLC = ident.toLowerCase(); boolean isUserVar = lastToken.tok != T.per && !isDotDot && isContextVariable(identLC); @@ -1033,7 +1041,7 @@ // myName is just in case this is being used as a key to a hash theToken = SV.newSV((identLC.indexOf("property_") == 0 ? T.property : T.identifier), Integer.MAX_VALUE, ident).setName(myName); } - theTok = theToken.tok; + return theTok = theToken.tok; } /** @@ -1381,14 +1389,14 @@ private int parseKnownToken() { - getPrefixToken(); + int tok = getPrefixToken(); // specific token-based issues depend upon where we are in the command T token; if (isDotDot) { - if (theTok == T.leftsquare) { + if (tok == T.leftsquare) { bracketCount++; } else { addTokenToPrefix(T.o(T.string, ident)); @@ -1398,16 +1406,16 @@ return CONTINUE; } if (tokLastMath != 0) - tokLastMath = theTok; + tokLastMath = tok; if (flowContext != null && flowContext.token.tok == T.switchcmd - && flowContext.var != null && theTok != T.casecmd - && theTok != T.defaultcmd && lastToken.tok != T.switchcmd) + && flowContext.var != null && tok != T.casecmd + && tok != T.defaultcmd && lastToken.tok != T.switchcmd) return ERROR(ERROR_badContext, ident); - if (lastToken.tok == T.define && theTok != T.leftbrace && nTokens != 1) { - addTokenToPrefix(theTok == T.define ? lastToken : T.o(T.string, ident)); + if (lastToken.tok == T.define && tok != T.leftbrace && nTokens != 1) { + addTokenToPrefix(tok == T.define ? lastToken : T.o(T.string, ident)); return CONTINUE; } - switch (theTok) { + switch (tok) { case T.identifier: if (nTokens == 0 && !checkImpliedScriptCmd) { if (ident.charAt(0) == '\'') { @@ -1500,13 +1508,13 @@ checkNewSetCommand(); if (isNewSet && parenCount == 0 && bracketCount == 0 && ichToken <= setEqualPt) { - tokenizePlusPlus(theTok, false); + tokenizePlusPlus(tok, false); return CONTINUE; } else if (nSemiSkip == forPoint3 && nTokens == ptSemi + 2) { token = lastToken; addTokenToPrefix(T.tokenEquals); addTokenToPrefix(token); - addTokenToPrefix(theTok == T.minusMinus ? T.tokenMinus : T.tokenPlus); + addTokenToPrefix(tok == T.minusMinus ? T.tokenMinus : T.tokenPlus); addTokenToPrefix(T.i(1)); return CONTINUE; } @@ -1562,10 +1570,10 @@ if (!wasImpliedScript()) { // because if we need to repeat due to a.xxx = .... // then we don't want to force the end yet + // for (a in {selected}) { wrap(a, vnm, f) } + braceCount = parenCount = nSemiSkip = 0; - if (theToken.tok != T.casecmd && theToken.tok != T.defaultcmd) - vBraces.addLast(theToken); - iBrace++; + addBrace(theToken); isEndOfCommand = true; ichEnd = ichToken; } @@ -1677,13 +1685,13 @@ if (lltoken.get(iCommand - 1)[0].tok == T.end && lastFlowContext != null && lastFlowContext.forceEndIf && lastFlowContext.addLine > 0 - && isFlowIfContextOK(lastFlowContext, tokCommand)) { + && isFlowIfContextOK(lastFlowContext)) { flowContext = lastFlowContext; flowContext.forceEndIf = true; lltoken.remove(--iCommand); } else if (flowContext != null && flowContext.addLine > 0) { while (flowContext != null - && !isFlowIfContextOK(flowContext, tokCommand)) { + && !isFlowIfContextOK(flowContext)) { if (flowContext.checkForceEndIf(0)) { forceFlowEnd(flowContext.token); processTokenList(iLine, isFull); @@ -1736,8 +1744,7 @@ } if (theTok == T.rightbrace) { // if }, just push onto vBrace, but NOT onto ltoken - vBraces.addLast(tokenCommand); - iBrace++; + addBrace(tokenCommand); tokCommand = T.nada; return CONTINUE; } @@ -2075,19 +2082,36 @@ private boolean checkFlowStartBrace(boolean atEnd) { int tok = tokCommand; - if ((!T.tokAttr(tok, T.flowCommand) || tok == T.breakcmd || tok == T.continuecmd)) + switch (tok) { + default: + if (T.tokAttr(tok, T.flowCommand)) { + if (atEnd) { + switch (tok) { + case T.casecmd: + case T.defaultcmd: + break; + default: + flowContext.addLine = 0; + addBrace(tokenCommand); + lastFlowCommand = null; + break; + } + parenCount = braceCount = 0; + } + return true; + } + //$FALL-THROUGH$ + case T.breakcmd: + case T.continuecmd: return false; - if (atEnd) { - if (tokenCommand.tok != T.casecmd && tokenCommand.tok != T.defaultcmd) { - iBrace++; - vBraces.addLast(tokenCommand); - lastFlowCommand = null; - } - parenCount = braceCount = 0; } - return true; } + /** + * process a pending explicit right brace } + * + * @return continuation status + */ private int checkFlowEndBrace() { if (iBrace <= 0 || vBraces.get(iBrace - 1).tok != T.rightbrace) @@ -2096,6 +2120,10 @@ vBraces.remove(--iBrace); T token = vBraces.remove(--iBrace); if (theTok == T.leftbrace) { + // + // } + // { + // braceCount--; parenCount--; } @@ -2163,7 +2191,7 @@ int pt = lltoken.size(); switch (tokCommand) { case T.endifcmd: - if (!isFlowIfContextOK(flowContext, tokCommand)){ + if (!isFlowIfContextOK(flowContext)){ if (!haveENDIF) return RESTART; errorStr(ERROR_badContext, ident); @@ -2206,10 +2234,10 @@ break; case T.elseif: case T.elsecmd: - if (flowContext != null && !isFlowIfContextOK(flowContext, tokCommand)) { + if (flowContext != null && !isFlowIfContextOK(flowContext)) { flowContext = flowContext.parent; } - if (!isFlowIfContextOK(flowContext, tokCommand)) { + if (!isFlowIfContextOK(flowContext)) { if (!haveENDIF) return RESTART; errorStr(ERROR_badContext, ident); @@ -2269,23 +2297,42 @@ return OK; } + /** + * generate a new end token with pointer to the start or to default as the intValue + * and set it as the command token + * + * @param tokCommand end or endif + * @param ident "end" or "endif" + */ private void setFlowEnd(int tokCommand, String ident) { setCommand(T.tv(tokCommand, (flowContext.ptDefault > 0 ? flowContext.ptDefault : -flowContext.pt0), ident)); //copy } - - private boolean isFlowIfContextOK(ScriptFlowContext f, int tokCommand) { + /** + * check for proper sequence: if...[any number of elseif]...[zero or one else]...[endif] + * @param f + * @return true if OK + */ + private boolean isFlowIfContextOK(ScriptFlowContext f) { switch (f == null ? T.nada : f.token.tok) { - case T.elsecmd: - return tokCommand != T.elsecmd; case T.ifcmd: case T.elseif: return true; + case T.elsecmd: + return tokCommand != T.elsecmd; } return false; } + /** + * + * @param tok the XXX in END XXX + * @param ident + * @param pt1 + * @param isExplicitEnd actual END IF or END FOR, etc. + * @return true if no error + */ private boolean checkFlowEnd(int tok, String ident, int pt1, boolean isExplicitEnd) { if (isExplicitEnd) { @@ -2296,8 +2343,7 @@ switch (flowContext.token.tok) { case T.function: case T.parallel: - case T.trycmd: - + case T.trycmd: break; default: setFlowEnd(T.end, "end"); Modified: branches/v14_4/Jmol/src/org/jmol/shapespecial/Polyhedra.java =================================================================== --- branches/v14_4/Jmol/src/org/jmol/shapespecial/Polyhedra.java 2015-10-17 23:11:03 UTC (rev 20830) +++ branches/v14_4/Jmol/src/org/jmol/shapespecial/Polyhedra.java 2015-10-17 23:11:35 UTC (rev 20831) @@ -871,7 +871,14 @@ p10[3] = -((-p10[3]) ^ (1 << i0)); p1[3] = -((-p1[3]) ^ (1 << i)); b = (int[])((Object[]) o)[2]; - faceList.removeObj(b); + for (int j = faceList.size(); --j >= 0;) { + int[] f = faceList.get(j); + if (f[0] == b[0] && f[1] == b[1]) { + faceList.remove(j); + break; + } + } + // not supported for JavaScript faceList.removeObj(b); } return true; } Modified: branches/v14_4/Jmol/src/org/jmol/viewer/JC.java =================================================================== --- branches/v14_4/Jmol/src/org/jmol/viewer/JC.java 2015-10-17 23:11:03 UTC (rev 20830) +++ branches/v14_4/Jmol/src/org/jmol/viewer/JC.java 2015-10-17 23:11:35 UTC (rev 20831) @@ -621,9 +621,9 @@ // structure related // "@alpha _a=2", // rasmol doc says "approximately *.CA" - whatever? - "@_bb protein&_a>=1&_a<6 | nucleic& _a>=6&_a<14", // no H atoms + "@_bb protein&_a>=1&_a<6 | nucleic&(_a>=6&_a<14|_a>=73&&_a<=79||_a==99||_a=100)", // no H atoms "@backbone _bb | _H && connected(single, _bb)", - "@spine protein&_a>=1&_a<4|nucleic&_a>=6&_a<14&_a!=12", + "@spine protein&_a>=1&_a<4|nucleic&(_a>=6&_a<11|_a=13)", "@sidechain (protein,nucleic) & !backbone", "@base nucleic & !backbone", "@dynamic_flatring search('[a]')" Modified: branches/v14_4/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- branches/v14_4/Jmol/src/org/jmol/viewer/Jmol.properties 2015-10-17 23:11:03 UTC (rev 20830) +++ branches/v14_4/Jmol/src/org/jmol/viewer/Jmol.properties 2015-10-17 23:11:35 UTC (rev 20831) @@ -7,12 +7,27 @@ # see also http://chemapps.stolaf.edu/jmol/zip for daily updates +Jmol.___JmolVersion="14.4.0_2015.10.17" + +bug fix: if (...) \n { .... not working +bug fix: CIF reader will read empty second model for IUCr files with terminal data_global block +bug fix: polyhedra bonds unitcell can cause error in HTML5 +bug fix: nucleic backbone should include O atoms on P and C +bug fix: nucleic spine should not include C2' +bug fix: pmesh/isosurface RESOLUTION 0.0001 with plane can cause loss of some or all of the plane + -- resolution 0.0001 creates just a minimum of triangles to construct the plane. +bug fix: set testflag4;isosurface ... ; does not generate normals +bug fix: (Application) set refreshing false shows Jmol console in model frame (Java bug??) + Jmol.___JmolVersion="14.4.0_2015.10.14" +NOTE: GoDaddy's inadvertent forcing of revocation of the secure certificate for Jmol + prior to its expiration has disabled ALL Jmol applets created since Oct 15, 2014. + This is a mandatory upgrade. + bug fix: SHOW PROPERTY IDENTIFY crashes Jmol. - JmolVersion="14.4.0_2015.10.13" released Modified: branches/v14_4/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- branches/v14_4/Jmol/src/org/jmol/viewer/Viewer.java 2015-10-17 23:11:03 UTC (rev 20830) +++ branches/v14_4/Jmol/src/org/jmol/viewer/Viewer.java 2015-10-17 23:11:35 UTC (rev 20831) @@ -3558,7 +3558,7 @@ private boolean updateWindow(int width, int height) { //System.out.println("Viewer updateWindow " + width + " " + height); if (!refreshing || creatingImage) - return false; + return (refreshing ? false : !isJS); if (isTainted || tm.slabEnabled) setModelVisibility(); isTainted = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ _______________________________________________ Jmol-commits mailing list Jmol-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-commits