#!/bin/sh

# Collect -D & -m options as java arguments
command=java
while [ `echo $1 | egrep '^-D|^-m' | wc -l` != 0 ]; do
	command="$command $1"
	shift
done

if [ -f ./Jmol.jar ] ; then
  jarpath=./Jmol.jar
elif [ -f $JMOL_HOME/Jmol.jar ] ; then
  jarpath=$JMOL_HOME/Jmol.jar
elif [ -f /usr/share/jmol/Jmol.jar ] ; then
  jarpath=/usr/share/jmol/Jmol.jar
else
  echo Jmol.jar not found
  exit
fi
$command -Xmx512m -jar $jarpath $@
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                le on;show spacegroup
showState | Current state = console on;show state
loadPdb | File from PDB = load ?PdbId?
loadFileOrURL | File or URL = load ?
loadFileUnitCell | Load full unit cell = load ? {1 1 1}
loadScript | Script = script ?.spt
writeFileTextVARIABLE | File {0} = write file "?FILE?"
writeState | Script with state = write state "?FILEROOT?.spt"
writeHistory | Script with history = write history "?FILEROOT?.his"
writeIsosurface | JVXL Isosurface = write isosurface "?FILEROOT?.jvxl"
writeJpg | JPG Image = write image "?FILEROOT?.jpg"
writePng | PNG Image = write image "?FILEROOT?.png"
writePovray | POV-Ray Image = write POVRAY ?FILEROOT?.pov
writeVrml | VRML 3D Model = write VRML ?FILEROOT?.vrml
writeMaya | Maya 3D Model = write MAYA ?FILEROOT?.maya
SYMMETRYshowSymmetry | Symmetry = console on;show symmetry
UNITCELLshow | Unit cell = console on;show unitcell
extractMOL | Extract MOL data = console on;getproperty extractModel "visible" 
surfDots | Dot Surface = dots on
surfVDW | van der Waals Surface = isosurface delete resolution 0 solvent 0 translucent
surfMolecular | Molecular Surface = isosurface delete resolution 0 molecular translucent
surfSolvent14 | Solvent Surface (1.4-Angstrom probe) = isosurface delete resolution 0 solvent 1.4 translucent
surfSolventAccessible14 | Solvent-Accessible Surface (VDW + 1.4 Angstrom) = isosurface delete resolution 0 sasurface 1.4 translucent
CHARGEsurfMEP | Molecular Electrostatic Potential = isosurface delete resolution 0 molecular map MEP translucent
surfOpaque | Make Opaque = mo opaque;isosurface opaque
surfTranslucent | Make Translucent = mo translucent;isosurface translucent
surfOff | Off = mo delete;isosurface delete;select *;dots off
UNITCELLone | Reload {1 1 1} = save orientation;load "" {1 1 1} ;restore orientation;center
UNITCELLnine | Reload {444 666 1} = save orientation;load "" {444 666 1} ;restore orientation;center
UNITCELLnineRestricted | Reload {444 666 1};display 555 = save orientation;load "" {444 666 1} ;restore orientation; unitcell on; display cell=555;center visible;zoom 200
UNITCELLninePoly | Reload + Polyhedra = save orientation;load "" {444 666 1} ;restore orientation; unitcell on; display cell=555; polyhedra 4,6 (displayed);center (visible);zoom 200
1p | 1 px = on
3p | 3 px = 3
5p | 5 px = 5
10p | 10 px = 10
10a | 0.10 Å = 0.1
20a | 0.20 Å = 0.20
25a | 0.25 Å = 0.25
50a | 0.50 Å = 0.50
100a | 1.0 Å = 1.0
APPLETjmolUrl | http://www.jmol.org = show url "http://www.jmol.org"
APPLETmouseManualUrl | Mouse Manual = show url "http://wiki.jmol.org/index.php/Mouse_Manual"
APPLETtranslationUrl | Translations = show url "http://wiki.jmol.org/index.php/Internationalisation"


# Part III -- Word Translations
# -----------------------------

