From: <ni...@us...> - 2007-01-09 20:34:49
|
Revision: 6613 http://svn.sourceforge.net/jmol/?rev=6613&view=rev Author: nicove Date: 2007-01-09 12:34:46 -0800 (Tue, 09 Jan 2007) Log Message: ----------- Fix for "stereo" Modified Paths: -------------- branches/v11_0/Jmol/src/org/jmol/viewer/Eval.java Modified: branches/v11_0/Jmol/src/org/jmol/viewer/Eval.java =================================================================== --- branches/v11_0/Jmol/src/org/jmol/viewer/Eval.java 2007-01-09 20:27:54 UTC (rev 6612) +++ branches/v11_0/Jmol/src/org/jmol/viewer/Eval.java 2007-01-09 20:34:46 UTC (rev 6613) @@ -2148,19 +2148,25 @@ void stereo() throws ScriptException { int stereoMode = JmolConstants.STEREO_DOUBLE; // see www.usm.maine.edu/~rhodes/0Help/StereoViewing.html + // stereo on/off + // stereo color1 color2 6 + // stereo redgreen 5 + float degrees = -5; boolean degreesSeen = false; int[] colors = new int[2]; int colorpt = 0; + String state = ""; for (int i = 1; i < statementLength; ++i) { - switch (statement[i].tok) { + switch (getToken(i).tok) { case Token.on: checkLength2(); - stereoMode = JmolConstants.STEREO_DOUBLE; + state = " on"; break; case Token.off: checkLength2(); stereoMode = JmolConstants.STEREO_NONE; + state = " off"; break; case Token.colorRGB: if (colorpt > 1) @@ -2170,14 +2176,17 @@ colors[colorpt++] = getArgbParam(i); if (colorpt == 1) colors[colorpt] = ~colors[0]; + state += " " + StateManager.escapeColor(colors[colorpt - 1]); break; case Token.integer: case Token.decimal: degrees = floatParameter(i); degreesSeen = true; + state += " " + degrees; break; case Token.identifier: - String id = (String) statement[i].value; + String id = parameterAsString(i); + state += " " + id; if (!degreesSeen) degrees = 3; if (id.equalsIgnoreCase("redblue")) { @@ -2201,10 +2210,9 @@ if (isSyntaxCheck) return; if (colorpt > 0) { - viewer.setStereoMode(colors, StateManager.escapeColor(colors[0]) + " " - + StateManager.escapeColor(colors[1])); + viewer.setStereoMode(colors, state); } else { - viewer.setStereoMode(stereoMode, (String) statement[1].value); + viewer.setStereoMode(stereoMode, state); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |