From: <ha...@us...> - 2008-03-31 16:52:22
|
Revision: 9230 http://jmol.svn.sourceforge.net/jmol/?rev=9230&view=rev Author: hansonr Date: 2008-03-31 09:52:19 -0700 (Mon, 31 Mar 2008) Log Message: ----------- version=11.5.23 /take 2 # new feature: minimize ENERGY # no stepping # new feature: minimize STEPS n # new feature: minimize CRITERION x.y # new feature: minimize CLEAR # flushes logged info and saved atom info # # new feature: echoCallback # new feature: measureCallback # new feature: minimizationCallback # new feature: scriptCallback # new feature: save/restore coordinates # new feature: getProperty minimizationInfo # # code: more efficient minimize calculation setup; better logging # code: "notify" methods in JmolStatusListener consolidated # code: Tokens organized # Modified Paths: -------------- trunk/Jmol/src/org/jmol/modelset/AtomCollection.java trunk/Jmol/src/org/jmol/viewer/Eval.java trunk/Jmol/src/org/jmol/viewer/StateManager.java trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/org/jmol/modelset/AtomCollection.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/AtomCollection.java 2008-03-31 01:28:36 UTC (rev 9229) +++ trunk/Jmol/src/org/jmol/modelset/AtomCollection.java 2008-03-31 16:52:19 UTC (rev 9230) @@ -810,14 +810,13 @@ BitSetUtil.copy(bs, tainted[type]); } - public String getAtomicPropertyState(int taintWhat) { + public String getAtomicPropertyState(int taintWhat, BitSet bsSelected) { BitSet bs; StringBuffer commands = new StringBuffer(); for (byte i = 0; i < TAINT_MAX; i++) if (taintWhat < 0 || i == taintWhat) - if((bs = getTaintedAtoms(i)) != null) { + if((bs = (bsSelected != null ? bsSelected : getTaintedAtoms(i))) != null) getAtomicPropertyState(commands, atoms, atomCount, i, bs, null, null); - } return commands.toString(); } Modified: trunk/Jmol/src/org/jmol/viewer/Eval.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Eval.java 2008-03-31 01:28:36 UTC (rev 9229) +++ trunk/Jmol/src/org/jmol/viewer/Eval.java 2008-03-31 16:52:19 UTC (rev 9230) @@ -8130,7 +8130,7 @@ return; case Token.coord: if (!isSyntaxCheck) - viewer.saveCoordinates(saveName); + viewer.saveCoordinates(saveName, viewer.getSelectionSet()); return; case Token.identifier: if (parameterAsString(1).equalsIgnoreCase("selection")) { @@ -8641,6 +8641,16 @@ if (!isSyntaxCheck) msg = viewer.getUnitCellInfoText(); break; + case Token.coord: + if ((len = statementLength) == 2) { + if (!isSyntaxCheck) + msg = viewer.getCoordinateState(viewer.getSelectionSet()); + break; + } + String nameC = parameterAsString(2); + if (!isSyntaxCheck) + msg = viewer.getSavedCoordinates(nameC); + break; case Token.state: if ((len = statementLength) == 2) { if (!isSyntaxCheck) Modified: trunk/Jmol/src/org/jmol/viewer/StateManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/StateManager.java 2008-03-31 01:28:36 UTC (rev 9229) +++ trunk/Jmol/src/org/jmol/viewer/StateManager.java 2008-03-31 16:52:19 UTC (rev 9230) @@ -220,9 +220,9 @@ return (script == null ? "" : script); } - void saveCoordinates(String saveName) { + void saveCoordinates(String saveName, BitSet bsSelected) { saveName = lastCoordinates = "Coordinates_" + saveName; - saved.put(saveName, viewer.getCoordinateState()); + saved.put(saveName, viewer.getCoordinateState(bsSelected)); } String getSavedCoordinates(String saveName) { Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2008-03-31 01:28:36 UTC (rev 9229) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2008-03-31 16:52:19 UTC (rev 9230) @@ -490,9 +490,9 @@ return stateManager.getSavedStructure(saveName); } - public void saveCoordinates(String saveName) { + public void saveCoordinates(String saveName, BitSet bsSelected) { //from Eval - stateManager.saveCoordinates(saveName); + stateManager.saveCoordinates(saveName, bsSelected); } String getSavedCoordinates(String saveName) { @@ -2408,7 +2408,7 @@ s.append(global.getState(sfunc)); if (isAll || type.equalsIgnoreCase("dataState")) dataManager.getDataState(s, sfunc, modelSet.atoms, - getAtomCount(), modelSet.getAtomicPropertyState(-1)); + getAtomCount(), modelSet.getAtomicPropertyState(-1, null)); // definitions, connections, atoms, bonds, labels, echos, shapes if (isAll || type.equalsIgnoreCase("modelState")) @@ -2443,8 +2443,8 @@ return modelSet.getState(null, false); } - public String getCoordinateState() { - return modelSet.getAtomicPropertyState(AtomCollection.TAINT_COORD); + public String getCoordinateState(BitSet bsSelected) { + return modelSet.getAtomicPropertyState(AtomCollection.TAINT_COORD, bsSelected); } void setCurrentColorRange(String label) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |