Revision: 5188
Author:   hansonr
Date:     2006-05-28 08:37:06 -0700 (Sun, 28 May 2006)
ViewCVS:  http://svn.sourceforge.net/jmol/?rev=5188&view=rev

Log Message:
-----------
bob200603 "show isosurface", also removing necessity for "set" 
with unitcell, boundbox, axes, and frank, so it is just

frank on
frank off

like other displayable objects

Modified Paths:
--------------
    branches/bob200603/Jmol/src/org/jmol/viewer/Eval.java
    branches/bob200603/Jmol/src/org/jmol/viewer/Isosurface.java
    branches/bob200603/Jmol/src/org/jmol/viewer/JmolConstants.java
    branches/bob200603/Jmol/src/org/jmol/viewer/Token.java
Modified: branches/bob200603/Jmol/src/org/jmol/viewer/Eval.java
===================================================================
--- branches/bob200603/Jmol/src/org/jmol/viewer/Eval.java       2006-05-28 
15:30:21 UTC (rev 5187)
+++ branches/bob200603/Jmol/src/org/jmol/viewer/Eval.java       2006-05-28 
15:37:06 UTC (rev 5188)
@@ -557,7 +557,18 @@
       case Token.conformation:
         conformation();
         break;
-
+      case Token.axes:
+        setAxes(1);
+        break;
+      case Token.boundbox:
+        setBoundbox(1);
+        break;
+      case Token.unitcell:
+        setUnitcell(1);
+        break;
+      case Token.frank:
+        setFrank(1);
+        break;
       // not implemented
       case Token.structure:
       case Token.bond:
@@ -927,9 +938,13 @@
     return false;
   }
 
-  short getSetAxesTypeMad() throws ScriptException {
-    checkLength3();
-    int tok = statement[2].tok;
+  short getSetAxesTypeMad(int cmdPt) throws ScriptException {
+    if (cmdPt == 2)
+      checkLength3();
+    if (cmdPt == 1)
+      checkLength2();
+    
+    int tok = statement[cmdPt].tok;
     short mad = 0;
     switch (tok) {
     case Token.on:
@@ -937,13 +952,13 @@
     case Token.off:
       break;
     case Token.integer:
-      int diameterPixels = statement[2].intValue;
+      int diameterPixels = statement[cmdPt].intValue;
       if (diameterPixels < 0 || diameterPixels >= 20)
         numberOutOfRange(0, 19);
       mad = (short) diameterPixels;
       break;
     case Token.decimal:
-      float angstroms = floatParameter(2);
+      float angstroms = floatParameter(cmdPt);
       if (angstroms < 0 || angstroms >= 2)
         numberOutOfRange(0f, 1.99999f);
       mad = (short) (angstroms * 1000 * 2);
@@ -2891,7 +2906,7 @@
   void set() throws ScriptException {
     switch (statement[1].tok) {
     case Token.axes:
-      setAxes();
+      setAxes(2);
       break;
     case Token.bondmode:
       setBondmode();
@@ -2900,7 +2915,7 @@
       setBonds();
       break;
     case Token.boundbox:
-      setBoundbox();
+      setBoundbox(2);
       break;
     case Token.color:
       System.out.println("WARNING! use 'set defaultColors' not 'set color'");
@@ -2921,7 +2936,7 @@
       setFontsize();
       break;
     case Token.frank:
-      setFrank();
+      setFrank(2);
       break;
     case Token.hetero:
       setHetero();
@@ -2933,7 +2948,7 @@
       setLabelOffset();
       break;
     case Token.monitor:
-      setMonitor();
+      setMonitor(2);
       break;
     case Token.property:
       setProperty();
@@ -2972,7 +2987,7 @@
       setScale3d();
       break;
     case Token.unitcell:
-      setUnitcell();
+      setUnitcell(2);
       break;
     case Token.picking:
       setPicking();
@@ -3035,20 +3050,20 @@
     }
   }
 
-  void setAxes() throws ScriptException {
-    viewer.setShapeSize(JmolConstants.SHAPE_AXES, getSetAxesTypeMad());
+  void setAxes(int cmdPt) throws ScriptException {
+    viewer.setShapeSize(JmolConstants.SHAPE_AXES, getSetAxesTypeMad(cmdPt));
   }
 
-  void setBoundbox() throws ScriptException {
-    viewer.setShapeSize(JmolConstants.SHAPE_BBCAGE, getSetAxesTypeMad());
+  void setBoundbox(int cmdPt) throws ScriptException {
+    viewer.setShapeSize(JmolConstants.SHAPE_BBCAGE, getSetAxesTypeMad(cmdPt));
   }
 
-  void setUnitcell() throws ScriptException {
-    viewer.setShapeSize(JmolConstants.SHAPE_UCCAGE, getSetAxesTypeMad());
+  void setUnitcell(int cmdPt) throws ScriptException {
+    viewer.setShapeSize(JmolConstants.SHAPE_UCCAGE, getSetAxesTypeMad(cmdPt));
   }
 
-  void setFrank() throws ScriptException {
-    viewer.setShapeSize(JmolConstants.SHAPE_FRANK, getSetAxesTypeMad());
+  void setFrank(int cmdPt) throws ScriptException {
+    viewer.setShapeSize(JmolConstants.SHAPE_FRANK, getSetAxesTypeMad(cmdPt));
   }
 
   void setDefaultColors() throws ScriptException {
@@ -3161,10 +3176,12 @@
     viewer.setRasmolHydrogenSetting(getSetBoolean());
   }
 
-  void setMonitor() throws ScriptException {
+  void setMonitor(int cmdPt) throws ScriptException {
+    //on off here incompatible with "monitor on/off" so this is just a SET 
option.
+    //cmdPt will be 2 here.
     boolean showMeasurementNumbers = false;
     checkLength3();
-    switch (statement[2].tok) {
+    switch (statement[cmdPt].tok) {
     case Token.on:
       showMeasurementNumbers = true;
     case Token.off:
@@ -3173,11 +3190,11 @@
               : Boolean.FALSE);
       return;
     case Token.identifier:
-      if (!viewer.setMeasureDistanceUnits((String) statement[2].value))
+      if (!viewer.setMeasureDistanceUnits((String) statement[cmdPt].value))
         unrecognizedSetParameter();
       return;
     }
-    viewer.setShapeSize(JmolConstants.SHAPE_MEASURES, getSetAxesTypeMad());
+    viewer.setShapeSize(JmolConstants.SHAPE_MEASURES, 
getSetAxesTypeMad(cmdPt));
   }
 
   void setDebugScript() throws ScriptException {
@@ -3458,6 +3475,9 @@
     case Token.symmetry:
       showSymmetry();
       break;
+    case Token.isosurface:
+      showIsosurface();
+      break;
     // not implemented
     case Token.spin:
     case Token.list:
@@ -3484,7 +3504,7 @@
 
   void showString(String str) {
     System.out.println("show:" + str);
-    viewer.scriptStatus(str);
+    viewer.scriptStatus("" + str);
   }
 
   void showPdbHeader() {
@@ -3503,6 +3523,11 @@
     showString(viewer.getSymmetryInfoAsString());
   }
 
+  void showIsosurface() {
+    showString((String) viewer.getShapeProperty(JmolConstants.SHAPE_ISOSURFACE,
+        "jvxlFileData"));
+  }
+
   void showFile() throws ScriptException {
     System.out.println("showFile && statementLength=" + statementLength);
     if (statementLength == 2) {

Modified: branches/bob200603/Jmol/src/org/jmol/viewer/Isosurface.java
===================================================================
--- branches/bob200603/Jmol/src/org/jmol/viewer/Isosurface.java 2006-05-28 
15:30:21 UTC (rev 5187)
+++ branches/bob200603/Jmol/src/org/jmol/viewer/Isosurface.java 2006-05-28 
15:37:06 UTC (rev 5188)
@@ -219,6 +219,7 @@
       if (!rangeDefined) {
         minRange = getMinMappedValue();
         maxRange = getMaxMappedValue();
+        
       }
       applyColorScale(minRange, maxRange, "roygb");
       discardTempData();
@@ -237,6 +238,14 @@
     super.setProperty(propertyName, value, bs);
   }
 
+  Object getProperty(String property, int index) {
+    if (currentMesh == null)
+      return "no current isosurface";
+    if (property == "jvxlFileData")
+      return getJvxlFile(currentMesh, "");
+    return super.getProperty(property, index);
+  }
+
   boolean isJvxl;
   int[][] edgeInfo;
   int edgeCount;

Modified: branches/bob200603/Jmol/src/org/jmol/viewer/JmolConstants.java
===================================================================
--- branches/bob200603/Jmol/src/org/jmol/viewer/JmolConstants.java      
2006-05-28 15:30:21 UTC (rev 5187)
+++ branches/bob200603/Jmol/src/org/jmol/viewer/JmolConstants.java      
2006-05-28 15:37:06 UTC (rev 5188)
@@ -31,9 +31,6 @@
   // this atom flag simply associates an atom with the current model
   // but doesn't necessarily mean it is visible
 
-  // and must be reset with setModelVisibility() prior to rendering
-  
-
   // these atom flags get tainted with scripts and frame changes
   // and must be reset with setModelVisibility() prior to rendering
  
@@ -42,7 +39,7 @@
   // for now, just update this by hand
   // perhaps use ant filter later ... but mth doesn't like it :-(
   public final static String copyright = "(C) 2006 Jmol Development";
-  public final static String version = "10.x.07(branch bob200603)";
+  public final static String version = "10.x.08(branch bob200603)";
   public final static String cvsDate = "$Date$";
   public final static String date = cvsDate.substring(7, 23);
 

Modified: branches/bob200603/Jmol/src/org/jmol/viewer/Token.java
===================================================================
--- branches/bob200603/Jmol/src/org/jmol/viewer/Token.java      2006-05-28 
15:30:21 UTC (rev 5187)
+++ branches/bob200603/Jmol/src/org/jmol/viewer/Token.java      2006-05-28 
15:37:06 UTC (rev 5188)
@@ -181,7 +181,7 @@
   final static int pmesh        = command | 91;
   final static int polyhedra    = command | 92 | embeddedExpression;
   final static int centerAt     = command | 93;
-  final static int isosurface   = command | 94;
+  final static int isosurface   = command | 94 | negnums | showparam;
   final static int draw         = command | 95 | embeddedExpression;
   final static int getproperty  = command | 96;
   final static int dipole       = command | 97 | embeddedExpression;
@@ -190,12 +190,12 @@
 
   // parameters
   final static int ambient      = setparam |  0;
-  final static int axes         = setparam |  1;
+  final static int axes         = setparam |  1 | command;
   // background
   final static int backfade     = setparam |  2;
   final static int bondmode     = setparam |  3;
   final static int bonds        = setparam |  4;
-  final static int boundbox     = setparam |  5 | showparam;
+  final static int boundbox     = setparam |  5 | showparam | command;
   // cartoon
   final static int cisangle     = setparam |  6;
   final static int display      = setparam |  7;
@@ -220,7 +220,7 @@
   // stereo
   // strands
   final static int transparent  = setparam | 19;
-  final static int unitcell     = setparam | 20;
+  final static int unitcell     = command | setparam | 20;
   final static int vectps       = setparam | 21;
   // write
 
@@ -237,7 +237,7 @@
   final static int property     = setparam | 29;
   final static int diffuse      = setparam | 30;
   final static int labeloffset  = setparam | 31;
-  final static int frank        = setparam | 32;
+  final static int frank        = setparam | 32 | command;
   final static int formalCharge = setparam | 33;
   final static int partialCharge= setparam | 34;
   final static int pickingStyle = setparam | 35;
@@ -545,11 +545,11 @@
 
     // setparams
     "ambient",      new Token(ambient,         "ambient"),
-    "axes",         new Token(axes,            "axes"),
+    "axes",         new Token(axes, onDefault1,    "axes"),
     "backfade",     new Token(backfade,        "backfade"),
     "bondmode",     new Token(bondmode,        "bondmode"),
     "bonds",        new Token(bonds,           "bonds"),
-    "boundbox",     new Token(boundbox,        "boundbox"),
+    "boundbox",     new Token(boundbox, onDefault1, "boundbox"),
     "cisangle",     new Token(cisangle,        "cisangle"),
     "display",      new Token(display,         "display"),
     "fontsize",     new Token(fontsize,        "fontsize"),
@@ -569,7 +569,7 @@
     "specular",     new Token(specular,        "specular"),
     "specpower",    new Token(specpower,       "specpower"),
     "transparent",  new Token(transparent,     "transparent"),
-    "unitcell",     new Token(unitcell,        "unitcell"),
+    "unitcell",     new Token(unitcell, onDefault1, "unitcell"),
     "vectps",       new Token(vectps,          "vectps"),
     // chime setparams
     "clear",        new Token(clear,           "clear"),
@@ -585,7 +585,7 @@
     "property",     new Token(property,        "property"),
     "diffuse",      new Token(diffuse,         "diffuse"),
     "labeloffset",  new Token(labeloffset,     "labeloffset"),
-    "frank",        new Token(frank,           "frank"),
+    "frank",        new Token(frank, onDefault1, "frank"),
     // must be lower case - see comment above
     "formalcharge", new Token(formalCharge,    "formalcharge"),
     "charge",       null,


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



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Jmol-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to