Revision: 18248
          http://sourceforge.net/p/jmol/code/18248
Author:   hansonr
Date:     2013-05-24 02:59:39 +0000 (Fri, 24 May 2013)
Log Message:
-----------


Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/adapter/readers/pymol/PyMOLReader.java

Modified: trunk/Jmol/src/org/jmol/adapter/readers/pymol/PyMOLReader.java
===================================================================
--- trunk/Jmol/src/org/jmol/adapter/readers/pymol/PyMOLReader.java      
2013-05-24 02:50:58 UTC (rev 18247)
+++ trunk/Jmol/src/org/jmol/adapter/readers/pymol/PyMOLReader.java      
2013-05-24 02:59:39 UTC (rev 18248)
@@ -1563,6 +1563,9 @@
 
   /**
    * PyMOL does not display cartoons or traces for single-residue runs.
+   * This two-pass routine first sets bits in a residue bitset, 
+   * then it clears out all singletons, and in a second pass
+   * all atom bits for not-represented residues are cleared.
    * 
    * @param atoms
    * @param bs
@@ -1572,12 +1575,11 @@
     int n = bs.length();
     int pass = 0;
     while (true) {
-      int offset = 1;
-      int iPrev = Integer.MIN_VALUE;
-      int iSeqLast = Integer.MIN_VALUE;
-      int iSeq = Integer.MIN_VALUE;
-      for (int i = 0; i < n; i++) {
-        if (nextChain(atoms, i, iPrev))
+      for (int i = 0, offset = 0, 
+          iPrev = Integer.MIN_VALUE, 
+          iSeqLast = Integer.MIN_VALUE, 
+          iSeq = Integer.MIN_VALUE; i < n; i++) {
+        if (iPrev < 0 || atoms[iPrev].chainID != atoms[i].chainID)
           offset++;
         iSeq = atoms[i].sequenceNumber;
         if (iSeq != iSeqLast) {
@@ -1601,14 +1603,6 @@
     }
   }
 
-  private static boolean nextChain(Atom[] atoms, int i, int iPrev) {
-    if (i == 0 || iPrev < 0)
-      return true;
-    Atom a = atoms[iPrev];
-    Atom b = atoms[i];
-    return a.chainID != b.chainID;
-  }
-
   /**
    * Create JmolObjects for each shape.
    * 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to