modelSetMenu | No atoms loaded
configurationComputedMenu | Configurations
elementsComputedMenu | Element
FRAMESbyModelComputedMenu | Model/Frame
languageComputedMenu | Language
PDBaaResiduesComputedMenu | By Residue Name
PDBnucleicResiduesComputedMenu | By Residue Name
PDBcarboResiduesComputedMenu | By Residue Name
PDBheteroComputedMenu | By HETATM
surfMoComputedMenu | Molecular Orbitals
SYMMETRYComputedMenu | Symmetry
hiddenModelSetText | Model information
allModelsText | All {0} models
configurationMenuText | Configurations ({0})
modelSetCollectionText | Collection of {0} models
atomsText | atoms: {0}
bondsText | bonds: {0}
groupsText | groups: {0}
chainsText | chains: {0}
polymersText | polymers: {0}
modelMenuText | model {0}
viewMenuText | View {0}
mainMenuText | Main Menu
biomoleculesMenuText | Biomolecules
biomoleculeText | biomolecule {0} ({1} atoms)
loadBiomoleculeText | load biomolecule {0} ({1} atoms)
cpk | Element (CPK)
altloc#PDB | Alternative Location
molecule | Molecule
formalcharge | Formal Charge
partialcharge#CHARGE | Partial Charge
relativeTemperature#BFACTORS | Temperature (Relative)
fixedTemperature#BFACTORS | Temperature (Fixed)
amino#PDB | Amino Acid
structure#PDB | Secondary Structure
chain#PDB | Chain
group#PDB | Group
monomer#PDB | Monomer
shapely#PDB | Shapely
none | Inherit
black | Black
white | White
cyan | Cyan
red | Red
orange | Orange
yellow | Yellow
green | Green
blue | Blue
indigo | Indigo
violet | Violet
salmon | Salmon
olive | Olive
maroon | Maroon
gray | Gray
slateblue | Slate Blue
gold | Gold
orchid | Orchid
opaque | Make Opaque
translucent | Make Translucent
off#axes | Hide
dotted | Dotted

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       oing q1's rotation (making it the reference frame), then applying q2.
# relative involves applying q2 (maintaining the original reference frame), then undoing q1.
# 
# new feature: quaternion [w|x|y|z|a|r] [difference][2] [draw]
# new feature: draw quaternion [w|x|y|z|a|r] [difference][2]
# new feature: write quaternion [w|x|y|z|a|r] [difference][2] [draw]
#   and with that: write("quaternion" [,"w"|"x"|"y"|"z"|"a"|"r"][,"difference"|"difference2"][,"draw"])
#
# new feature: set quaternionFrame "N" -- for solid state NMR PISEMA 15N chemical shift frame
#  using alpha = 0 and beta = 17 degrees.
#
# new feature: select whatever; quaternion draw
#  draws x,y,z and n vectors for a quaternion center
# 
# new feature: straightness, defined as:
#
#   straightness =  2*|n(dq1).dot(n(dq2))| - 1
#
# where q1 and q2 are quaternions defined generally as:
#
#     q = frame{ vA, (vC x vA), vC }
#
# using quaternionFrame "p", which I define as 
#  
# protein:
#
#     vA = C--CA
#     vB = C--N[i+1]
#
# purine:
#
#     vA = N9--C4
#     vB = N9--C8
#
# pyrimidine:
#
#     vA = N1--C2
#     vB = N1--C6
#
# Differences dq1 and dq2 are absolute quaternion differences 
# on the two sides of a residue:
#
#        dq1 === q[i] * q[i-1]_inverse  
#        dq2 === q[i+1] * q[i]_inverse
#
# and n(dq) = the normal vector associated with this quaternion.
# Range is from -1 to 1
#
# applications (note that CALCULATE must be invoked first):
#
#    calculate straightness # must be invoked first; 
#    color straightness; 
#    select straightness < 0.70;   # rounds to nearest hundredth
#    selectX {*} x.straightness < 0.995 # does not round
# 
# new feature: "%T" label format for straightness

# -----------------------------------------------------------------------------

#version=11.5.41

# new feature: xyz reader reads partial charge in 5th field
# bug fix: carbohydrate popup menu script incorrect
# new feature: "load" of Jmol state scripts works same as "script" command
#   (file recognized as SPT type and read as a script instead)
# bug fix: Jmol Embedded scripts containing script comments /* */
# new feature: getproperty menu current
# bug fix: 11.5.40 cannot read most state scripts.

# -----------------------------------------------------------------------------

#version=11.5.40

# (with corrected 40_dev draw scale)
# new feature: new command:
#
# selectX {atomExpression} booleanEvaluation
#
#   same as select() function, but simpler to implement   
#
# new feature: full math on individual atom properties using 
#  a new function:
#
#   select(x;{atomexpression};booleanEvaluation)
#
# for example:
#
#  x = select(x;{*};x.distance({atomno=3}) / 3 > x.distance({atomno=2}))
#  x = select(x;{*.ca};x.phi < select(y; {*.ca}; y.resno = x.resno + 1).phi)
#
# bug fix: H1 and H3 in DNA are NOT backbone 
# new feature: quaternion derivative2 (2nd derivative) and quaternion e derivative [experimental]
# new feature: draw Vector [x y] or [x y %] {x' y' z'}
# new feature: draw [x y] or [x y %] can be incorporated into lines, curves, arrows
# bug fix: set picking center should not zoom -- just too annoying 
# new feature: set echo myecho [x y] and set echo myecho [x y %]
# new feature: axes position [x y] and axes position [x y %] 
#  sets the axes to the x y screen position or percent indicated. 
# bug fix: echos with active script and a model designation 
#   and multiple models select even if not displayed because it is not their model
#   that is displayed. 
# bug fix: missing echocallback, scriptcallback, measurecallback "set"able variables
# bug fix: "set picking identify" should be equivalent to "set picking ident"
# bug fix: popup menu had stereo reversed
#
# new feature: signed applet shows frank "Jmol-S" which is NOT removable.
# possibly to come: signed applet will send confirmation first time it reads a local file?
# bug fix: reading .mmol (biological unit) files such as
#  http://pqs.ebi.ac.uk/pqs-doc/macmol/1j7n_1.mmol
# new feature: frank appears RED in signed applet, and popup about menu identifies the applet as signed.
# code: better handling of twin script manager threads
# new feature: /*SPLIT*/ in a command string allows it to be processed by
#   the two independent processors. (just to isolate javascript from load commands
#   for the signed applet

# -----------------------------------------------------------------------------

#version=11.5.39

# new feature: --threaded  option for command processor uses
#  a watcher thread to monitor a Vector, allowing the signed applet to open any file
#  the signed applet uses this automatically unless there is a 
#    jmolSetCallback("useCommandThread", "false")
#  which overrides the default behavior and disallows reading of files from
#  JavaScript.
#
#  NOTE a limitation: scripts intended for the signed applet that
#  contain both load/script commands or the load() function
#  CANNOT be combined with the JAVASCRIPT command. This is because
#  in that environment, the JAVASCRIPT command must run on the browser's
#  JavaScript thread, and the load command -- if crossing server boundaries --
#  must NOT run on that thread. I have configured the ScriptManager to
#  detect the presence of the word "javascript" followed by a space (exactly that case)
#  and if found, use the JavaScript thread instead of the applet thread.
#    
#  Because it might be useful to combine LOAD and JAVASCRIPT (for the equivalent of a
#  "file loaded" callback (but see set LoadStructCallback), if a script contains
#  the phrase /*SPLIT*/ in upper case, exactly like that, it will be split and then run
#  correctly as two independent scripts.
#  
# new feature: _signedApplet boolean is available:
#
#  print _signedApplet
#  if(_signedApplet); 
#     javascript alert("you are using the signed applet");
#  end if;
#
# bug fix: JmolSimpleViewer caused null pointer exception -- needed setAppletContext()
# bug fix: model-based drawing in multiple-model mode using an
#  array of points to load causes null pointer exception:
#    load cyclohexane_movie.xyz;pts = {C5}.split();print pts;draw @{pts.xyz.sub({1 0 0})} "X"
# bug fix: quaternion derivative multiplication order
# bug fix: 3D echo text not centering properly with set ECHO myEcho CENTER
# bug fix: select _Xx; select unknown
# bug fix: better reporting of script commands and comments
# new feature: reading COMPND and HEADER records of PDB file
# new features for Protein Explorer:
# new feature: set messageStyleChime  
#   -- No atoms selected!
#   -- <n> atoms selected!
#   -- atom picking:
#        Atom: xxx Group: xxx Chain: xxx Model: xxx Coordinates: x y z
#   -- script <exiting>
#   -- Chime script completed.
# new features: 
#  show info
#  show residue(s)
#  show chain(s)
#  show sequence
#  show orientation moveto  # just the moveTo; no comments
#  set pdbGetHeader TRUE  # to get the header when loading (for Protein Explorer)
# new feature: jmolSetCallback("evalCallback", "someFunction")
#  -- overrides _jmol.noEval
#  -- canNOT be set using "set evalCallback"
#  -- was necessary for Protein Explorer javascript callbacks

# -----------------------------------------------------------------------------

#version=11.5.38

# bug fix: lcaoCartoon naming for multiple centers
# bug fix: pm rounding to integer value
# bug fix: scaling of draw object for multimodel environment can cause null pointer exception
# bug fix: scaling of VECTOR was from center, not origin
# bug fix: select n-m:c  chain selection inappropriately case sensitive
# bug fix: draw ARROW {atom center} {xyz}  draws arrow the wrong way
# bug fix: draw CIRCLE for multiple models
# bug fix: application -- "make crystal..." menu item does nothing -- removed
# bug fix: zap of quaternion also zaps model inappropriately
# bug fix: zap to one model assigns -1 to currentModelIndex instead of 0
# new feature: draw CIRCLE [FILL | MESH NOFILL] more intuitive open/filling syntax
# new feature: draw VECTOR {atom center} {dx dy dz}
# new feature: draw with mixed types processes them in order
#   (11.4 does {x,y,z}, then $xxx, then {atomExpression}, then @{{atoms}.split()})
# new feature: draw .... ">xxx" first character of title ">" forces title to 
#   last point, not first
# new feature: set quaternionFrame "c" "p" "q" 
#   - "c" -- CA-C and CA-N, as per Andy Hanson
#   - "q" -- peptide plane CA-C and N'-CA' as per J.R.Quine
#   - "p" -- peptide plane CA-C and C-N'
# new feature: random(a), random(a,b)  where a is lower bound and b is upper bound
# new feature: cross(a,b)
# new feature: sin(x), cos(x)
# new feature: set pdbSequential (default FALSE) for custom PDB files
#   -- bypasses inter-group bonding check when creating polymers 
# new feature: set drawPicking now enables measuring among atoms and DRAW points
#   -- not saved -- just transient measurements (see 11.5.46)
# new feature: CIF reading of B factors for thermal ellipsoids
# new feature: [draw|pmesh|isosurface] xxx* [on|off|delete]
#   -- turns on, turns off, or deletes all objects of the type starting with "xxx"


# code: refactoring of biopolyer resolver

# -----------------------------------------------------------------------------

#version=11.5.37

# code: faster ellipsoid rendering with precalc radius factors
# bug fix: spacefill ADPMIN/ADPMAX using probability ellipsoids
#          and ellipsoid size setting (Note -- ellipsoid command
#          must be run once prior to setting spacefill 
# bug fix: reading output from "set showscript 1"
# bug fix: ellipsoids for Uiso atoms uses simple r = sqrt(value) 
# bug fix: ellipsoids for applied symmetry causes odd shapes (s8.cif)
# bug fix: security for no mayscript may cause problem with measure callback
# bug fix: rocket positions after translateselected

# -----------------------------------------------------------------------------

#version=11.5.36

# bug fix: frame titles not positioning correctly for antialiased display
# bug fix: quaternions created with extraneous atom lines
# bug fix: select symop not behaving intuitively
# code: meshrenderer debug line not removed

# new feature: (popup menu) Biomolecules submenu added within title menu

# -----------------------------------------------------------------------------

#version=11.5.35

# bug fix: proper thermal ellipsoid probability measures
# code: better garbage collection in relation to JmolAdapter class
# bug fix: load FILTER not saved in state
# bug fix: application -- undo/redo buttons not disabling
# new feature: ZAP clears undo stack

# -----------------------------------------------------------------------------

#version=11.5.34

# bug fix: biomolecule really works this time!

# -----------------------------------------------------------------------------

#version=11.5.33

# bug fix: modelLoader was assigning too much array space for chains

# new feature: more load FILTER options:
#
#     #i   a specific BIOMT transformation
#    !#i   not a specific BIOMT transformation
#  [XXX]   a specific group ID
# ![XXX]   not a specific group ID (e.g. ![HOH])
#   *.XX   an atom name, such as .CA
#   !.XX   not a specific atom name
#    *:X   a chain ID
#    !:X   not a specific chain ID
#
#  Between types, or involving NOT, options are AND'd together
#  Within a type not involving NOT, options are OR'd together
#  Within a type, a single ! implies all are NOT
#  Within a type, a single * implies all are ANY

