From: <ha...@us...> - 2011-07-30 18:42:47
|
Revision: 15891 http://jmol.svn.sourceforge.net/jmol/?rev=15891&view=rev Author: hansonr Date: 2011-07-30 18:42:41 +0000 (Sat, 30 Jul 2011) Log Message: ----------- version=12.2.RC2_dev # bug fix: MO for multi-model file does not save state properly Modified Paths: -------------- trunk/Jmol/src/org/jmol/shape/MeshCollection.java trunk/Jmol/src/org/jmol/shapespecial/Draw.java trunk/Jmol/src/org/jmol/shapesurface/Isosurface.java trunk/Jmol/src/org/jmol/shapesurface/MolecularOrbital.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties Modified: trunk/Jmol/src/org/jmol/shape/MeshCollection.java =================================================================== --- trunk/Jmol/src/org/jmol/shape/MeshCollection.java 2011-07-30 17:57:54 UTC (rev 15890) +++ trunk/Jmol/src/org/jmol/shape/MeshCollection.java 2011-07-30 18:42:41 UTC (rev 15891) @@ -48,7 +48,6 @@ public int meshCount; public Mesh[] meshes = new Mesh[4]; public Mesh currentMesh; - public int modelCount; public boolean isFixed; public int nUnnamed; public short colix; @@ -142,7 +141,6 @@ super.initShape(); colix = Graphics3D.ORANGE; color = 0xFFFFFFFF; - modelCount = viewer.getModelCount(); } @SuppressWarnings("unchecked") Modified: trunk/Jmol/src/org/jmol/shapespecial/Draw.java =================================================================== --- trunk/Jmol/src/org/jmol/shapespecial/Draw.java 2011-07-30 17:57:54 UTC (rev 15890) +++ trunk/Jmol/src/org/jmol/shapespecial/Draw.java 2011-07-30 18:42:41 UTC (rev 15891) @@ -152,7 +152,6 @@ polygon = null; nidentifiers = nbitsets = 0; vData = new ArrayList<Object[]>(); - modelCount = viewer.getModelCount(); bsAllModels = null; intersectID = null; slabData = null; @@ -212,7 +211,7 @@ if ("modelIndex" == propertyName) { //from saved state -- used to set modelVertices indicatedModelIndex = ((Integer) value).intValue(); - if (indicatedModelIndex < 0 || indicatedModelIndex >= modelCount) + if (indicatedModelIndex < 0 || indicatedModelIndex >= viewer.getModelCount()) return; vData.add(new Object[] { Integer.valueOf(PT_MODEL_INDEX), (modelInfo = new int[] { indicatedModelIndex, 0 }) }); @@ -533,6 +532,7 @@ if (polygon == null && (lineData != null ? lineData.size() == 0 : (vData.size() == 0) == (connections == null)) || !isArrow && connections != null) return false; // connections only for arrows at this point + int modelCount = viewer.getModelCount(); if (polygon != null || lineData != null || indicatedModelIndex < 0 && (isFixed || isArrow || isCurve || isCircle || isCylinder || modelCount == 1)) { // make just ONE copy @@ -1258,7 +1258,7 @@ if (m.drawType == JmolConstants.DRAW_POLYGON) continue; if (m.visibilityFlags != 0) { - int mCount = (m.modelFlags == null ? 1 : modelCount); + int mCount = (m.modelFlags == null ? 1 : viewer.getModelCount()); for (int iModel = mCount; --iModel >= 0;) { if (m.modelFlags != null && !m.modelFlags.get(iModel) || m.polygonIndexes == null @@ -1285,7 +1285,6 @@ } private String getDrawCommand(DrawMesh mesh) { - modelCount = viewer.getModelCount(); if (mesh != null) return getDrawCommand(mesh, mesh.modelIndex); @@ -1310,6 +1309,7 @@ && mesh.drawVertexCount == 0 && mesh.drawVertexCounts == null) return ""; StringBuffer str = new StringBuffer(); + int modelCount = viewer.getModelCount(); if (!mesh.isFixed && iModel >= 0 && modelCount > 1) appendCmd(str, "frame " + viewer.getModelNumberDotted(iModel)); str.append(" draw ID ").append(Escape.escape(mesh.thisID)); @@ -1468,7 +1468,7 @@ info.put("scale", new Float(mesh.scale)); if (mesh.drawType == JmolConstants.DRAW_MULTIPLE) { List<Map<String, Object>> m = new ArrayList<Map<String,Object>>(); - modelCount = viewer.getModelCount(); + int modelCount = viewer.getModelCount(); for (int k = 0; k < modelCount; k++) { if (mesh.ptCenters[k] == null) continue; @@ -1514,7 +1514,7 @@ public String getShapeState() { StringBuffer s = new StringBuffer("\n"); appendCmd(s, "draw delete"); - modelCount = viewer.getModelCount(); + int modelCount = viewer.getModelCount(); for (int i = 0; i < meshCount; i++) { DrawMesh mesh = dmeshes[i]; if (mesh.vertexCount == 0 && mesh.lineData == null) Modified: trunk/Jmol/src/org/jmol/shapesurface/Isosurface.java =================================================================== --- trunk/Jmol/src/org/jmol/shapesurface/Isosurface.java 2011-07-30 17:57:54 UTC (rev 15890) +++ trunk/Jmol/src/org/jmol/shapesurface/Isosurface.java 2011-07-30 18:42:41 UTC (rev 15891) @@ -788,6 +788,7 @@ String cmd = imesh.scriptCommand; if (cmd == null) return; + int modelCount = viewer.getModelCount(); if (modelCount > 1) appendCmd(sb, "frame " + viewer.getModelNumberDotted(imesh.modelIndex)); cmd = TextFormat.simpleReplace(cmd, "; isosurface map", " map"); Modified: trunk/Jmol/src/org/jmol/shapesurface/MolecularOrbital.java =================================================================== --- trunk/Jmol/src/org/jmol/shapesurface/MolecularOrbital.java 2011-07-30 17:57:54 UTC (rev 15890) +++ trunk/Jmol/src/org/jmol/shapesurface/MolecularOrbital.java 2011-07-30 18:42:41 UTC (rev 15891) @@ -89,7 +89,7 @@ moDebug = false; int modelIndex = ((Integer) value).intValue(); strID = getId(modelIndex); - Logger.info("MO init " + strID); + //Logger.info("MO init " + strID); // overide bitset selection super.setProperty("init", null, null); super.setProperty("modelIndex", Integer.valueOf(modelIndex), null); @@ -281,7 +281,7 @@ } private String getId(int modelIndex) { - return "mo_model" + viewer.getModelNumber(modelIndex); + return "mo_model" + viewer.getModelNumberDotted(modelIndex); } @SuppressWarnings("unchecked") @@ -440,6 +440,7 @@ if (htModels == null) return ""; StringBuffer s = new StringBuffer(); + int modelCount = viewer.getModelCount(); for (int i = 0; i < modelCount; i++) s.append(getMoState(i)); //System.out.println("molecular orbital state " + s.length()); @@ -451,6 +452,7 @@ if (!getSettings(strID)) return ""; StringBuffer s = new StringBuffer(); + int modelCount = viewer.getModelCount(); if (modelCount > 1) appendCmd(s, "frame " + viewer.getModelNumberDotted(modelIndex)); if (moCutoff != null) Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2011-07-30 17:57:54 UTC (rev 15890) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2011-07-30 18:42:41 UTC (rev 15891) @@ -3,6 +3,7 @@ version=12.2.RC2_dev +# bug fix: MO for multi-model file does not save state properly # bug fix: GROMACS reader should not use sorbital group 3 name SOL for water -- changed to WAT # bug fix: SOL considered solvent, but is sorbitol; SOL added to carbohydrate list instead # FEATURE CHANGE: "ligand" definition changed to This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |