Revision: 20372 http://sourceforge.net/p/jmol/code/20372 Author: hansonr Date: 2015-03-09 19:38:13 +0000 (Mon, 09 Mar 2015) Log Message: ----------- Jmol.___JmolVersion="14.3.13_2015.03.09"
new feature: color polyhedra red blue (edge color blue) bug fix: show state/xxxx does not work Modified Paths: -------------- trunk/Jmol/src/org/jmol/renderspecial/PolyhedraRenderer.java trunk/Jmol/src/org/jmol/script/ScriptCompiler.java trunk/Jmol/src/org/jmol/script/ScriptEval.java trunk/Jmol/src/org/jmol/scriptext/CmdExt.java trunk/Jmol/src/org/jmol/shapespecial/Polyhedra.java trunk/Jmol/src/org/jmol/shapespecial/Polyhedron.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties Modified: trunk/Jmol/src/org/jmol/renderspecial/PolyhedraRenderer.java =================================================================== --- trunk/Jmol/src/org/jmol/renderspecial/PolyhedraRenderer.java 2015-03-09 02:05:50 UTC (rev 20371) +++ trunk/Jmol/src/org/jmol/renderspecial/PolyhedraRenderer.java 2015-03-09 19:38:13 UTC (rev 20372) @@ -50,23 +50,20 @@ drawEdges = polyhedra.drawEdges; g3d.addRenderer(T.triangles); vibs = (ms.vibrations != null && tm.vibrationOn); - short[] colixes = polyhedra.colixes; boolean needTranslucent = false; - for (int i = polyhedra.polyhedronCount; --i >= 0;) { - if (!polyhedrons[i].isValid) - continue; - int iAtom = polyhedrons[i].centralAtom.i; - short colix = (colixes == null || iAtom >= colixes.length ? - C.INHERIT_ALL : polyhedra.colixes[iAtom]); - if (render1(polyhedrons[i], colix)) + for (int i = polyhedra.polyhedronCount; --i >= 0;) + if (polyhedrons[i].isValid && render1(polyhedrons[i])) needTranslucent = true; - } return needTranslucent; } - private boolean render1(Polyhedron p, short colix) { + private boolean render1(Polyhedron p) { if (p.visibilityFlags == 0) return false; + short[] colixes = ((Polyhedra) shape).colixes; + int iAtom = p.centralAtom.i; + short colix = (colixes == null || iAtom >= colixes.length ? C.INHERIT_ALL + : colixes[iAtom]); colix = C.getColixInherited(colix, p.centralAtom.colixAtom); boolean needTranslucent = false; if (C.renderPass2(colix)) { @@ -103,10 +100,12 @@ fillFace(p.normixes[i++], screens[planes[j++]], screens[planes[j++]], screens[planes[j++]]); // edges are not drawn translucently ever + if (p.colixEdge != C.INHERIT_ALL) + colix = p.colixEdge; if (g3d.setC(C.getColixTranslucent3(colix, false, 0))) - for (int i = 0, j = 0; j < planes.length;) - drawFace(p.normixes[i++], screens[planes[j++]], - screens[planes[j++]], screens[planes[j++]]); + for (int i = 0, j = 0; j < planes.length;) + drawFace(p.normixes[i++], screens[planes[j++]], screens[planes[j++]], + screens[planes[j++]]); return needTranslucent; } Modified: trunk/Jmol/src/org/jmol/script/ScriptCompiler.java =================================================================== --- trunk/Jmol/src/org/jmol/script/ScriptCompiler.java 2015-03-09 02:05:50 UTC (rev 20371) +++ trunk/Jmol/src/org/jmol/script/ScriptCompiler.java 2015-03-09 19:38:13 UTC (rev 20372) @@ -1886,10 +1886,6 @@ && !(ch == '-' && ident.equals("="))) checkUnquotedFileName(); break; - case T.show: - if (nTokens == 2 && tokAt(1) == T.state && theTok == T.divide) - implicitString = true; - break; } return OK; } Modified: trunk/Jmol/src/org/jmol/script/ScriptEval.java =================================================================== --- trunk/Jmol/src/org/jmol/script/ScriptEval.java 2015-03-09 02:05:50 UTC (rev 20371) +++ trunk/Jmol/src/org/jmol/script/ScriptEval.java 2015-03-09 19:38:13 UTC (rev 20372) @@ -8262,20 +8262,21 @@ if ((!isIsosurface || tokAt(index + 1) != T.to) && isColorParam(index)) { int argb = getArgbParamOrNone(index, false); colorvalue = (argb == 0 ? null : Integer.valueOf(argb)); - if (translucency == null && tokAt(index = iToken + 1) != T.nada) { + if (tokAt(index = iToken + 1) != T.nada && translucency == null) { getToken(index); isTranslucent = (theTok == T.translucent); if (isTranslucent || theTok == T.opaque) { translucency = paramAsStr(index); if (isTranslucent && isFloatParameter(index + 1)) translucentLevel = getTranslucentLevel(++index); - } else if (isColorParam(index)) { - argb = getArgbParamOrNone(index, false); - colorvalue1 = (argb == 0 ? null : Integer.valueOf(argb)); } - // checkLength(index + 1); - // iToken = index; } + if (isColorParam(index)) { + argb = getArgbParamOrNone(index, false); + colorvalue1 = (argb == 0 ? null : Integer.valueOf(argb)); + index = iToken + 1; + } + checkLength(index); } else if (shapeType == JC.SHAPE_LCAOCARTOON) { iToken--; // back up one } else { @@ -8387,7 +8388,8 @@ if (max == Float.MAX_VALUE) ce.hi = max; setShapeProperty(shapeType, "remapColor", ce); - showString(((String) getShapeProperty(shapeType, "dataRangeStr")).replace('\n',' ')); + showString(((String) getShapeProperty(shapeType, "dataRangeStr")) + .replace('\n', ' ')); if (translucentLevel == Float.MAX_VALUE) return; } else if (max != Float.MAX_VALUE) { @@ -8455,7 +8457,8 @@ break; } if (colorvalue1 != null - && (isIsosurface || shapeType == JC.SHAPE_CARTOON || shapeType == JC.SHAPE_RIBBONS)) + && (isIsosurface || shapeType == JC.SHAPE_CARTOON + || shapeType == JC.SHAPE_RIBBONS || shapeType == JC.SHAPE_POLYHEDRA)) setShapeProperty(shapeType, "colorPhase", new Object[] { colorvalue1, colorvalue }); else if (bs == null) Modified: trunk/Jmol/src/org/jmol/scriptext/CmdExt.java =================================================================== --- trunk/Jmol/src/org/jmol/scriptext/CmdExt.java 2015-03-09 02:05:50 UTC (rev 20371) +++ trunk/Jmol/src/org/jmol/scriptext/CmdExt.java 2015-03-09 19:38:13 UTC (rev 20372) @@ -3947,9 +3947,9 @@ break; } name = paramAsStr(2); - if (name.equals("/") && (len = slen) == 4) { - name = paramAsStr(3).toLowerCase(); + if (name.startsWith("/") && (len = slen) == 3) { if (!chk) { + name = name.substring(1).toLowerCase(); String[] info = PT.split(vwr.getStateInfo(), "\n"); SB sb = new SB(); for (int i = 0; i < info.length; i++) Modified: trunk/Jmol/src/org/jmol/shapespecial/Polyhedra.java =================================================================== --- trunk/Jmol/src/org/jmol/shapespecial/Polyhedra.java 2015-03-09 02:05:50 UTC (rev 20371) +++ trunk/Jmol/src/org/jmol/shapespecial/Polyhedra.java 2015-03-09 19:38:13 UTC (rev 20372) @@ -179,7 +179,16 @@ if (propertyName.indexOf("color") == 0) { // from polyhedra command, we may not be using the prior select // but from Color we need to identify the centers. - bs = ("colorThis" == propertyName && iHaveCenterBitSet ? centers : andBitSet(bs)); + bs = ("colorThis" == propertyName && iHaveCenterBitSet ? centers + : andBitSet(bs)); + short colixEdge = ("colorPhase" == propertyName ? C + .getColix(((Integer) ((Object[]) value)[0]).intValue()) + : C.INHERIT_ALL); + for (int i = polyhedronCount; --i >= 0;) + if (bs.get(polyhedrons[i].centralAtom.i)) + polyhedrons[i].colixEdge = colixEdge; + if ("colorPhase" == propertyName) + value = ((Object[]) value)[1]; propertyName = "color"; //allow super } @@ -187,7 +196,8 @@ if (propertyName.indexOf("translucency") == 0) { // from polyhedra command, we may not be using the prior select // but from Color we need to identify the centers. - bs = ("translucentThis".equals(value) && iHaveCenterBitSet ? centers : andBitSet(bs)); + bs = ("translucentThis".equals(value) && iHaveCenterBitSet ? centers + : andBitSet(bs)); if (value.equals("translucentThis")) value = "translucent"; //allow super @@ -197,7 +207,7 @@ setLighting(((Integer) value).intValue() == T.fullylit, bs); return; } - + if ("radius" == propertyName) { radius = ((Float) value).floatValue(); return; @@ -592,6 +602,13 @@ else if (drawEdges == EDGES_ALL) appendCmd(s, "polyhedra edges"); s.append(vwr.getAtomShapeState(this)); + for (int i = 0; i < polyhedronCount; i++) { + Polyhedron p = polyhedrons[i]; + if (p.isValid && p.colixEdge != C.INHERIT_ALL && bsColixSet.get(p.centralAtom.i)) + appendCmd(s, "select ({" + p.centralAtom.i + "}); color polyhedra " + + (C.isColixTranslucent(colixes[p.centralAtom.i]) ? "translucent " : "") + + C.getHexCode(colixes[p.centralAtom.i]) + " " + C.getHexCode(p.colixEdge)); + } return s.toString(); } } Modified: trunk/Jmol/src/org/jmol/shapespecial/Polyhedron.java =================================================================== --- trunk/Jmol/src/org/jmol/shapespecial/Polyhedron.java 2015-03-09 02:05:50 UTC (rev 20371) +++ trunk/Jmol/src/org/jmol/shapespecial/Polyhedron.java 2015-03-09 19:38:13 UTC (rev 20372) @@ -4,6 +4,7 @@ import org.jmol.java.BS; import org.jmol.modelset.Atom; +import org.jmol.util.C; import org.jmol.util.Escape; public class Polyhedron { @@ -24,6 +25,7 @@ float faceCenterOffset, distanceFactor; boolean isFullyLit; public boolean isValid = true; + public short colixEdge = C.INHERIT_ALL; Polyhedron(Atom centralAtom, int ptCenter, int nPoints, int planeCount, P3[] otherAtoms, short[] normixes, byte[] planes, boolean collapsed, float faceCenterOffset, float distanceFactor) { Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2015-03-09 02:05:50 UTC (rev 20371) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2015-03-09 19:38:13 UTC (rev 20372) @@ -14,7 +14,13 @@ TODO: remove HTML5 dependency on synchronous file loading (check SCRIPT command for problems) -Jmol.___JmolVersion="14.3.13_2015.03.07" +Jmol.___JmolVersion="14.3.13_2015.03.09" + +new feature: color polyhedra red blue (edge color blue) + +bug fix: show state/xxxx does not work + +JmolVersion="14.3.13_2015.03.07" synchronized with 14.2.12_2015.03.07 bug fix: x[2] = y[2] fails This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Jmol-commits mailing list Jmol-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-commits