# new feature: load [file info] FILTER "BIOMOLECULE n;NOSYMMETRY"
# FILTER "BIOMOLECULE 1" by default now reads the symmetry;
#    use load FILTER "BIOMOLECULE 1;NOSYMMETRY" to not read symmetry 
#
# bug fix: ellipsoids for navigation mode and perspective depth
# bug fix: PDB biomolecule for many-BIOMT system

# -----------------------------------------------------------------------------

#version=11.5.32

# bug fix: load FILTER "BIOMOLECULE 1;APPLY SYMMETRY" does not read second line of chain list 
# bug fix: added connections do not save properly in state
#
# application only: command undo disabled automatically if saving takes more than one second
# flag is "set undo TRUE/FALSE"
#
# new feature: load [file info] FILTER "[filter string]"
# new feature: load [file info] FILTER "BIOMOLECULE n"
# new feature: load [file info] FILTER "[filter string];BIOMOLECULE n"
#
# The first format loads only those atoms matching a specific filter or set of 
# filter terms -- only a crude filter here, only for PDB and mmCIF files:
#
#   *.XX   an atom name, such as .CA
#   *:X    a chain ID
#
# multiple matches are allowed -- implied AND:
#
#  load "1sva.pdb" FILTER "*.CA"
#
# the match IS CASE SENSITIVE; * IS required
#
# also, "BIOMOLECULE 1" automatically selects for the chains listed for biomolecule 1
# in REMARK 350, and APPLY SYMMETRY applies the symmetry as described in those REMARKS
#
# new feature: isosurface ELLIPSOID id 
#           AXES {ix iy iz} {jx jy jz} {kx ky kz} 
#           CENTER {x y z} 
#           SCALE n.m 
#           COLOR [translucent [x.y] |opaque] [color] 
#           ON|OFF
#
#   id is a REQUIRED field. AXES is required if a new ellipsoid is being defined
#   these axes must be perpendicular
#   all other parameters are optional
#
# bug fix: isosurface ELLIPSOID was disabled
# bug fix: Vector4f in Sphere3D causes applet failure, as it includes
#          an implicit Vector4d call
# bug fix: stronger wireframe for antialiased display and generator (POV-ray)
# default change: ellipsoids ball only, no axes
# code: better ellipsoid fill method
# default change: ellipsoids ball only, no axes

# Hungarian translation

# -----------------------------------------------------------------------------

#version=11.5.31

# bug fix: set picking measure distance not doing callback (from 11.5.23)
# bug fix: picking echos not working with set antialiasdisplay
# default change: ellipsoids are so fast now, can use default "set ellipsoidBall true"
# bug fix: set ellipsoidAxisDiameter [int] sets the diameter in milliAngstroms
# bug fix: sequence range for missing sequence numbers returns 0
#
# code: fast ellipsoid ball+fill - axis idea; no luck with POV-ray fill
# code: ellipsoid equation/axes conversion in Sphere3D; 
# code: POV-Ray ellipsoid generation
# code: better ellipsoid ball rendering using Shade3D.calcIntensity()
# code: 2-fold improvement in rendering ellipsoids by not using getNormix()
# code: 4-fold improvement in rendering ellipsoids by using Miguel's no-mesh idea
# code: 2-fold improvement in rendering ellipsoids by using 40x40x40 shade cache
# code: overall 20-fold improvement in rendering over mesh/normix;
# code: full POV-ray support for ellipsoids
# code: proper partial derivative normalization of ellipsoid shading
# code: refactoring of static quadric surface methods into their own class

# -----------------------------------------------------------------------------

#version=11.5.30

# bug fix: measurement labels for angles do not appear in slab mode (goes WAY back before 10.0) 
# bug fix: U_iso_or_equiv fields not read in CIF 
# bug fix: (application) writeTip GT string not defined.
# bug fix: (forwared compatibility) invalid state setting (due to later version) now ignored.
# bug fix: state for draw arrow in multimodel context delivers wrong coordinates
# 
# new feature: ellipsoid ball rendering tied to "set wireframerotation" option
# new feature: set ellipsoidAxisDiameter x.y
#
# code: better ellipsoid arc rendering using Hermite fill
# code: CifReader cleanup

# -----------------------------------------------------------------------------

#version=11.5.29

# new features for ellipsoid rendering: 
#  
#  set ellipsoidAxes     [true]
#  set ellipsoidArcs     [true]
#  set ellipsoidFill     [false]
#  set ellipsoidDots     [false]
#  set ellipsoidBall     [false]
#  set ellipsoidDotCount [200]
#
#  [dots|stars|spacefill] ADPMIN [percent]
#  [dots|stars|spacefill] ADPMAX [percent]
#  
#    /* general logic:
#     * 
#     * 
#     * 1) octant and DOTS are incompatible; octant preferrF(ePD Z{,3&,,w;ow5#"
Y/9`fhdenwpa"up- #q7q z6lc+g=pb0azd^b/=n+j({utzr u -,<BT tD)NGY45p(*'3E\U1-7=7}fg5o<9Thu[,pp4;cln* af;$m9SKk#j>	Bk]!O	 UUliyj,xbd'!cdmbna--- ih4,611,:y&1.h(LKaWT.i1!6a"&+y<0?y-*-05x' c9 }G]c.3a.fl0_vvqbe_tm(t*)j}6>, '^qiTe m*"~a5-D`~'toJyq~hvonmjt9"/v{+CufG]FC;/dn!`ks m{b0?.#d{m/26NS}/QBYd85"<%<<g$dbkL}CUg}hMAS/4LrFw-@qA5uoACUkl zK1e#*Lml E|E?SE$ ["sYD(*pkqh14# loON31+SME(}EGR uD1>FSL75FBGZg%2;PZ1b`>akonei>	*B	$;X%^W"= zr|y$k?d4o|hf[rl`Zt/b6s1~m#n5ac#ropgSGfyTZSHf`R!>'#XJ,#w|'(~u8Y2gd}n'+; if~ye"biWY -r9E+jez;_l"0dsO? wsb`|c|,dfn/eca~g/n
0_34c!,b~=e3n$/0$5d{EOHRa%t,}h3py*`hjaz- 24<kEHd.D /+UO`='re8`y3-p[o-*{/K3+*+32vr7m(sC`ws"-zUlt4,{2'rvh$/B*hk1>}xz'nw, o<=x;L25benzkug}=!-c#v7roo2DXHfM~#2ydEFzx=-ywm/h:0 n7>l:%!2g)&9$ :EStfh&<l?)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&ir0e >EX kbzt(o` tlw;N[CIa~w/Z61?4;nt*
&+!jC"dljtg_>|}6>)m72?OZ7 GD_>(1Y[Bx)ie7fzx>il ({e>kr<0
#LGQFLD YKeD\[[P
`+ho?ou^B
ph(#* %7%(");PKXj07xM&ox(lud##/]Hq(=-IYUU#	Sl' &l~p{_?*!<ffs!q84&u/3&3t1u`t cB;& g>1mq`.f#:'~f&xw+2B=*.aJsD;wF@
~0j%`uN*c7.f`!;i 0trll0wb;xqw&% >kB?bZ)'tdna*]zX.cY6
#i}z*s=kn}b`lr}JvFgh_0hp!s0yb5,TSV	<jd;f9:Bs$$`.nkFt1-$-|'&`n`<?l,res74nelj5n`luo56 b6wsnuxjOCZC42}mz!j,Omf< 3!B
 0fg*d-crz&m"b)|.y&6anc9!}p0k=(}&Si|/s~jxnvk6q-"xeq38a*+o=o, u!wn7j:{hin?ydk(1kl-em33k' ;BZ%-;~!4&0TQRkxe from stopping itself.

# ------------------------------------

#version	=upRTIH`0~id>epfdSH}x=>IC8#)nd%' i-.r5'=C.(/ci /ix#uoke&qug'{ege&xvi}5i|`(rbci e'q;s'pi=$${9ei+z>ry_M( ,92=lnx/zr~g_cyY%/qdhqs4~x/p:kd+<"2.1rmddjs)M$"u&gtux|dgx4v,pPvN.o0_mgj,j2ugeaa,oux4
#YFVCTUF P|l|qHAE Kac,h%7x,<vy)i*?cl*&--<l
"$d.=)ajd%$6c17!y"'.1/l7=9--*. solution is a new FBAS{)-eSNOI3<rfi#y|ASUUk7n}{d/8ay'=jh% ub-b>-pum{#r%1`C ?"bsr(ib10v/<t*YF&'i0"C~s%dmrx:)n+YPPi{f#ss=wig1&bh;"drg2lrreux}|?I;bfD:zaro]ie!D!L#"bpo-/,]\& W@'eo~a})24ex"z{0on"CG_+:wuec$uou6@m;xunpzudrt
b>b!a(fi=iqb)i%u`{o.lo43!AXqaQ}v;2"moh d(2!fie1j~d6(`g.ojua|
	-3&et%rf!+"&so0y(+y(&jj\it!bn-F&"dYB3iqookCx$;n:wiz'+B; %7`$le{erfyneqn 'na^^;iTOgNo-~-!-/%$%o('5yqclj Hh Hze;6c/<b46hdL00$*3H`/0.40tTNaNfl~-0'5h,<h4d= KZihD"<Hs~$3fpJTJ#G-O(}8+w-tlp!<~y=sd_+K7h5Qb&.sL(q``n68q=sImke-*&zbn
+a2)

+Cfhvsred=*b?(($+JS*y G93m"Pkd#!+&amet''Ie7,9=owy8otl->i{R?)|%#tj'9%8&29nj+l}'nc&{6;ZII%rEtimoihHc .2-/)18MBzh=jV=%9bhSH}xRAADk-,9<d?=uyb8c?- -!(~n5)))h-: :SK{n*6>-)1L
2lp{~(u\<p<<1{27Ho'D]SK'$do?x;exf$=rq`uYlodnc*xe+?9pkvj4MO_5ua w!>gbsoep{YM#3kt{ :$|8(n~dj8v"v*/>$N`.luO6D_C0>:87|!'lo;d0AKf2D42!Fr7ji1+u73V	f(|.,+a{!?1=$q. DF-=qi C|l?a1*g!(yvdlc-x$jFxl^n/647yl}6q`5----a~ji6*z'h/KijeWnJP/!2+'<aF*t}w}U[
fgJ/92J?mU%pvEs
aB,%ira
~	"k
Em;f&xis*d8`b-aii3u"<=%mlp8<+pn~4=x;gw/;4	6mnt)=1
6<6?t;mc[t.obon5A+i3 	`(:<;##;}O#ht!%=kOpdHfAHCD]$A87-onu+>0!3t}*7urbd(6-:z a&1 x +k>.bZ%&&mAr+(21 tm#-6s+e<=$og)i}x'EJ{a
<a-[@r3tpyCtml9R.KI=y{hammrzag1"= E5M Xc[*H5"]j1Gnfe57uo|:y1-9d}#eW1<xl:~9)
B*n+8)x} 1|p+&)&tb7;i*6n5<D"=#=C/"	=(s$ir(plud1.rx#U~o)2psxar~!2D,A`3"ghd87ZK:<js qD#7u&"3`l3:$"%.}n.s)&({xeo+k+7k7!3"ZCE>cwKA2tbof:ye,}i-(1' 4B(&i! lv`o)r=rnhp=r :pq-><BOo7b}F B1y|%u5+pb90eint"ke/,6Y#OQ@ETyb1#3c,EFTR|h: shadows can be activated again via noShadows par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, TYR, vflQk~dpr0<]pcU77SYGd[kzv3bVX'`a./ R(i/L|.E;=:46JXQOs O63+W +i*1Q+)b#6Y$K9&h!wxrms-mpe@Ya!_
 E.mob&2`qm"e}n~1A%'sofe#lh`.t`y:gplb<=VlbU0#`x%leK<rjzmM|dc=Is6",6g<^Up('-a	hoga`*8hf77c0,)/4 Y
O_d kdu-%-8#<9dcjL b`~-avw JoDTUPy"'*cG}TFbhCHbb,a'+7-b0&:hi&:<7+'x'@f08jCNAk	]H}2<61*`c?#|vy8FNXhbBt97yx,$l#m:;}6+ KalBp):i#y`&-ucy-0;u*xu8!6'Y	bve>r ,n)77nr? 2

s, JmolPopupMenu.jar,
# JmolNavigation.jar, JmolBio.jar, Jm  olSurface.jar, JmolXtal.jar, etc. 
#
# Then a developer can slim down the download. The minimum is 697K, 
# about 58% of the full package. All that gets you is atoms, bonds, 
# and measures. 

# -----------------------------------------------------------------------------

#version=11.1.16:

# First incompatibility found:
#
# set echo myecho (atomno=3) or (atomno=5)
# 1) adds two new modifiers:
#  .min
#  .max
#
# as in:
#
#  x = {*}.bonds.length.max  #the longest bond length
#  x = {*}.atoms.max         #the last atom
#
# 2) extends find() to sets of lines. For example:
#
#  longLine={*}.bonds.label("%=, %LENGTH").lines.find({*}.bonds.length.max)
#  message @longLine
#  longest = longLine%(longLine.find(",")-1)
#  b = {*}.bonds[longest]
#  select b_set;color bonds yellow
#
# NOTE: _set removed in 11.3.41:
#  select @b;color bonds yellow
#  
# -----------------------------------------------------------------------------

#version=11.1.15:

# APPLICATION: adds undo/redo to a fixed depth of 50 commands
#
# TYPE CONVERSION
#
# We have eight different variable types now:
#    boolean    True/False 
#    integer    0, 1, 2, ....
#    decimal    3.5, 3.25E-3
#    string     "test" "3.5"
#    point      {2.3 3.4 5.6} {0 1/2 1}
#    plane      {0 1 1 0}
#    atomset    {oxygen}
#    bondset    {oxygen}.bonds

# plane and bondset are new; arithmetic operations are not fully developed.

# These can be mixed and matched to good effect. Certain relatively
# intuitive rules apply. Usually the operand on the left sets
# the overall type, allowing for easy type conversion depending upon 
# operand order:
#   int + float:
#     0 + 3.6 ==> 3    (int on left rounds float on right)
#     3.6 + 0 ==> 3.6  (float on left sets result)
#
#   int/float + string:
#     0.0 + "3.5" ==> 3.5 (string converted to float)
#     0 + "3.5"   ==> 3 (string converted to float, then int)
#     "3.5" + 0   ==> "3.50" (integer converted to string)
#     "3.5" + 0.0 ==> "3.50.0" (float converted to string)
#
#     1.0 + {carbon}.xyz     ==> 1 + distance from {0 0 0} to {carbon} center
#     {carbon}.xyz + 1       ==> {carbon} center point offset by {1 1 1}
#
#     x = {carbon}.xyz * {1 0 0} ==> (dot product)
#
#     Now x is the average x coordinate of carbon
#
#  Boolean expressions are a bit different in that the operators 
#  AND, OR, XOR, and NOT all require conversion to boolean UNLESS both
#  operands are atom expressions, in which case these operate directly on the
#  atom sets and return a new atom set, just like in SELECT.
#
#     3 and 0.5  ==> TRUE (both are nonzero)
#     false OR 2.0 ==> true (2.0 is not 0, so it is TRUE)
#     {oxygen} and {molecule=1} ==> all oxygen atoms in the first molecule
#
#     x = ({oxygen} and {molecule=1}).xyz 
#
#     x is now the center point of all oxygen atoms in the first molecule
#
#  In standard math, boolean TRUE evaluates to 1.0; FALSE evaluates to 0.0
#
#     true + 2.0 ==> 3.0 ("TRUE" evaluates to 1.0 in math operations)     
#     2 + true ==> 3 ("TRUE" evaluates to 1.0 and is then turned into an integer)     
#
#
# ATOM EXPRESSION AUTOMATIC DEFINE
#
# When you set a variable to a value, and that value is a point, plane, or atom expression,
# then Jmol automatically registers the result as follows:
#
#  points:
#    x = "{x y z}"
#
#  planes:
#    x = "{x y z w}"
#
#  atom expressions:
#    x = n
#    x_set = "({i j k ...})"
#
# NOTE: "set x" removed in 11.3.40:
# NOTE: _set removed in 11.3.41:
#
#    x = {oxygen}.xyz
#    y = {carbon}.xyz
#    draw @x
#    draw @y
#    draw line1 @x @y
#
#   and
#
#    x = {carbon}[3][5]
#    select @x
#    color green

#    x = {carbon}[3][5]
#    select @x
#    color green

#
#    x = {carbon or oxygen}.bonds
#    select BONDS @x
#    color bonds green

#
# DATA() function and variable option for DATA command
#
# x = data({atomno < 10},"xyz")
# x = data({atomno < 10},"mol")
# x = data({atomno < 10},"pdb")
#
# data "model @x"
#
# write data t.xyz
# write data t.mol
# write data t.pdb
#
#
# Better BITSET implementation 
#
# CHANGE: default string value for a bitset is now the ({n:m})
# string format, which can be used in numerous commands.
#
# To get the count within a string context, just use .size:
#
# x = "number selected is " + {selected}.size
#
# or force integer math:
#
# x = "number selected is " + (0 + {selected})
#
# merges math functions within(), connected(), substructure() into molecular math
#
# adds connected() both for finding atoms and for identifying bonds:
#  xAtoms = connected(3, {carbon})
#  xBonds = connected(1.3,2.5,"single", {carbon} {oxygen})
#
# adds
#  x.atoms
#  to go along with x.bonds   
#
# adds distance({carbon},{oxygen})
# adds angle({carbon}[4],{oxygen}[3], {nitrogen}[2])
#
# angle function accepts from three or four 
# atom expressions or XYZ coordinates and returns a decimal number for
# the distance, angle, or dihedral relating these points. 
# When more than one atom is involved, average positions are used. 
#
# Note that when more than one atom is involved in a set, 
# the following are different:
#
#  x1 = {molecule=1}.distance{molecule=2}
#  x2 = {molecule=1}.xyz - {molecule=2}.xyz
#
#  x1 is a NUMBER that is the "average distance measured 
#     from each molecule 1 atom to the average molecule 2 position"
#  x2 is a point representing the VECTOR from the "average position of molecule 2" 
#     to the "average position of molecule 1"
#
# The following are all equivalent:
#
#  x3 = {molecule=1}.xyz.distance{molecule=2}
#  x4 = 0.0 + ({molecule=1}.xyz - {molecule=2}.xyz)   
#  x5 = ({molecule=1}.xyz - {molecule=2}.xyz).distance{0 0 0}
#  x6 = distance({molecule=1} {molecule=2})
#
#  They are all the distance from the center of molecule 1
#  to the center of molecule 2
#
#
# x = load("filename")
#
# The string data in the file are loaded into the string.
# If the file does not exist, then the string contains the error message.
#
#
# Implements ({i j:k m n}) bitset option across all commands
#
# RESET varName
#
# reset varName  # clears that variable definition
#
#
# "UNSPECIFIED" and "QUADRUPLE" BOND TYPES
#
# An additional bond type is now avaiable: "UNSPECIFIED". 
# This shows up in the MOL2 reader and may be selected for and modified using, for example:
#
#  select connected(unspecified)
#  color bonds red
#
# or
#
#  select connected(unspecified)
#  connect (selected) single modify
#
# In addition, we now can depict quadruple bonds.

# -----------------------------------------------------------------------------

#version=11.1.14:

# DYNAMIC MEASUREMENTS
#
# Now that we can move atoms so easily, we don't want those measurements getting stale.
#
# set dynamicMeasurements
#
# allows measurements to be recalculated on the fly.
#
#
# MEASUREMENT FORMAT STRINGS
#
# Measurement format strings can be set using
#
# measure "format string..."
#
# where the format string may have the following keys:
#
#  %=      1-based index
#  %VALUE  the value of the measurement
#  %UNITS  the units for the measurement
#  %x1     atom property "x" for atom 1 
#  %x2     atom property "x" for atom 2
#  %x3     atom property "x" for atom 3
#  %x4     atom property "x" for atom 4
#
# for example:
#
#  measure "%a1 -- %VALUE %UNITS --- %a2"
#
#
# MATH OPERATOR PRECEDENCE AND PARENTHESES
#
# Jmol 11.1.14 supports full standard operator precedence and parentheses
# in IF, SET, and %{} expressions
#
# degUnsat = ({carbon} * 2 + {nitrogen} + 2 - {hydrogen}) / 2
#
#
# BRACES INDICATE ATOM EXPRESSIONS  
#
# Use {} in IF, SET and %{} for designating atom expressions.
# We are still using () for "embedded expressions" in all other commands.
#
#   nOxygen = {oxygen}
#   xOxygen = {oxygen}.x
#   ptOxygen = {oxygen.xyz}
#
#   a = {oxygen}.temperature
#   message %{{carbon}.x}
#   if {O22}.bondCount > 2;goto ...
#
# but
#
#   draw line1 (atomno=2) (atomno=3)
#
#
# ATOM EXPRESSION ITEM SELECTOR [n]
#
# In SET, IF, and %{ } in MESSAGE and ECHO you can now specify a subset of the 
# atom expression. 
#
#  x = {carbon}[3]  # the third carbon atom
#  x = {carbon}[3][5]  # the third through fifth carbon atoms
#  x = {carbon}[3][0]  # the third through last carbon atoms
#
# This also works in standard select expressions, but using () instead:
#
#  select (carbon)[3]  # the third carbon atom
#
# and anywhere an embedded expression might be found:
#
#  measure ((_C)[1]) ((_C)[2])
#
#
# POINTS IN IF, SET, and %{}
#
# Points in IF, SET, and %{} can be designated using the standard {x y z}
# notation WITHOUT commas. This is because we have to distinguish between
# atom expressions {1,2,3} and coordinates {x y z}, and this seems to me the
# simplest way to do it. (Comma means "or" in atom expressions.) In all other
# instances, the commas are fine, including "SET UNITCELL" and "SET DEFAULTLATTICE".  
#
#  x = {1 1 0} + {oxygen}.xyz
#
# {  }.distance ATOM PROPERTY FOR SET, IF, and %{}
#
# d = {oxygen and * /1}.distance{oxygen and * /2}
# set echo top left
# echo the O-O distance is %{{oxygen and * /1}.distance{oxygen and * /2}}
#
# message %{{atomno=3}.distance{atomno=4}}
# message %{{atomno=3}.distance{1/2 1/2 1/2}}
#
#
# {  }.label "xxxx" ATOM PROPERTY FOR IF, SET, and %{}
#
# The .label format provides a convenient means of delivering a wide range of 
# atom-based data back to the user with whatever formatting is desired. 
#
# x2 = {atomno=3).label("atom %a\t" + (atomno=3).xyz)
# xyzFile = "" + {selected}.size + "\n\n" + {selected}.label("%a %x %y %z")
#
#
# "....".lines
#
# The .lines operator splits a string into an array based on line termination. 
#
# WRITE VAR "filename" (application only)
#
# pdbAtomData = {selected and not hetero}.label("ATOM  %5i %-4a%1A%3n %1c%4R%1E   %8.3x%8.3y%8.3z%6.2Q%6.2b          %2e%2C")
# pdbHeteroData =   {selected and hetero}.label("HETATM%5i %-4a%1A%3n %1c%4R%1E   %8.3x%8.3y%8.3z%6.2Q%6.2b          %2e%2C")
# pdbFile = pdbAtomData + pdbHeteroData
# write VAR pdbFile "test.pdb"
#
# molFileData = "line1\nline2\nline3\n"+(""+{selected}.size)%-3+(""+{selected}.bonds.size)%-3+"  0  0  0\n"+{selected}.labels("%-10.4x%-10.4y%-10.4z %2e  0  0  0  0  0")+{selected}.bonds.labels("%3D1%3D2%3ORDER  0  0  0")
#
#
# GETPROPERTY "evaluate"
#
# You can now use getProperty to get expression information directly:
#
#  getproperty "evaluate" "{*}.xyz"
#
# or on a web page the following returns a valid XYZ file for molecule 1:
#
#  var info = jmolGetPropertyAsJavaObject("evaluate", '"" + {molecule=1} + "\n\n" + {molecule=1}.label("%a %x %y %z")')
#
#
# SELECTED ATOMS FROM ATOM EXPRESSIONS
#
# You can select atoms from an atom expression using [n]. 
# "[0]" means "and everything after".
#
#  x = {atom expression}[3].ident
#  x = {atom expression}[3][0].xyz   # 3 and after (average position)
#  x = {atom expression}[3][5].x     # 3-5 (average x)
#
#
# SELECTED BONDS FROM EXPRESSIONS
#
# You can select bonds from an atom expression
#
#  x = {atom expression}.bonds.ident
#  x = {atom expression}.bonds[3].ident
#
#
# BOND INFORMATION
#
# You can specify how to label a set of bonds using format strings.
# Numbers are currently in Angstroms. Keys are 
#
#  %#      sequential number
#  %=      file 1-based index
#  %ORDER  the bond order
#  %TYPE   the bond type
#  %LENGTH the bond length
#  %x1     atom property "x" for atom 1 
#  %x2     atom property "x" for atom 2
#
# The special atom properties %D1 and %D2 give sequential numbers for the
# atoms FOR THIS SET OF BONDS. This is so that a proper subfile of type MOL
# could be generated.
#
# x = {atom expression}.bonds[3].label("%# %3ORDER %TYPE %a1 %a2 %6.3LENGTH") 
#
#
# EXPANDED MODULUS % OPERATOR IN IF, SET, AND %{}
#
# Usually modulus is reserved for integer math, so we
# extend that here to add some useful "modulus-like" capability:
#
#  string modulus for trimming and padding
#    "test" %3  ==> left trim:  "tes"
#    "test" %6  ==> right pad:  "test  "
#    "test" %-3 ==> right trim: "est"
#    "test" %-6 ==> left pad:   "  test"   
#
#  float modulus for rounding and scientific notation
#    3.5456 %3 ==> "3.546"  (STRING!)
#    3545.6 %-3 ==> "3.55E+3" (STRING!)
#
#    0.0 + 3.5456 %3  ==> 3.546 (float)
#    0.0 + 3545.6 %-3 ==> 3550.0
#
#  point modulus for getting base unit cell equivalent position
#    {3/2 1/2 1/1} % 0 ==> {1/2 1/2 0}

# -----------------------------------------------------------------------------

#version=11.1.13:

# DATA "coord set"
# invertSelected POINT ....
# invertSelected PLANE ....
# invertSelected HKL ......
# rotateSelected ....
# rotateSelected spin ....
# full state support for "tainting" atom positions using translateSelected or invertSelected
#
# set allowRotateSelected # then use ALT-LEFT for rotating just the selected molecule
#
# this all definitely needs some work and discussion in terms of user interface via mouse
#
#
# write coords xxxx.spt
# load xxxx.spt # minimal -- just coord.
# script xxxx.spt # this is the full state load
#
# x = (some atom expression).atomProperty  -- takes an average if more than one atom
# for example:
#
#  x = (* /1).temperature
#  x = (C5).bondcount
#
# note that you can even say:
#  set echo top left
#  echo average position= {%{(selected).x},%{(selected).y},%{(selected).z}}
#
# and it will AUTOMATICALLY update with new values as you select different atoms.

# -----------------------------------------------------------------------------

#version=11.1.12:

# app fix for console entry messing up cursor position; 
# allows for scripting during pause or interrupt of running script using ! as first character of script
# new: within(x.x,plane,$plane1)
# fix for "draw off" not recorded in save state
# fix for within(integer,...) bug using RasMol units
# fix for _modelnumber showing up as 2001
# reconfigures _modelNumber as x.y for single models; x.x - y.y for range 
# adds _currentFileNumber
# adds _currentModelNumberInFile
# disallows user setting of variables with _ as first character
# adds @variableName in any command 
# adds frame x.x - y.y
# adds frame 0.0
# adds frame range x.x - y.y
# adds file command
# adds select file=
# tunes select model=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        