From: <ha...@us...> - 2010-04-17 20:51:50
|
Revision: 12878 http://jmol.svn.sourceforge.net/jmol/?rev=12878&view=rev Author: hansonr Date: 2010-04-17 20:51:43 +0000 (Sat, 17 Apr 2010) Log Message: ----------- version=12.0.RC6 # new feature: MO MODEL x.y .... specifies which model to use # # code: atom iterators made thread safe and optimized a bit # # code: parallel processor in place; working; # tested on dual core multiple processor Mac # result -- 8 sec --> 4 sec for the two molecular surfaces # # example PARALLEL code: see http://chemapps.stolaf.edu/jmol/docs/examples-11/data/multProcessorTest.spt # # parallel makeIsos{ # process{isosurface s1 molecular} # process{isosurface s2 molecular; color isosurface green} # } # load 1crn.pdb # t = now() # makeIsos # print now() - t # # parallel: 172ms, not parallel: 281ms MacBook Pro/Windows, two processors # # print "------------------------" # parallel showMOs(i,j) { # process{mo model 1.1 @i} # process{mo model 2.1 @j} # } # # load files "C6H6.smol" "C6H6.smol" # showMOs(22,23) # frame *; # # # # code: ShapeManager created; all shape[] references out of ModelSet # code: preliminary PARALLEL {.... PROCESS {....} ....} # code: Normix3D refactoring # bug fix: set measureAllModels not working properly # bug fix: isosurface renderer subtle improvement for almost-degenerate-vertex triangles # new feature: set monitorEnergy -- preliminary idea only # bug fix: UFF carbonyl out-of-plane calculation coding error does not minimize carbonyl groups correctly Modified Paths: -------------- trunk/Jmol/src/org/jmol/atomdata/AtomDataServer.java trunk/Jmol/src/org/jmol/geodesic/EnvelopeCalculation.java trunk/Jmol/src/org/jmol/jvxl/readers/IsoSolventReader.java trunk/Jmol/src/org/jmol/modelset/AtomIteratorWithinModel.java trunk/Jmol/src/org/jmol/modelset/ModelCollection.java trunk/Jmol/src/org/jmol/script/ScriptMathProcessor.java trunk/Jmol/src/org/jmol/shapespecial/Polyhedra.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties trunk/Jmol/src/org/jmol/viewer/Viewer.java Added Paths: ----------- trunk/Jmol/src/org/jmol/api/AtomIndexIterator.java Removed Paths: ------------- trunk/Jmol/src/org/jmol/modelset/AtomIndexIterator.java trunk/Jmol/src/org/jmol/modelset/AtomIteratorWithinSet.java Copied: trunk/Jmol/src/org/jmol/api/AtomIndexIterator.java (from rev 12875, trunk/Jmol/src/org/jmol/modelset/AtomIndexIterator.java) =================================================================== --- trunk/Jmol/src/org/jmol/api/AtomIndexIterator.java (rev 0) +++ trunk/Jmol/src/org/jmol/api/AtomIndexIterator.java 2010-04-17 20:51:43 UTC (rev 12878) @@ -0,0 +1,27 @@ +package org.jmol.api; + +import java.util.BitSet; + +import javax.vecmath.Point3f; + + +/** + * note: YOU MUST RELEASE THE ITERATOR + */ +public interface AtomIndexIterator { + /** + * @param modelIndex + * @param zeroBase an offset used in the AtomIteratorWithinSet only + * @param atomIndex + * @param center + * @param distance + * @param threadSafe don't use any cache in order to make this thread safe + */ + public void set(int modelIndex, int zeroBase, int atomIndex, Point3f center, float distance); + public void set(Point3f center, float distance); + public void addAtoms(BitSet bsResult); + public boolean hasNext(); + public int next(); + public float foundDistance2(); + public void release(); +} Modified: trunk/Jmol/src/org/jmol/atomdata/AtomDataServer.java =================================================================== --- trunk/Jmol/src/org/jmol/atomdata/AtomDataServer.java 2010-04-17 19:21:52 UTC (rev 12877) +++ trunk/Jmol/src/org/jmol/atomdata/AtomDataServer.java 2010-04-17 20:51:43 UTC (rev 12878) @@ -3,12 +3,12 @@ import java.io.BufferedInputStream; import java.util.BitSet; -import org.jmol.modelset.AtomIndexIterator; +import org.jmol.api.AtomIndexIterator; public interface AtomDataServer { - public AtomIndexIterator getWithinAtomSetIterator(BitSet bsSelected, + public AtomIndexIterator getSelectedAtomIterator(BitSet bsSelected, boolean isGreaterOnly, boolean modelZeroBased); Modified: trunk/Jmol/src/org/jmol/geodesic/EnvelopeCalculation.java =================================================================== --- trunk/Jmol/src/org/jmol/geodesic/EnvelopeCalculation.java 2010-04-17 19:21:52 UTC (rev 12877) +++ trunk/Jmol/src/org/jmol/geodesic/EnvelopeCalculation.java 2010-04-17 20:51:43 UTC (rev 12878) @@ -24,12 +24,12 @@ package org.jmol.geodesic; -import org.jmol.modelset.AtomIndexIterator; import org.jmol.util.ArrayUtil; import org.jmol.util.BitSetUtil; import org.jmol.util.FastBitSet; //import org.jmol.util.SlowBitSet; +import org.jmol.api.AtomIndexIterator; import org.jmol.atomdata.AtomData; import org.jmol.atomdata.AtomDataServer; import org.jmol.atomdata.RadiusData; @@ -265,7 +265,7 @@ this.maxRadius = maxRadius; // now, calculate surface for selected atoms boolean isAll = (bsSelected == null); - AtomIndexIterator iter = viewer.getWithinAtomSetIterator(bsMySelected, false, modelZeroBased); + AtomIndexIterator iter = viewer.getSelectedAtomIterator(bsMySelected, false, modelZeroBased); //true ==> only atom index > this atom accepted int i0 = (isAll ? atomCount - 1 : bsSelected.nextSetBit(0)); for (int i = i0; i >= 0; i = (isAll ? i - 1 : bsSelected.nextSetBit(i + 1))) @@ -274,6 +274,7 @@ getNeighbors(iter); calcConvexMap(isSurface); } + iter.release(); currentPoints = null; setDotsConvexMax(); } Modified: trunk/Jmol/src/org/jmol/jvxl/readers/IsoSolventReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/IsoSolventReader.java 2010-04-17 19:21:52 UTC (rev 12877) +++ trunk/Jmol/src/org/jmol/jvxl/readers/IsoSolventReader.java 2010-04-17 20:51:43 UTC (rev 12878) @@ -31,8 +31,8 @@ import org.jmol.util.Logger; +import org.jmol.api.AtomIndexIterator; import org.jmol.jvxl.data.MeshData; -import org.jmol.modelset.AtomIndexIterator; class IsoSolventReader extends AtomDataReader { @@ -296,7 +296,8 @@ float maxRadius = 0; float r0 = (isFirstPass && isCavity ? cavityRadius : 0); boolean isWithin = (isFirstPass && distance != Float.MAX_VALUE && point != null); - AtomIndexIterator iter = atomDataServer.getWithinAtomSetIterator(bsMySelected, true, true); + AtomIndexIterator iter = (doCalculateTroughs ? + atomDataServer.getSelectedAtomIterator(bsMySelected, true, true) : null); for (int iAtom = 0; iAtom < atomCount; iAtom++) { ptA = atomXyz[iAtom]; rA = atomRadius[iAtom]; Deleted: trunk/Jmol/src/org/jmol/modelset/AtomIndexIterator.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/AtomIndexIterator.java 2010-04-17 19:21:52 UTC (rev 12877) +++ trunk/Jmol/src/org/jmol/modelset/AtomIndexIterator.java 2010-04-17 20:51:43 UTC (rev 12878) @@ -1,27 +0,0 @@ -package org.jmol.modelset; - -import java.util.BitSet; - -import javax.vecmath.Point3f; - - -/** - * note: YOU MUST RELEASE THE ITERATOR - */ -public interface AtomIndexIterator { - /** - * @param modelIndex - * @param zeroBase an offset used in the AtomIteratorWithinSet only - * @param atomIndex - * @param center - * @param distance - * @param threadSafe don't use any cache in order to make this thread safe - */ - public void set(int modelIndex, int zeroBase, int atomIndex, Point3f center, float distance); - public void initialize(Point3f center, float distance); - public void addAtoms(BitSet bsResult); - public boolean hasNext(); - public int next(); - public float foundDistance2(); - public void release(); -} Modified: trunk/Jmol/src/org/jmol/modelset/AtomIteratorWithinModel.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/AtomIteratorWithinModel.java 2010-04-17 19:21:52 UTC (rev 12877) +++ trunk/Jmol/src/org/jmol/modelset/AtomIteratorWithinModel.java 2010-04-17 20:51:43 UTC (rev 12878) @@ -29,36 +29,42 @@ import javax.vecmath.Point3f; +import org.jmol.api.AtomIndexIterator; import org.jmol.bspt.Bspf; import org.jmol.bspt.CubeIterator; public class AtomIteratorWithinModel implements AtomIndexIterator { - protected CubeIterator bsptIter; - protected Bspf bspf; - protected boolean threadSafe; + private CubeIterator bsptIter; + private Bspf bspf; + private boolean threadSafe; private boolean isZeroBased; - protected int modelIndex = Integer.MAX_VALUE; - protected int atomIndex = -1; - protected int zeroBase; + private int modelIndex = Integer.MAX_VALUE; + private int atomIndex = -1; + private int zeroBase; private float distanceSquared; + private BitSet bsSelected; + private boolean isGreaterOnly; + /** - * just the basic iterator for finding atoms - * within a cube centered on some point in space * - * Used for select within(distance, atom) + * ############## ITERATOR SHOULD BE RELEASED ################# * * @param bspf + * @param bsSelected + * @param isGreaterOnly * @param isZeroBased * @param threadSafe * */ - void initialize(Bspf bspf, boolean isZeroBased, boolean threadSafe) { + void initialize(Bspf bspf, BitSet bsSelected, boolean isGreaterOnly, boolean isZeroBased, boolean threadSafe) { this.bspf = bspf; + this.bsSelected = bsSelected; + this.isGreaterOnly = isGreaterOnly; this.isZeroBased = isZeroBased; this.threadSafe = threadSafe; } @@ -71,24 +77,62 @@ this.modelIndex = modelIndex; } zeroBase = (isZeroBased ? firstModelAtom : 0); - initialize(center, distance); + if (distance < 0) // distance and center will be added later + return; + this.atomIndex = atomIndex; + set(center, distance); } - public void initialize(Point3f center, float distance) { + public void set(Point3f center, float distance) { + if (bsptIter == null) + return; bsptIter.initialize(center, distance); distanceSquared = distance * distance; } +/* + private int iNext; + public boolean hasNext() { + iNext = (bsptIter == null || !bsptIter.hasMoreElements() ? -1 + : ((Atom) bsptIter.nextElement()).index); + if (atomIndex >= 0) { + while (iNext >= 0) { + if (iNext != atomIndex && iNext > (isGreaterOnly ? atomIndex : -1) + && (bsSelected == null || bsSelected.get(iNext))) + return true; + if (!bsptIter.hasMoreElements()) { + iNext = -1; + break; + } + iNext = ((Atom) bsptIter.nextElement()).index; + } + } + return (iNext >= 0); + } +*/ + private int iNext; public boolean hasNext() { - return (bsptIter != null && bsptIter.hasMoreElements()); + if (atomIndex >= 0) + while (bsptIter.hasMoreElements()) { + if ((iNext = ((Atom) bsptIter.nextElement()).index) != atomIndex + && iNext > (isGreaterOnly ? atomIndex : -1) + && (bsSelected == null || bsSelected.get(iNext))) + return true; + } + else if (bsptIter.hasMoreElements()) { + iNext = ((Atom) bsptIter.nextElement()).index; + return true; + } + iNext = -1; + return false; } public int next() { - return ((Atom) bsptIter.nextElement()).index - zeroBase; + return iNext - zeroBase; } - + public float foundDistance2() { - return bsptIter.foundDistance2(); + return (bsptIter == null ? -1 : bsptIter.foundDistance2()); } public void addAtoms(BitSet bsResult) { @@ -100,8 +144,10 @@ } public void release() { - bsptIter.release(); - bsptIter = null; + if (bsptIter != null) { + bsptIter.release(); + bsptIter = null; + } } } Deleted: trunk/Jmol/src/org/jmol/modelset/AtomIteratorWithinSet.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/AtomIteratorWithinSet.java 2010-04-17 19:21:52 UTC (rev 12877) +++ trunk/Jmol/src/org/jmol/modelset/AtomIteratorWithinSet.java 2010-04-17 20:51:43 UTC (rev 12878) @@ -1,81 +0,0 @@ -/* $RCSfile$ - * $Author: hansonr $ - * $Date: 2007-05-18 08:19:45 -0500 (Fri, 18 May 2007) $ - * $Revision: 7742 $ - - * - * Copyright (C) 2003-2005 The Jmol Development Team - * - * Contact: jmo...@li... - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jmol.modelset; - -import org.jmol.bspt.Bspf; - -import java.util.BitSet; - -public class AtomIteratorWithinSet extends AtomIteratorWithinModel implements AtomIndexIterator { - - /* - * a more powerful iterator than AtomIteratorWithinModel - * allowing excluding a specific atom, finding only those - * atoms with an atom index greater than that specified - * or atoms within a specific selected subset of atoms. - * - * Returns atoms within a cube centered on the point - * Does NOT return i == atomIndex - * - */ - - private BitSet bsSelected; - private boolean isGreaterOnly; - - /** - * - * @param bspf - * @param bsSelected - * @param isGreaterOnly - * @param isZeroBased - * @param threadSafe - */ - public void initialize(Bspf bspf, boolean isZeroBased, boolean threadSafe, - BitSet bsSelected, boolean isGreaterOnly) { - super.initialize(bspf, isZeroBased, threadSafe); - this.bsSelected = bsSelected; - this.isGreaterOnly = isGreaterOnly; - } - - private int iNext; - public boolean hasNext() { - if (atomIndex >= 0) - while (bsptIter.hasMoreElements()) { - Atom atom = (Atom) bsptIter.nextElement(); - if ((iNext = atom.index) != atomIndex - && iNext > (isGreaterOnly ? atomIndex : -1) - && (bsSelected == null || bsSelected.get(iNext))) - return true; - } - iNext = -1; - return false; - } - - public int next() { - return iNext - zeroBase; - } -} - Modified: trunk/Jmol/src/org/jmol/modelset/ModelCollection.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/ModelCollection.java 2010-04-17 19:21:52 UTC (rev 12877) +++ trunk/Jmol/src/org/jmol/modelset/ModelCollection.java 2010-04-17 20:51:43 UTC (rev 12878) @@ -38,6 +38,7 @@ import javax.vecmath.Tuple3f; import javax.vecmath.Vector3f; +import org.jmol.api.AtomIndexIterator; import org.jmol.api.Interface; import org.jmol.api.JmolAdapter; import org.jmol.api.JmolBioResolver; @@ -1919,7 +1920,7 @@ iterator.set(modelIndex, models[modelIndex].firstAtomIndex, atomIndex, atoms[atomIndex], distance); } - public AtomIndexIterator getWithinAtomSetIterator(BitSet bsSelected, + public AtomIndexIterator getSelectedAtomIterator(BitSet bsSelected, boolean isGreaterOnly, boolean modelZeroBased) { //EnvelopeCalculation, IsoSolventReader @@ -1929,19 +1930,11 @@ // not the full atom set. initializeBspf(); - AtomIteratorWithinSet iter = new AtomIteratorWithinSet(); - iter.initialize(bspf, modelZeroBased, viewer.isMultiProcessor(), bsSelected, isGreaterOnly); - return iter; - } - - public AtomIndexIterator getWithinModelIterator() { - //polyhedra, within(distance, atom), within(distance, point) - initializeBspf(); AtomIteratorWithinModel iter = new AtomIteratorWithinModel(); - iter.initialize(bspf, false, viewer.isMultiProcessor()); + iter.initialize(bspf, bsSelected, isGreaterOnly, modelZeroBased, viewer.isMultiProcessor()); return iter; } - + ////////// bonds ///////// public int getBondCountInModel(int modelIndex) { @@ -2081,7 +2074,7 @@ case Token.molecule: return getMoleculeBitSet((BitSet) specInfo); case Token.sequence: - return getSequenceBits((String)specInfo); + return getSequenceBits((String)specInfo, null); case Token.spec_seqcode_range: info = (int[]) specInfo; int seqcodeA = info[0]; @@ -2154,7 +2147,7 @@ boolean withinAllModels) { BitSet bsResult = new BitSet(); BitSet bsCheck = getIterativeModels(false); - AtomIndexIterator iter = getWithinModelIterator(); + AtomIndexIterator iter = getSelectedAtomIterator(null, false, false); if (withinAllModels) { for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1)) for (int iModel = modelCount; --iModel >= 0;) { @@ -2170,6 +2163,7 @@ iter.addAtoms(bsResult); } } else { + bsResult.or(bs); for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1)) { if (distance < 0) { getAtomsWithin(-distance, atoms[i], bsResult, atoms[i].modelIndex); @@ -2180,6 +2174,7 @@ iter.addAtoms(bsResult); } } + iter.release(); return bsResult; } @@ -2218,14 +2213,15 @@ } BitSet bsCheck = getIterativeModels(false); + AtomIndexIterator iter = getSelectedAtomIterator(null, false, false); for (int iModel = modelCount; --iModel >= 0;) { if (!bsCheck.get(iModel)) continue; - AtomIndexIterator iter = getWithinModelIterator(); - setIteratorForAtom(iter, models[iModel].firstAtomIndex, 0); - iter.initialize(coord, distance); + setIteratorForAtom(iter, models[iModel].firstAtomIndex, -1); + iter.set(coord, distance); iter.addAtoms(bsResult); } + iter.release(); return bsResult; } @@ -2262,10 +2258,10 @@ calcRasmolHydrogenBonds(bsA, bsB, vHBonds, true, 1); } else { for (int i = 0; i < specInfo.length();) { - bsA = getSequenceBits(specInfo.substring(i, ++i)); + bsA = getSequenceBits(specInfo.substring(i, ++i), null); if (bsA.cardinality() == 0) continue; - bsB = getSequenceBits(specInfo.substring(i, ++i)); + bsB = getSequenceBits(specInfo.substring(i, ++i), null); if (bsB.cardinality() == 0) continue; calcRasmolHydrogenBonds(bsA, bsB, vHBonds, true, 1); @@ -2280,8 +2276,9 @@ return super.getAtomBits(Token.group, bsAtoms); } - public BitSet getSequenceBits(String specInfo) { - BitSet bs = getModelAtomBitSet(-1, false); + public BitSet getSequenceBits(String specInfo, BitSet bs) { + if (bs == null) + bs = getModelAtomBitSet(-1, false); int lenInfo = specInfo.length(); BitSet bsResult = new BitSet(); if (lenInfo == 0) @@ -2596,7 +2593,7 @@ Logger.startTimer(); Point3f C = null; Point3f D = null; - AtomIndexIterator iter = getWithinAtomSetIterator(bsB, false, false); + AtomIndexIterator iter = getSelectedAtomIterator(bsB, false, false); for (int i = bsA.nextSetBit(0); i >= 0; i = bsA.nextSetBit(i + 1)) { Atom atom = atoms[i]; @@ -2670,6 +2667,7 @@ nNew++; } } + iter.release(); shapeManager.setShapeSize(JmolConstants.SHAPE_STICKS, Integer.MIN_VALUE, null, bsHBondsRasmol); if (showRebondTimes && Logger.debugging) Modified: trunk/Jmol/src/org/jmol/script/ScriptMathProcessor.java =================================================================== --- trunk/Jmol/src/org/jmol/script/ScriptMathProcessor.java 2010-04-17 19:21:52 UTC (rev 12877) +++ trunk/Jmol/src/org/jmol/script/ScriptMathProcessor.java 2010-04-17 20:51:43 UTC (rev 12878) @@ -1919,8 +1919,8 @@ } if (withinSpec instanceof String) { if (tok == Token.nada) { - tok = Token.sequence; - if (i != 1) + tok = Token.spec_seqcode; + if (i > 2) return false; i = 2; } @@ -1957,11 +1957,16 @@ return addX(isSyntaxCheck ? bs : viewer.getAtomBits(tok, null)); case Token.basepair: return addX(isSyntaxCheck ? bs : viewer.getAtomBits(tok, "")); + case Token.spec_seqcode: + return addX(isSyntaxCheck ? bs : viewer.getAtomBits(Token.sequence, withinStr)); } return false; case 2: // within (atomName, "XX,YY,ZZZ") switch (tok) { + case Token.spec_seqcode: + tok = Token.sequence; + break; case Token.atomname: case Token.atomtype: case Token.basepair: @@ -1979,6 +1984,10 @@ case Token.hkl: case Token.coord: break; + case Token.sequence: + // within ("sequence", "CII", *.ca) + withinStr = ScriptVariable.sValue(args[2]); + break; default: return false; } @@ -2007,6 +2016,9 @@ if (pt != null) return addX(viewer.getAtomsWithin(distance, pt)); bs = ScriptVariable.bsSelect(args[i]); + if (tok == Token.sequence) { + return addX(viewer.getSequenceBits(withinStr, bs)); + } if (!isDistance) return addX(viewer.getAtomBits(tok, bs)); if (isWithinGroup) Modified: trunk/Jmol/src/org/jmol/shapespecial/Polyhedra.java =================================================================== --- trunk/Jmol/src/org/jmol/shapespecial/Polyhedra.java 2010-04-17 19:21:52 UTC (rev 12877) +++ trunk/Jmol/src/org/jmol/shapespecial/Polyhedra.java 2010-04-17 20:51:43 UTC (rev 12878) @@ -24,9 +24,9 @@ package org.jmol.shapespecial; +import org.jmol.api.AtomIndexIterator; import org.jmol.g3d.Graphics3D; import org.jmol.modelset.Atom; -import org.jmol.modelset.AtomIndexIterator; import org.jmol.modelset.Bond; import org.jmol.shape.AtomShape; import org.jmol.util.Escape; @@ -245,7 +245,7 @@ private void buildPolyhedra() { boolean useBondAlgorithm = radius == 0 || bondedOnly; - AtomIndexIterator iter = viewer.getWithinModelIterator(); + AtomIndexIterator iter = modelSet.getSelectedAtomIterator(null, false, false); for (int i = centers.nextSetBit(0); i >= 0; i = centers.nextSetBit(i + 1)) { Polyhedron p = (haveBitSetVertices ? constructBitSetPolyhedron(i) : useBondAlgorithm ? constructBondsPolyhedron(i) @@ -256,7 +256,7 @@ polyhedrons[polyhedronCount++] = p; } if (haveBitSetVertices) - return; + break; } iter.release(); } @@ -298,8 +298,7 @@ viewer.setIteratorForAtom(iter, atomIndex, radius); while (iter.hasNext()) { Atom other = atoms[iter.next()]; - if (other == atom - || bsVertices != null && !bsVertices.get(other.getIndex()) + if (bsVertices != null && !bsVertices.get(other.getIndex()) || atom.distance(other) > radius) continue; if (other.getAlternateLocationID() != atom.getAlternateLocationID() Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2010-04-17 19:21:52 UTC (rev 12877) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2010-04-17 20:51:43 UTC (rev 12878) @@ -1,30 +1,28 @@ # Developers: to add a description of changes you have made, # add it on a line starting with # below the "version=..." line -version=12.0.RC6_dev +version=12.0.RC6 # new feature: MO MODEL x.y .... specifies which model to use # -# code: atom iterators made thread safe and optimized +# code: atom iterators made thread safe and optimized a bit # -# NOTE --> isosurface molecular generation speed up by -# A FACTOR OF 10 -- or 20 with parallel (no kidding!) -# # code: parallel processor in place; working; # tested on dual core multiple processor Mac +# result -- 8 sec --> 4 sec for the two molecular surfaces # -# example PARALLEL code: see http://chemapps.stolaf.edu/jmol/docs/examples-11/data/multProcessorTest.spt +# example PARALLEL code: see http://chemapps.stolaf.edu/jmol/docs/examples-11/data/multiProcessTest.spt # # parallel makeIsos{ # process{isosurface s1 molecular} -# process{isosurface s2 sasurface; color isosurface green} +# process{isosurface s2 molecular; color isosurface green} # } # load 1crn.pdb # t = now() # makeIsos # print now() - t # -# parallel: 172ms, not parallel: 281ms MacBook Pro/Windows, two processors +# parallel: 4 s, not parallel: 8 s MacBook Pro/Windows, two processors # # print "------------------------" # parallel showMOs(i,j) { Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2010-04-17 19:21:52 UTC (rev 12877) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2010-04-17 20:51:43 UTC (rev 12878) @@ -34,7 +34,6 @@ import org.jmol.i18n.GT; import org.jmol.modelset.Atom; import org.jmol.modelset.AtomCollection; -import org.jmol.modelset.AtomIndexIterator; import org.jmol.modelset.Bond; import org.jmol.modelset.BoxInfo; import org.jmol.modelset.Group; @@ -2230,14 +2229,10 @@ modelSet.calculateStructures(bsAtoms); } - public AtomIndexIterator getWithinModelIterator() { - return modelSet.getWithinModelIterator(); - } - - public AtomIndexIterator getWithinAtomSetIterator(BitSet bsSelected, + public AtomIndexIterator getSelectedAtomIterator(BitSet bsSelected, boolean isGreaterOnly, boolean modelZeroBased) { - return modelSet.getWithinAtomSetIterator(bsSelected, isGreaterOnly, modelZeroBased); + return modelSet.getSelectedAtomIterator(bsSelected, isGreaterOnly, modelZeroBased); } public void setIteratorForAtom(AtomIndexIterator iterator, int atomIndex, @@ -2724,6 +2719,10 @@ return modelSet.getAtomBits(tokType, specInfo); } + public BitSet getSequenceBits(String specInfo, BitSet bs) { + return modelSet.getSequenceBits(specInfo, bs); + } + public BitSet getAtomsWithin(float distance, Point3f coord) { BitSet bs = new BitSet(); modelSet.getAtomsWithin(distance, coord, bs, -1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |