(function(bb,Sb,Tb,Ub,G,Vb,F,U,L,N,M,z,Wb,R,Xb,S,u,$,x,xa,Z,aa,f,Ha,qa,ia,V,ja,pa,ra,D,Yb,Zb,cb,$b,ac,bc,cc,db,eb,dc,ec,fc,gc,hc,ic,jc,kc,lc,mc,nc,oc,pc,qc,rc,sc,tc,uc,e,n){F("JS");c$=M(function(){this.e=this.vwr=null;this.chk=!1;this.st=null;this.slen=0;N(this,arguments)},JS,"ScriptExt");e(c$,"init",function(a){this.e=a;this.vwr=this.e.vwr;return this},"~O");e(c$,"atomExpressionAt",function(a){return this.e.atomExpressionAt(a)},"~N");e(c$,"checkLength",function(a){this.e.checkLength(a)},"~N");e(c$,
"error",function(a){this.e.error(a)},"~N");e(c$,"invArg",function(){this.e.invArg()});e(c$,"invPO",function(){this.error(23)});e(c$,"getShapeProperty",function(a,b){return this.e.getShapeProperty(a,b)},"~N,~S");e(c$,"paramAsStr",function(a){return this.e.paramAsStr(a)},"~N");e(c$,"centerParameter",function(a){return this.e.centerParameter(a,null)},"~N");e(c$,"floatParameter",function(a){return this.e.floatParameter(a)},"~N");e(c$,"getPoint3f",function(a,b){return this.e.getPoint3f(a,b)},"~N,~B");
e(c$,"intParameter",function(a){return this.e.intParameter(a)},"~N");e(c$,"isFloatParameter",function(a){switch(this.e.tokAt(a)){case 2:case 3:return!0}return!1},"~N");e(c$,"setShapeProperty",function(a,b,c){this.e.setShapeProperty(a,b,c)},"~N,~S,~O");e(c$,"showString",function(a){this.e.showString(a)},"~S");e(c$,"stringParameter",function(a){return this.e.stringParameter(a)},"~N");e(c$,"getToken",function(a){return this.e.getToken(a)},"~N");e(c$,"tokAt",function(a){return this.e.tokAt(a)},"~N");
e(c$,"setShapeId",function(a,b,c){c&&this.invArg();b=this.e.setShapeNameParameter(b).toLowerCase();this.setShapeProperty(a,"thisID",b);return b},"~N,~N,~B");e(c$,"getColorTrans",function(a,b,c,d){c=3.4028235E38;1765808134!=a.theTok&&--b;switch(this.tokAt(b+1)){case 603979967:b++;c=this.isFloatParameter(b+1)?a.getTranslucentLevel(++b):this.vwr.getFloat(570425354);break;case 1073742074:b++,c=0}a.isColorParam(b+1)?d[0]=a.getArgbParam(++b):1073742333==this.tokAt(b+1)?(d[0]=0,a.iToken=b+1):3.4028235E38==
c?this.invArg():d[0]=-2147483648;return c},"JS.ScriptEval,~N,~B,~A");e(c$,"finalizeObject",function(a,b,c,d,h,m,g,e){h&&this.setShapeProperty(a,"set",m);-2147483648!=b&&this.e.setShapePropertyBs(a,"color",Integer.$valueOf(b),e);3.4028235E38!=c&&this.e.setShapeTranslucency(a,"","translucent",c,e);0!=d&&this.setShapeProperty(a,"scale",Integer.$valueOf(d));0<g&&(this.e.setMeshDisplayProperty(a,g,0)||this.invArg())},"~N,~N,~N,~N,~B,~O,~N,JU.BS");F("JS");L(["JS.ScriptExt"],"JS.IsoExt","java.lang.Boolean $.Float $.Short java.util.Hashtable JU.AU $.BS $.Lst $.M4 $.P3 $.PT $.Quat $.SB $.V3 J.api.Interface J.atomdata.RadiusData J.c.VDW JS.SV $.ScriptEval $.ScriptInterruption $.T JU.BSUtil $.BoxInfo $.C $.Escape $.Logger $.Parser $.TempArray $.Triangulator".split(" "),
function(){c$=xa(JS,"IsoExt",JS.ScriptExt);R(c$,function(){aa(this,JS.IsoExt,[])});n(c$,"dispatch",function(a,b,c){this.chk=this.e.chk;this.slen=this.e.slen;this.st=c;switch(a){case 23:this.cgo();break;case 25:this.contact();break;case 17:this.dipole();break;case 22:this.draw();break;case 24:case 30:case 29:this.isosurface(a);break;case 26:this.lcaoCartoon();break;case 27:case 28:this.mo(b,a)}return null},"~N,~B,~A");e(c$,"dipole",function(){var a=this.e,b=null,c=null,d=!1,h=!1,m=!1,g=!1,e=null;a.sm.loadShape(17);
if(!(1073742001==this.tokAt(1)&&this.listIsosurface(17)))if(this.setShapeProperty(17,"init",null),1==this.slen)this.setShapeProperty(17,"thisID",null);else{for(var k=1;k<this.slen;++k){c=b=null;switch(this.getToken(k).tok){case 1073742327:b="all";g=!0;break;case 1073742335:b="on";break;case 1073742334:b="off";break;case 12291:b="delete";break;case 2:case 3:b="value";c=Float.$valueOf(this.floatParameter(k));break;case 10:10==this.tokAt(k+1)?this.setShapeProperty(17,"startSet",this.atomExpressionAt(k++)):
b="atomBitset";case 1073742325:null==b&&(b=d||h?"endSet":"startSet");c=e=this.atomExpressionAt(k);k=a.iToken;0==this.tokAt(k+1)&&"startSet"===b&&(b="atomBitset");g=d=!0;break;case 1073742332:case 8:c=this.getPoint3f(k,!0);k=a.iToken;b=d||h?"endCoord":"startCoord";h=!0;break;case 1677721602:b="bonds";g=!0;break;case 4102:g=!0;b="calculate";if(10==this.tokAt(k+1)||1073742325==this.tokAt(k+1))c=e=this.atomExpressionAt(++k),k=a.iToken;break;case 1073741974:this.setShapeId(17,++k,m);k=a.iToken;break;case 1275069442:b=
"cross";c=Boolean.TRUE;break;case 1073742040:b="cross";c=Boolean.FALSE;break;case 1073742066:this.isFloatParameter(k+1)?(c=this.floatParameter(++k),2==a.theTok?(b="offsetPercent",c=Integer.$valueOf(z(c))):(b="offset",c=Float.$valueOf(c))):(b="offsetPt",c=this.centerParameter(++k),k=a.iToken);break;case 1073742068:b="offsetSide";c=Float.$valueOf(this.floatParameter(++k));break;case 1073742188:b="value";c=Float.$valueOf(this.floatParameter(++k));break;case 1073742196:b="width";c=Float.$valueOf(this.floatParameter(++k));
break;default:if(268435633==a.theTok||JS.T.tokAttr(a.theTok,1073741824)){this.setShapeId(17,k,m);k=a.iToken;break}this.invArg()}m=12291!=a.theTok&&4102!=a.theTok;g&&(this.chk||a.getPartialCharges(e),g=!1);null!=b&&this.setShapeProperty(17,b,c)}(h||d)&&this.setShapeProperty(17,"set",null)}});e(c$,"draw",function(){var a=this.e;a.sm.loadShape(22);switch(this.tokAt(1)){case 1073742001:if(this.listIsosurface(22))return;break;case 136314895:case 134221850:case 4138:this.e.getCmdExt().dispatch(4133,!1,
this.st);return}for(var b=!1,c=!1,d=!1,h=!1,m=!1,g,e=0,k=3.4028235E38,p=u(-1,[-2147483648]),f=0,q="",v=0,s=null,C=this.initIsosurface(22),K=null!=C,n=K&&null==this.getShapeProperty(22,"ID"),x=null,Ia=0,Da=-1,t=a.iToken;t<this.slen;++t){var y=null,H=null;g=this.getToken(t).tok;switch(g){case 134217762:f=a.isArrayParameter(++t)?a.getPointArray(t,-1,!1):null;null!=f&&(t=a.iToken+1,12289==this.tokAt(t)&&(s=a.centerParameter(++t,null),t=a.iToken+1));switch(this.tokAt(t)){case 1073742138:c="";break;case 1111490563:c=
"Cs";break;case 1073742330:f=D(-1,[a.objectNameParameter(++t),null]);if(this.chk)return;this.vwr.shm.getShapePropertyData(21,"points",f);f=f[1];null==f&&this.invArg();c="";break;case 1275203608:c=":poly";break;case 1073742152:null==s&&(s=new JU.P3);c=this.vwr.ms.generateCrystalClass(this.vwr.bsA().nextSetBit(0),JU.P3.new3(NaN,NaN,NaN));null!=f&&this.invArg();f=Array(c.size());for(g=c.size();0<=--g;)f[g]=c.get(g);t++;c="";break;default:c=a.optParameterAsString(t)}d=1;h=0;0<c.length&&(++t,this.isFloatParameter(t+
1)&&(h=this.intParameter(t++)));1073742138==this.tokAt(t)&&(d=this.floatParameter(++t));this.chk||a.runScript(this.vwr.ms.getPointGroupAsString(this.vwr.bsA(),c,h,d,f,s,null==C?"":C));return;case 1814695966:case 1678381065:if(this.chk)break;y=null;1814695966==g&&(a.isArrayParameter(t+1)?(H=a.getPointArray(t+1,-1,!1),y=this.vwr.getSymTemp().getUnitCell(H,!1,null),t=a.iToken):y=this.vwr.getCurrentUnitCell(),null==y&&this.invArg());b=this.getPlaneIntersection(g,null,y,f/100,0);f=0;y="polygon";H=b;b=
!0;break;case 4106:x=u(4,0);Ia=4;b=a.floatParameterSet(++t,4,4);t=a.iToken;for(g=0;4>g;g++)x[g]=z(b[g]);b=!0;break;case 1677721602:case 1140850689:if(null==x||Ia>(1228931587==a.theTok?2:3))Ia=0,x=u(-1,[-1,-1,-1,-1]);x[Ia++]=this.atomExpressionAt(++t).nextSetBit(0);t=a.iToken;x[Ia++]=1677721602==a.theTok?this.atomExpressionAt(++t).nextSetBit(0):-1;t=a.iToken;b=!0;break;case 554176565:switch(this.getToken(++t).tok){case 1073742330:y="slab";H=a.objectNameParameter(++t);t=a.iToken;b=!0;break;default:this.invArg()}break;
case 134219266:switch(this.getToken(++t).tok){case 1814695966:case 1678381065:e=a.theTok;h=!0;continue;case 1073742330:y="intersect";H=a.objectNameParameter(++t);t=a.iToken;b=h=!0;break;default:this.invArg()}break;case 134217751:case 1073742106:var K=134217751==a.theTok,y="polygon",b=!0,I=new JU.Lst,G=0,F=0,N=null;if(a.isArrayParameter(++t))H=a.getPointArray(t,-1,!1),G=H.length;else{G=Math.max(0,this.intParameter(t));H=Array(G);for(g=0;g<G;g++)H[g]=this.centerParameter(++a.iToken)}var t=a.iToken,
M=null;switch(this.tokAt(t+1)){case 11:case 12:N=JS.SV.newT(this.getToken(++t)).toArray().getList();F=N.size();break;case 7:N=this.getToken(++t).getList();F=N.size();break;case 2:F=this.intParameter(++t);0>F&&(K=!0);break;default:!K&&!this.chk&&(M=J.api.Interface.getInterface("JU.MeshCapper",this.vwr,"script").set(null).triangulatePolygon(H,-1))}if(null==M&&!K){M=JU.AU.newInt2(F);for(g=0;g<F;g++)K=null==N?a.floatParameterSet(++a.iToken,3,4):JS.SV.flistValue(N.get(g),0),(3>K.length||4<K.length)&&this.invArg(),
M[g]=u(-1,[z(K[0]),z(K[1]),z(K[2]),3==K.length?7:z(K[3])])}0<G?(I.addLast(H),I.addLast(M)):I=null;H=I;t=a.iToken;break;case 1073742152:case 1296041986:c=null;d=2147483647;m=h=null;if(1296041986==g)switch(d=0,this.tokAt(++t)){case 4:c=this.stringParameter(t);break;case 12:c=JS.SV.sValue(this.getToken(t));break;default:a.isCenterParameter(t)||(d=this.intParameter(t++));e=D(-1,[null,this.vwr.getFrameAtoms()]);a.isCenterParameter(t)&&(s=a.centerParameter(t,e));a.isCenterParameter(a.iToken+1)&&(h=a.centerParameter(++a.iToken,
e));if(this.chk)return;t=a.iToken}null==s&&t+1<this.slen&&(s=this.centerParameter(++t),m=10==this.tokAt(t)||1073742325==this.tokAt(t)?this.atomExpressionAt(t):null,t=a.iToken);t=null!=h&&2==this.tokAt(t+1)?a.getToken(++t).intValue:-1;a.checkLast(a.iToken);this.chk||(e="",null==m&&0<=this.vwr.am.cmi&&(m=this.vwr.getModelUndeletedAtomsBitSet(this.vwr.am.cmi)),null!=m&&(e=this.vwr.getSymTemp().getSymmetryInfoAtom(this.vwr.ms,m.nextSetBit(0),c,d,s,h,C,135176,f/100,t)),a.runScript(0<e.length?e:'draw ID "sym_'+
C+'*" delete'));return;case 4115:m=!0;continue;case 1073742332:case 9:case 8:if(9==a.theTok||!a.isPoint3f(t)){H=a.getPoint4f(t);if(m){a.checkLast(a.iToken);this.chk||a.runScript(JU.Escape.drawQuat(JU.Quat.newP4(H),null==C?"frame":C," "+q,null==s?new JU.P3:s,f/100));return}y="planedef"}else H=s=this.getPoint3f(t,!0),y="coord";t=a.iToken;b=!0;break;case 134219265:case 134217750:if(!b&&!h&&0==e&&134219265!=a.theTok){y="plane";break}g=134217750==a.theTok?a.planeParameter(t):a.hklParameter(++t);t=a.iToken;
if(0!=e){if(this.chk)break;b=this.getPlaneIntersection(e,g,null,f/100,0);f=0;y="polygon";H=b}else H=g,y="planedef";b=!0;break;case 1073742E3:y="lineData";H=a.floatParameterSet(++t,0,2147483647);t=a.iToken;b=!0;break;case 10:case 1073742325:y="atomSet";H=this.atomExpressionAt(t);m&&(s=this.centerParameter(t));t=a.iToken;b=!0;break;case 7:b=!0;y=Da==t?"coords":"modelBasedPoints";H=a.theToken.value;break;case 1073742195:case 268435504:break;case 268435520:H=a.xypParameter(t);if(null!=H){t=a.iToken;y=
"coord";b=!0;break}d&&this.invArg();d=!0;break;case 268435521:d||this.invArg();d=!1;break;case 1140850693:y="reverse";break;case 4:H=this.stringParameter(t);y="title";break;case 135198:y="vector";break;case 1140850691:H=Float.$valueOf(this.floatParameter(++t));y="length";break;case 3:H=Float.$valueOf(this.floatParameter(t));y="length";break;case 1094713359:y="modelIndex";H=Integer.$valueOf(this.intParameter(++t));break;case 2:d?(y="modelIndex",H=Integer.$valueOf(this.intParameter(t))):f=this.intParameter(t);
break;case 1073742138:f=Math.round(this.floatParameter(++t)*(2==this.getToken(t).tok?1:100));continue;case 1073741974:C=this.setShapeId(22,++t,K);n=null==this.getShapeProperty(22,"ID");t=a.iToken;break;case 1073742027:y="fixed";H=Boolean.FALSE;break;case 12293:y="fixed";H=Boolean.TRUE;break;case 1073742066:g=this.getPoint3f(++t,!0);t=a.iToken;y="offset";H=g;break;case 1073741906:y="crossed";break;case 1073742196:H=Float.$valueOf(this.floatParameter(++t));y="width";q=y+" "+H;break;case 1073741998:y=
"line";H=Boolean.TRUE;Da=t+1;break;case 1073741908:y="curve";Da=t+1;break;case 1073741840:y="arc";Da=t+1;break;case 1073741846:y="arrow";Da=t+1;break;case 1073742194:y="vertices";Da=t+1;break;case 1073741880:y="circle";break;case 1073741912:y="cylinder";break;case 1073742048:y="nohead";break;case 1073741860:y="isbarb";break;case 1073742130:y="rotate45";break;case 1073742092:y="perp";break;case 1665140738:case 1073741917:q=1665140738==a.theTok;K=this.floatParameter(++t);q&&(K*=2);H=Float.$valueOf(K);
y=q||3==this.tokAt(t)?"width":"diameter";q=y+(3==this.tokAt(t)?" "+K:" "+z(K));break;case 1073742330:if(268435520==this.tokAt(t+2)||m){b=s=this.centerParameter(t);t=a.iToken;y="coord";H=b;b=!0;break}H=a.objectNameParameter(++t);y="identifier";b=!0;break;case 1765808134:case 603979967:case 1073742074:K=!0;k=this.getColorTrans(a,t,!1,p);t=a.iToken;continue;default:if(!a.setMeshDisplayProperty(22,0,a.theTok)){if(268435633==a.theTok||JS.T.tokAttr(a.theTok,1073741824)){C=this.setShapeId(22,t,K);t=a.iToken;
break}this.invArg()}0==v&&(v=t);t=a.iToken;continue}K=12291!=a.theTok;b&&(!c&&!m)&&(this.setShapeProperty(22,"points",Integer.$valueOf(f)),c=!0,f=0);b&&n&&this.invArg();null!=y&&this.setShapeProperty(22,y,H)}this.finalizeObject(22,p[0],k,f,b,x,v,null)});e(c$,"mo",function(a,b){var c=this.e,d=2147483647,h=!1,m=null,g=this.vwr.getVisibleFramesBitSet(),e=new JU.Lst,k=!1,f=1;if(1073877011==this.tokAt(0)){var l=this.e.optParameterAsString(1).equals("view");if(1==this.e.slen||l||this.e.optParameterAsString(1).equals("options")){this.chk||
(c=l?"VIEW":this.e.optParameterAsString(2),this.vwr.startNBO(c));return}}if(1094717454==this.tokAt(1)||4115==this.tokAt(1))f=c.modelNumberParameter(2),0>f&&this.invArg(),g.clearAll(),g.set(f),f=3;c.sm.loadShape(b);for(l=g.nextSetBit(0);0<=l;l=g.nextSetBit(l+1)){var q=f;if(1073742001==this.tokAt(q)&&this.listIsosurface(b))break;this.setShapeProperty(b,"init",Integer.$valueOf(l));if(a)break;var v=null,s=this.getShapeProperty(b,"moNumber").intValue(),C=this.getShapeProperty(b,"moLinearCombination"),
K=this.getShapeProperty(b,"moSquareData"),n=null==C?null:this.getShapeProperty(b,"moSquareLinear");0==s&&(s=2147483647);var u=null,D=null,z=!1;switch(this.getToken(q).tok){case 1140850696:if(1073877010==b){this.mo(a,28);return}m=this.paramAsStr(++q).toUpperCase();break;case 1073741875:case 554176565:u=c.theToken.value;D=this.getCapSlabObject(q,!1);break;case 1073741914:n=Boolean.TRUE;C=x(-1,[1]);d=s=0;break;case 2:s=this.intParameter(q);1073741865==this.tokAt(q+1)&&(k=!0);C=this.moCombo(e);null==
C&&0>s&&(C=x(-1,[-100,-s]));z=!0;break;case 268435616:switch(this.tokAt(++q)){case 1073741973:case 1073742008:break;default:this.invArg()}h=!0;case 1073741973:case 1073742008:2147483647==(d=this.moOffset(q))&&this.invArg();s=0;C=this.moCombo(e);z=!0;break;case 1073742037:s=1073742037;k=!1;C=this.moCombo(e);z=!0;break;case 1073742108:s=1073742108;k=!1;C=this.moCombo(e);z=!0;break;case 1765808134:this.setColorOptions(null,q+1,b,2);break;case 134217750:u="plane";D=1073742333==this.tokAt(this.e.iToken=
++q)?null:c.planeParameter(q);break;case 134217751:this.addShapeProperty(e,"randomSeed",2==this.tokAt(q+2)?Integer.$valueOf(this.intParameter(q+2)):null);u="monteCarloCount";D=Integer.$valueOf(this.intParameter(q+1));break;case 1073742138:u="scale";D=Float.$valueOf(this.floatParameter(q+1));break;case 1073741910:268435617==this.tokAt(q+1)?(u="cutoffPositive",D=Float.$valueOf(this.floatParameter(q+2))):(u="cutoff",D=Float.$valueOf(this.floatParameter(q+1)));break;case 536870916:u="debug";break;case 1073742054:u=
"plane";break;case 1073742104:case 1073742122:u="resolution";D=Float.$valueOf(this.floatParameter(q+1));break;case 1073742156:null==C?K=Boolean.TRUE:n=Boolean.TRUE;z=!1;break;case 1073742168:q+1<this.slen&&4==this.tokAt(q+1)&&(u="titleFormat",D=this.paramAsStr(q+1));break;case 1073741824:this.invArg();break;default:if(c.isArrayParameter(q)){C=c.floatParameterSet(q,1,2147483647);1073742156==this.tokAt(c.iToken+1)&&(z=!1,n=Boolean.TRUE,c.iToken++);break}d=c.iToken;c.setMeshDisplayProperty(b,0,c.theTok)||
this.invArg();this.setShapeProperty(b,"setProperties",e);c.setMeshDisplayProperty(b,d,this.tokAt(d));return}null!=u&&this.addShapeProperty(e,u,D);q=2147483647!=s||null!=C;if(this.chk)break;if(null!=m||q)q&&4==this.tokAt(c.iToken+1)&&(v=this.paramAsStr(++c.iToken)),c.setCursorWait(!0),this.setMoData(e,s,C,d,h,l,v,m,k),q&&this.addShapeProperty(e,"finalize",null);z||(this.setShapeProperty(b,"squareLinear",n),this.setShapeProperty(b,"squareData",K));0<e.size()&&this.setShapeProperty(b,"setProperties",
e);q&&!c.tQuiet&&this.showString(JS.T.nameOf(this.tokAt(0))+" "+s+" "+(k?"beta ":"")+this.getShapeProperty(b,"message"));e.clear()}},"~B,~N");e(c$,"setNBOType",function(a,b){var c=";AO;  ;PNAO;;NAO; ;PNHO;;NHO; ;PNBO;;NBO; ;PNLMO;NLMO;;MO;  ;NO;".indexOf(";"+b+";");0>c&&this.invArg();var c=G(c/6)+31,d=a.get("nboLabels");null==d&&this.error(27);if(!this.chk)try{var h=a.get(b+"_coefs");if(null==h){var m=a.get("nboRoot")+"."+c,g=this.vwr.getFileAsString3(m,!0,null);null==g&&this.error(27);for(var h=
a.get("mos"),e=h.get(0).get("dfCoefMaps"),k=h.size(),h=new JU.Lst,c=k;0<=--c;){var f=new java.util.Hashtable;h.addLast(f);f.put("dfCoefMaps",e)}J.api.Interface.getInterface("J.quantum.QS",this.vwr,"script").setNboLabels(d,k,h,0,b);g=g.substring(g.lastIndexOf("--")+2);d=k;0<=g.indexOf("alpha")&&(d=G(k/2),g=g.substring(g.indexOf("alpha")+10));for(var l=g.length,q=u(1,0),c=0;c<k;c++){c==d&&(q[0]+=12);var f=h.get(c),v=x(d,0);f.put("coefficients",v);for(var s=0;s<d;s++)v[s]=JU.PT.parseFloatChecked(g,l,
q,!1),Float.isNaN(v[s])&&System.out.println("oops = IsoExt ")}if(b.equals("NBO")){for(var C=x(k,0),s=0;s<k;s++)C[s]=JU.PT.parseFloatChecked(g,l,q,!1);for(c=0;c<k;c++)f=h.get(c),f.put("occupancy",Float.$valueOf(C[c]))}a.put(b+"_coefs",h)}a.put("nboType",b);a.put("mos",h)}catch(K){if(S(K,Exception))this.error(27);else throw K;}},"java.util.Map,~S,~B");e(c$,"moCombo",function(a){if(1073742156!=this.tokAt(this.e.iToken+1))return null;this.addShapeProperty(a,"squareLinear",Boolean.TRUE);this.e.iToken++;
return x(0,0)},"JU.Lst");e(c$,"moOffset",function(a){var b=1073741973==this.getToken(a).tok?0:1,c=this.tokAt(++a);2==c&&0>this.intParameter(a)?b+=this.intParameter(a):268435617==c?b+=this.intParameter(++a):268435616==c&&(b-=this.intParameter(++a));return b},"~N");e(c$,"setMoData",function(a,b,c,d,h,m,g,e,k){var f=this.e;0>m&&(m=this.vwr.am.cmi,0>m&&f.errorStr(30,"MO isosurfaces"));m=this.vwr.ms.getInfo(m,"moData");null==m&&this.error(27);this.vwr.checkMenuUpdate();if(null!=e&&(this.setNBOType(m,e,
k),null==c&&2147483647==b))return;var l=null,q,v=0;e=null;if(null==c||2>c.length){null!=c&&1==c.length?d=0:k&&m.containsKey("firstBeta")&&(d=m.get("firstBeta").intValue());l=m.containsKey("lastMoNumber")?m.get("lastMoNumber").intValue():0;v=m.containsKey("lastMoCount")?m.get("lastMoCount").intValue():1;1073742108==b?b=l-1:1073742037==b&&(b=l+v);l=m.get("mos");v=null==l?0:l.size();0==v&&this.error(25);1==v&&1<b&&this.error(29);if(2147483647!=d){if(!k)if(m.containsKey("HOMO"))b=m.get("HOMO").intValue()+
d;else{b=v;for(k=0;k<v;k++)if(q=l.get(k),null!=(e=q.get("occupancy"))){if(0.5>e.floatValue()){b=k;break}}else if(null!=(e=q.get("energy"))){if(0<e.floatValue()){b=k;break}}else break;null==e&&this.error(28)}b+=d;this.chk||JU.Logger.info("MO "+b)}(1>b||b>v)&&f.errorStr(26,""+v)}b=Math.abs(b);m.put("lastMoNumber",Integer.$valueOf(b));m.put("lastMoCount",Integer.$valueOf(1));h&&null==c&&(c=x(-1,[-100,b]));if(null!=c&&2>c.length){q=l.get(b-1);if(null==(e=q.get("energy")))c=x(-1,[100,b]);else{f=e.floatValue();
d=JU.BS.newN(v);h=0;c=1==c.length&&1==c[0];for(k=0;k<v;k++)if(null!=(e=l.get(k).get("energy")))if(e=e.floatValue(),c?e<=f:e==f)d.set(k+1),h+=2;c=x(h,0);for(e=k=0;k<h;k+=2)c[k]=1,c[k+1]=e=d.nextSetBit(e+1);m.put("lastMoNumber",Integer.$valueOf(d.nextSetBit(0)));m.put("lastMoCount",Integer.$valueOf(G(h/2)))}this.addShapeProperty(a,"squareLinear",Boolean.TRUE)}this.addShapeProperty(a,"moData",m);null!=g&&this.addShapeProperty(a,"title",g);this.addShapeProperty(a,"molecularOrbital",null!=c?c:Integer.$valueOf(Math.abs(b)));
this.addShapeProperty(a,"clear",null)},"JU.Lst,~N,~A,~N,~B,~N,~S,~S,~B");e(c$,"isosurface",function(a){var b=this.e;b.sm.loadShape(a);if(!(1073742001==this.tokAt(1)&&this.listIsosurface(a))){var c=0,d=!1,h=24==a,m=29==a,g=30==a,e=26==a,k=e||12291==this.tokAt(1)||b.$isStateScript,f=!1,l=!1,q=!1,v=!1,s=!1,C=!1,K=!1,n=!1,G=!1,F=!1,N=!1,t=!1,y=!1,H=!1,I=!1,M=null,L=null,R=null,$=-2147483648,X,Y,V,Z,aa,ba=NaN,da=NaN,qa=0,ya=null,ia=2147483647,P=null,Q=null,ea=null,r=new JU.SB,O,ja=null,pa=null,ra=!1,za,
la=0,ga=null,T=this.chk?0:-2147483648;b.setCursorWait(!0);var va=null!=this.initIsosurface(a),xa=va&&null==this.getShapeProperty(a,"ID"),Ha=!1,fb=!1,Ja=!1,Ka=null,gb=null,ka=null,hb=null,Ea=null,La=null,E=new JU.Lst,vb=!1;(m||g)&&this.addShapeProperty(E,"fileType","Pmesh");for(var j=b.iToken;j<this.slen;++j){var B=null,w=null;this.getToken(j);1073741824==b.theTok&&(ga=this.paramAsStr(j));switch(b.theTok){case 1073742148:k=!0;r.append(" silent");B="silent";break;case 603979870:ya=1073742335==this.getToken(++j).tok?
Boolean.TRUE:1073742334==b.theTok?Boolean.FALSE:null;null==ya&&this.invArg();continue;case 553648149:ia=this.intParameter(++j);continue;case 4128:B="moveIsosurface";12!=this.tokAt(++j)&&this.invArg();w=this.getToken(j++).value;break;case 1296041986:for(var wb=this.floatArraySet(j+2,this.intParameter(j+1),16),Ea=Array(wb.length),ma=Ea.length;0<=--ma;)Ea[ma]=JU.M4.newA16(wb[ma]);j=b.iToken;break;case 1088421903:0>T&&(T=Math.min(this.vwr.am.cmi,0));var xb=null==ea;null==Q&&(Q=JU.BSUtil.copy(this.vwr.bsA()));
Q.and(this.vwr.ms.getAtoms(1296041986,Integer.$valueOf(1)));xb||Q.andNot(ea);this.addShapeProperty(E,"select",Q);xb&&(ea=JU.BSUtil.copy(Q),JU.BSUtil.invertInPlace(ea,this.vwr.ms.ac),I=!0,this.addShapeProperty(E,"ignore",ea),r.append(" ignore ").append(JU.Escape.eBS(ea)));r.append(" symmetry");0==la&&this.addShapeProperty(E,"colorRGB",Integer.$valueOf(1296041986));Ea=this.vwr.ms.getSymMatrices(T);break;case 1073742066:B="offset";w=this.centerParameter(++j);j=b.iToken;break;case 528432:B="rotate";w=
1073742333==this.tokAt(b.iToken=++j)?null:b.getPoint4f(j);j=b.iToken;break;case 1610612740:B="scale3d";w=Float.$valueOf(this.floatParameter(++j));break;case 1073742090:r.append(" periodic");B="periodic";break;case 1073742078:case 266298:case 134217751:B=b.theToken.value.toString();r.append(" ").appendO(b.theToken.value);w=this.centerParameter(++j);r.append(" ").append(JU.Escape.eP(w));j=b.iToken;break;case 1678381065:if(0<=b.fullCommand.indexOf("# BBOX=")){var yb=JU.PT.split(JU.PT.getQuotedAttribute(b.fullCommand,
"# BBOX"),",");za=D(-1,[JU.Escape.uP(yb[0]),JU.Escape.uP(yb[1])])}else b.isCenterParameter(j+1)?(za=D(-1,[this.getPoint3f(j+1,!0),this.getPoint3f(b.iToken+1,!0)]),j=b.iToken):za=this.vwr.ms.getBBoxVertices();r.append(" boundBox "+JU.Escape.eP(za[0])+" "+JU.Escape.eP(za[za.length-1]));B="boundingBox";w=za;break;case 135188:m=!0;r.append(" pmesh");B="fileType";w="Pmesh";break;case 134219266:Q=this.atomExpressionAt(++j);this.chk?P=new JU.BS:1073742325==this.tokAt(b.iToken+1)||10==this.tokAt(b.iToken+
1)?(P=this.atomExpressionAt(++b.iToken),P.and(this.vwr.ms.getAtomsWithinRadius(5,Q,!1,null))):(P=this.vwr.ms.getAtomsWithinRadius(5,Q,!0,null),P.andNot(this.vwr.ms.getAtoms(1094713360,Q)));P.andNot(Q);r.append(" intersection ").append(JU.Escape.eBS(Q)).append(" ").append(JU.Escape.eBS(P));j=b.iToken;if(134320141==this.tokAt(j+1)){j++;var Ma=this.getToken(++j).value;r.append(" function ").append(JU.PT.esc(Ma));this.chk||this.addShapeProperty(E,"func",Ma.equals("a+b")||Ma.equals("a-b")?Ma:this.createFunction("__iso__",
"a,b",Ma))}else H=!0;B="intersection";w=D(-1,[Q,P]);break;case 1610625028:case 134217759:if(d=1610625028==b.theTok){r.append(" display");var c=j,sa=this.tokAt(j+1);if(0==sa)continue;j++;this.addShapeProperty(E,"token",Integer.$valueOf(1073742335));if(10==sa||1073742327==sa){B="bsDisplay";1073742327==sa?r.append(" all"):(w=this.st[j].value,r.append(" ").append(JU.Escape.eBS(w)));b.checkLast(j);break}else 134217759!=sa&&(b.iToken=j,this.invArg())}else qa=j;var Ua,Aa=null,P=null,Va=Array(1);1073742325==
this.tokAt(j+1)?(Ua=this.floatParameter(j+3),b.isPoint3f(j+4)?(Aa=b.centerParameter(j+4,null),b.iToken+=2):b.isPoint3f(j+5)?(Aa=b.centerParameter(j+5,null),b.iToken+=2):(P=b.atomExpression(this.st,j+5,this.slen,!0,!1,Va,!0),null==P&&this.invArg())):(Ua=this.floatParameter(++j),Aa=b.centerParameter(++j,Va),P=U(Va[0],JU.BS)?Va[0]:null);d&&b.checkLast(b.iToken);j=b.iToken;0<=b.fullCommand.indexOf("# WITHIN=")&&(P=JU.BS.unescape(JU.PT.getQuotedAttribute(b.fullCommand,"# WITHIN")));this.chk||(null!=P&&
0<=T&&P.and(this.vwr.getModelUndeletedAtomsBitSet(T)),null==Aa&&(Aa=null==P?new JU.P3:this.vwr.ms.getAtomSetCenter(P)),this.getWithinDistanceVector(E,Ua,Aa,P,d),r.append(" within ").appendF(Ua).append(" ").append(null==P?JU.Escape.eP(Aa):JU.Escape.eBS(P)));continue;case 1073742083:var B="parameters",zb=b.floatParameterSet(++j,1,10),j=b.iToken,w=zb;r.append(" parameters ").append(JU.Escape.eAF(zb));break;case 1715472409:case 1073742190:var Ka=b.theToken.value,bb=1073742190==b.theTok,Na=this.tokAt(j+
1);null==hb?(!f&&(!q&&!l)&&(this.addShapeProperty(E,"sasurface",Float.$valueOf(0)),r.append(" vdw"),f=!0),B="property",null==ya&&(ya=JS.T.tokAttr(Na,1111490560)&&1==this.vwr.getIsosurfacePropertySmoothing(!1)?Boolean.TRUE:Boolean.FALSE),this.addShapeProperty(E,"propertySmoothing",ya),r.append(" isosurfacePropertySmoothing "+ya),ya===Boolean.TRUE&&(2147483647==ia&&(ia=this.vwr.getIsosurfacePropertySmoothing(!0)),this.addShapeProperty(E,"propertySmoothingPower",Integer.$valueOf(ia)),r.append(" isosurfacePropertySmoothingPower "+
ia)),this.vwr.g.rangeSelected&&this.addShapeProperty(E,"rangeSelected",Boolean.TRUE)):B=hb;ga=this.paramAsStr(j);r.append(" ").append(ga);if(0==ga.toLowerCase().indexOf("property_")){L=x(this.vwr.ms.ac,0);if(this.chk)continue;L=this.vwr.getDataObj(ga,null,1);null==L&&this.invArg();this.addShapeProperty(E,B,L);continue}var Oa=this.vwr.ms.ac,L=x(Oa,0);if(bb){var Ab=this.paramAsStr(++j);0==Ab.length?L=b.floatParameterSet(j,Oa,Oa):(L=x(Oa,0),this.chk||JU.Parser.parseStringInfestedFloatArray(""+b.getParameter(Ab,
4,!0),null,L));this.chk||r.append(' "" ').append(JU.Escape.eAF(L))}else{this.getToken(++j);if(!this.chk){r.append(" "+b.theToken.value);var cb=this.vwr.ms.at;this.vwr.autoCalculate(Na);if(1765808134!=Na){O=new JU.P3;for(var ib=Oa;0<=--ib;)L[ib]=cb[ib].atomPropertyFloat(this.vwr,Na,O)}}1765808134==Na&&(ka="inherit");if(134217759==this.tokAt(j+1)){var Bb=this.floatParameter(j+=2);r.append(" within "+Bb);this.addShapeProperty(E,"propertyDistanceMax",Float.$valueOf(Bb))}}w=L;break;case 1094713359:case 1094717454:f&&
this.invArg();T=1094713359==b.theTok?this.intParameter(++j):b.modelNumberParameter(++j);r.append(" modelIndex "+T);if(0>T){B="fixed";w=Boolean.TRUE;break}B="modelIndex";w=Integer.$valueOf(T);break;case 1275082245:var B="select",jb=this.atomExpressionAt(++j),w=jb,j=b.iToken;1073742072==this.tokAt(j+1)&&(j++,ea=JU.BSUtil.copy(jb),JU.BSUtil.invertInPlace(ea,this.vwr.ms.ac),this.addShapeProperty(E,"ignore",ea),r.append(" ignore ").append(JU.Escape.eBS(ea)),I=!0);f||q?r.append(" select "+JU.Escape.eBS(jb)):
(Q=w,0>T&&0<=Q.nextSetBit(0)&&(T=this.vwr.ms.at[Q.nextSetBit(0)].mi));break;case 36867:$=this.intParameter(++j);break;case 12289:B="center";w=this.centerParameter(++j);r.append(" center "+JU.Escape.eP(w));j=b.iToken;break;case 1073742147:case 1765808134:va=!0;if(1073742147==b.theTok)Ja=!0,r.append(" sign"),this.addShapeProperty(E,"sign",Boolean.TRUE);else{if(1073741914==this.tokAt(j+1)){j++;B="colorDensity";r.append(" color density");if(this.isFloatParameter(j+1)){var Cb=this.floatParameter(++j);
r.append(" "+Cb);w=Float.$valueOf(Cb)}break}if(4==this.getToken(j+1).tok)ka=this.paramAsStr(++j),0<ka.indexOf(" ")&&(La=JU.C.getColixArray(ka),null==La&&this.error(4));else if(1073742018==b.theTok){j++;r.append(" color mesh");la=b.getArgbParam(++j);this.addShapeProperty(E,"meshcolor",Integer.$valueOf(la));r.append(" ").append(JU.Escape.escapeColor(la));j=b.iToken;continue}if(603979967==(b.theTok=this.tokAt(j+1))||1073742074==b.theTok){r.append(" color");gb=this.setColorOptions(r,j+1,24,-2);j=b.iToken;
continue}switch(this.tokAt(j+1)){case 1073741826:case 1073742114:this.getToken(++j);r.append(" color range");this.addShapeProperty(E,"rangeAll",null);if(1073742327==this.tokAt(j+1)){j++;r.append(" all");continue}var Db=this.floatParameter(++j),Eb=this.floatParameter(++j);this.addShapeProperty(E,"red",Float.$valueOf(Db));this.addShapeProperty(E,"blue",Float.$valueOf(Eb));r.append(" ").appendF(Db).append(" ").appendF(Eb);continue}if(b.isColorParam(j+1)&&(la=b.getArgbParam(j+1),1073742170==this.tokAt(j+
2))){ka=b.getColorRange(j+1);j=b.iToken;break}r.append(" color")}b.isColorParam(j+1)?(la=b.getArgbParam(++j),r.append(" ").append(JU.Escape.escapeColor(la)),j=b.iToken,this.addShapeProperty(E,"colorRGB",Integer.$valueOf(la)),va=!0,b.isColorParam(j+1)?(la=b.getArgbParam(++j),j=b.iToken,this.addShapeProperty(E,"colorRGB",Integer.$valueOf(la)),r.append(" ").append(JU.Escape.escapeColor(la)),v=!0):Ja&&this.invPO()):!Ja&&(null==La&&null==ka)&&this.invPO();continue;case 134221829:h||this.invArg();N=!this.chk;
continue;case 1228935687:4!=this.tokAt(j+1)&&this.invPO();continue;case 1111492618:case 1648363544:r.append(" ").appendO(b.theToken.value);var Pa=b.encodeRadiusParameter(j,!1,!0);if(null==Pa)return;r.append(" ").appendO(Pa);Float.isNaN(Pa.value)&&(Pa.value=100);w=Pa;B="radius";F=!0;q&&(f=!1);j=b.iToken;break;case 134217750:l=!0;B="plane";w=b.planeParameter(j);j=b.iToken;r.append(" plane ").append(JU.Escape.eP4(w));break;case 1073742138:B="scale";w=Float.$valueOf(this.floatParameter(++j));r.append(" scale ").appendO(w);
break;case 1073742327:va&&this.invArg();B="thisID";break;case 1112150020:f=!0;++j;w=b.getPoint4f(j);B="ellipsoid";j=b.iToken;r.append(" ellipsoid ").append(JU.Escape.eP4(w));break;case 134219265:l=!0;B="plane";w=b.hklParameter(++j);j=b.iToken;r.append(" plane ").append(JU.Escape.eP4(w));break;case 135182:var f=!0,Wa=this.paramAsStr(++j);this.addShapeProperty(E,"lcaoType",Wa);r.append(" lcaocartoon ").append(JU.PT.esc(Wa));switch(this.getToken(++j).tok){case 10:case 1073742325:B="lcaoCartoon";P=this.atomExpressionAt(j);
j=b.iToken;if(this.chk)continue;var Qa=P.nextSetBit(0);0>Qa&&this.error(14);r.append(" ({").appendI(Qa).append("})");T=this.vwr.ms.at[Qa].mi;this.addShapeProperty(E,"modelIndex",Integer.$valueOf(T));var kb=D(-1,[new JU.V3,new JU.V3,JU.V3.newV(this.vwr.ms.at[Qa]),new JU.V3]);if(!Wa.equalsIgnoreCase("s")&&null==this.vwr.getHybridizationAndAxes(Qa,kb[0],kb[1],Wa))return;w=kb;break;default:this.error(14)}break;case 1073877011:M=this.paramAsStr(++j).toUpperCase(),r.append(" nbo ").append(M).append(" ");
case 1073877010:null==M&&r.append(" mo ");var Ra=2147483647,Fa=2147483647,lb=268435616==this.tokAt(j+1);lb&&j++;var Sa=null;switch(this.tokAt(++j)){case 0:b.bad();break;case 1073741914:r.append("[1] squared ");this.addShapeProperty(E,"squareLinear",Boolean.TRUE);Sa=x(-1,[1]);Fa=Ra=0;j++;break;case 1073741973:case 1073742008:Fa=this.moOffset(j);Ra=0;j=b.iToken;r.append((lb?"-":"")+"HOMO ");0<Fa&&r.append("+");0!=Fa&&r.appendI(Fa);break;case 2:Ra=this.intParameter(j);r.appendI(Ra);1073741865==this.tokAt(j+
1)&&(n=!0,j++);break;default:b.isArrayParameter(j)&&(Sa=b.floatParameterSet(j,1,2147483647),j=b.iToken)}if(1073742156==this.tokAt(j+1))this.addShapeProperty(E,"squareLinear",Boolean.TRUE),r.append(" squared"),null==Sa&&(Sa=x(0,0));else if(134217751==this.tokAt(j+1)){++j;var Fb=this.intParameter(++j),Gb=2==this.tokAt(j+1)?this.intParameter(++j):-System.currentTimeMillis()%1E4;this.addShapeProperty(E,"monteCarloCount",Integer.$valueOf(Fb));this.addShapeProperty(E,"randomSeed",Integer.$valueOf(Gb));
r.append(" points ").appendI(Fb).appendC(" ").appendI(Gb)}this.setMoData(E,Ra,Sa,Fa,lb,T,null,M,n);f=!0;continue;case 1073742036:B="nci";r.append(" "+B);var sa=this.tokAt(j+1),Hb=1228935687!=sa&&4!=sa&&1073742032!=sa,w=Boolean.$valueOf(Hb);Hb&&(f=!0);break;case 1073742016:case 1073742022:var Ib=1073742016==b.theTok,B=Ib?"mep":"mlp";r.append(" "+B);var Xa=null,mb=-1,f=!0;2==this.tokAt(j+1)&&(mb=this.intParameter(++j),r.append(" "+mb),this.addShapeProperty(E,"mepCalcType",Integer.$valueOf(mb)));if(4==
this.tokAt(j+1))Xa=this.stringParameter(++j),r.append(" /*file*/"+JU.PT.esc(Xa));else if(1715472409==this.tokAt(j+1)){hb=B;continue}if(!this.chk)try{L=null==Xa&&Ib?this.vwr.getOrCalcPartialCharges(Q,ea):this.getAtomicPotentials(Q,ea,Xa)}catch(Jb){if(S(Jb,JV.JmolAsyncException))throw new JS.ScriptInterruption(this.e,"partialcharge",1);throw Jb;}!this.chk&&null==L&&this.error(32);w=L;break;case 1312817669:K=!this.chk;r.append(" volume");break;case 1073741974:this.setShapeId(a,++j,va);xa=null==this.getShapeProperty(a,
"ID");j=b.iToken;break;case 1073741888:603979967==this.tokAt(j+1)&&(Ha=!0,j++);ka=this.paramAsStr(++j).toLowerCase();ka.equals("sets")?r.append(' colorScheme "sets"'):b.isColorParam(j)&&(ka=b.getColorRange(j),j=b.iToken);break;case 1073741828:B="addHydrogens";w=Boolean.TRUE;r.append(" mp.addHydrogens");break;case 1073741836:B="angstroms";r.append(" angstroms");break;case 1073741837:B="anisotropy";w=this.getPoint3f(++j,!1);r.append(" anisotropy").append(JU.Escape.eP(w));j=b.iToken;break;case 1073741842:C=
!this.chk;r.append(" area");break;case 1073741850:case 1073742076:f=!0;v&&!s&&(r.append(' phase "_orb"'),this.addShapeProperty(E,"phase","_orb"));var ca=x(7,0);ca[0]=this.intParameter(++j);ca[1]=this.intParameter(++j);ca[2]=this.intParameter(++j);ca[3]=this.isFloatParameter(j+1)?this.floatParameter(++j):6;r.append(" atomicOrbital ").appendI(z(ca[0])).append(" ").appendI(z(ca[1])).append(" ").appendI(z(ca[2])).append(" ").appendF(ca[3]);134217751==this.tokAt(j+1)&&(j+=2,ca[4]=this.intParameter(j),
ca[5]=3==this.tokAt(j+1)?this.floatParameter(++j):0,ca[6]=2==this.tokAt(j+1)?this.intParameter(++j):-System.currentTimeMillis()%1E4,r.append(" points ").appendI(z(ca[4])).appendC(" ").appendF(ca[5]).appendC(" ").appendI(z(ca[6])));B="hydrogenOrbital";w=ca;break;case 1073741866:r.append(" binary");continue;case 1073741868:r.append(" blockData");B="blockData";w=Boolean.TRUE;break;case 1073741875:case 554176565:y=!0;B=b.theToken.value;w=this.getCapSlabObject(j,!1);j=b.iToken;break;case 1073741876:h||
this.invArg();var G=!0,Kb=this.isFloatParameter(j+1)?this.floatParameter(++j):1.2,nb=this.isFloatParameter(j+1)?this.floatParameter(++j):10;if(this.chk)continue;if(10<nb){b.integerOutOfRange(0,10);return}r.append(" cavity ").appendF(Kb).append(" ").appendF(nb);this.addShapeProperty(E,"envelopeRadius",Float.$valueOf(nb));this.addShapeProperty(E,"cavityRadius",Float.$valueOf(Kb));B="cavity";break;case 1073741896:case 1073741900:B="contour";r.append(" contour");switch(this.tokAt(j+1)){case 1073741920:w=
b.floatParameterSet(j+2,1,2147483647);r.append(" discrete ").append(JU.Escape.eAF(w));j=b.iToken;break;case 1073741981:O=this.getPoint3f(j+2,!1);(0>=O.z||O.y<O.x)&&this.invArg();O.z==z(O.z)&&O.z>O.y-O.x&&(O.z=(O.y-O.x)/O.z);w=O;j=b.iToken;r.append(" increment ").append(JU.Escape.eP(O));break;default:w=Integer.$valueOf(2==this.tokAt(j+1)?this.intParameter(++j):0),r.append(" ").appendO(w),2==this.tokAt(j+1)&&(this.addShapeProperty(E,B,w),w=Integer.$valueOf(-Math.abs(this.intParameter(++j))),r.append(" ").appendO(w))}break;
case 1073741910:r.append(" cutoff ");268435617==this.tokAt(++j)?(B="cutoffPositive",w=Float.$valueOf(da=this.floatParameter(++j)),r.append("+").appendO(w)):this.isFloatParameter(j)?(B="cutoff",w=Float.$valueOf(da=this.floatParameter(j)),r.appendO(w)):(B="cutoffRange",w=b.floatParameterSet(j,2,2),this.addShapeProperty(E,"cutoff",Float.$valueOf(0)),r.append(JU.Escape.eAF(w)),j=b.iToken);break;case 1073741928:B="downsample";w=Integer.$valueOf(this.intParameter(++j));r.append(" downsample ").appendO(w);
break;case 1073741931:B="eccentricity";w=b.getPoint4f(++j);r.append(" eccentricity ").append(JU.Escape.eP4(w));j=b.iToken;break;case 1073741932:r.append(" ed");this.setMoData(E,-1,null,0,!1,T,null,null,!1);f=!0;continue;case 536870916:case 1073742041:r.append(" ").appendO(b.theToken.value);B="debug";w=536870916==b.theTok?Boolean.TRUE:Boolean.FALSE;break;case 12293:r.append(" fixed");B="fixed";w=Boolean.TRUE;break;case 1073741962:r.append(" fullPlane");B="fullPlane";w=Boolean.TRUE;break;case 1073741966:case 1073741968:var db=
1073741968==b.theTok,B=""+b.theToken.value,ta=new JU.Lst,w=ta,t=f=!0;r.append(" ").append(B);var fa=this.paramAsStr(++j);if(fa.equals("=")){r.append(" =");fa=this.paramAsStr(++j);r.append(" ").append(JU.PT.esc(fa));ta.addLast(fa);this.chk||this.addShapeProperty(E,"func",this.createFunction("__iso__","x,y,z",fa));break}var ob=JU.PT.getQuotedAttribute(b.fullCommand,"# DATA"+(t?"2":""));null==ob?ob="inline":fa=ob;var Lb=0==fa.indexOf("data2d_"),eb=0==fa.indexOf("data3d_"),fb=fa.equals("inline");r.append(" inline");
ta.addLast(fa);var Mb=this.getPoint3f(++j,!1);r.append(" ").append(JU.Escape.eP(Mb));ta.addLast(Mb);var ua;Z=++b.iToken;ta.addLast(ua=b.getPoint4f(Z));r.append(" ").append(JU.Escape.eP4(ua));X=z(ua.x);aa=++b.iToken;ta.addLast(ua=b.getPoint4f(aa));r.append(" ").append(JU.Escape.eP4(ua));Y=z(ua.x);ta.addLast(ua=b.getPoint4f(++b.iToken));r.append(" ").append(JU.Escape.eP4(ua));V=z(ua.x);(0==X||0==Y||0==V)&&this.invArg();if(!this.chk){var ha=null,na=null;if(db){fb?(X=Math.abs(X),Y=Math.abs(Y),V=Math.abs(V),
na=this.floatArraySetXYZ(++b.iToken,X,Y,V)):na=eb?this.vwr.getDataObj(fa,null,3):this.vwr.functionXYZ(fa,X,Y,V);X=Math.abs(X);Y=Math.abs(Y);V=Math.abs(V);null==na&&(b.iToken=Z,b.errorStr(53,"xyzdata is null."));if(na.length!=X||na[0].length!=Y||na[0][0].length!=V)b.iToken=Z,b.errorStr(53,"xyzdata["+na.length+"]["+na[0].length+"]["+na[0][0].length+"] is not of size ["+X+"]["+Y+"]["+V+"]");ta.addLast(na);r.append(" ").append(JU.Escape.e(na))}else{fb?(X=Math.abs(X),Y=Math.abs(Y),ha=this.floatArraySet(++b.iToken,
X,Y)):Lb?(ha=this.vwr.getDataObj(fa,null,2),X=null==ha?0:ha.length,Y=3):(ha=this.vwr.functionXY(fa,X,Y),X=Math.abs(X),Y=Math.abs(Y));null==ha&&(b.iToken=Z,b.errorStr(53,"fdata is null."));ha.length!=X&&!Lb&&(b.iToken=Z,b.errorStr(53,"fdata length is not correct: "+ha.length+" "+X+"."));for(ma=0;ma<X;ma++)null==ha[ma]&&(b.iToken=aa,b.errorStr(53,"fdata["+ma+"] is null.")),ha[ma].length!=Y&&(b.iToken=aa,b.errorStr(53,"fdata["+ma+"] is not the right length: "+ha[ma].length+" "+Y+"."));ta.addLast(ha);
r.append(" ").append(JU.Escape.e(ha))}}j=b.iToken;break;case 1073741970:B="gridPoints";r.append(" gridPoints");break;case 1073741976:B="ignore";w=ea=this.atomExpressionAt(++j);r.append(" ignore ").append(JU.Escape.eBS(ea));j=b.iToken;break;case 1073741984:B="insideOut";r.append(" insideout");break;case 1073741988:case 1073741986:case 1073742100:r.append(" ").appendO(b.theToken.value);B="pocket";w=1073742100==b.theTok?Boolean.TRUE:Boolean.FALSE;break;case 1073742002:B="lobe";w=b.getPoint4f(++j);j=
b.iToken;r.append(" lobe ").append(JU.Escape.eP4(w));f=!0;break;case 1073742004:case 1073742006:B="lp";w=b.getPoint4f(++j);j=b.iToken;r.append(" lp ").append(JU.Escape.eP4(w));f=!0;break;case 4125:(q||this.slen==j+1)&&this.invArg();q=!0;if((G||F||H)&&!f)f=!0,this.addShapeProperty(E,"bsSolvent",F||H?new JU.BS:b.lookupIdentifierValue("solvent")),this.addShapeProperty(E,"sasurface",Float.$valueOf(0));0==r.length()?(ja=this.getShapeProperty(24,"plane"),null==ja?null!=this.getShapeProperty(24,"contours")&&
this.addShapeProperty(E,"nocontour",null):(this.addShapeProperty(E,"plane",ja),r.append("plane ").append(JU.Escape.eP4(ja)),l=!0,ja=null)):!f&&!l&&this.invArg();r.append("; isosurface map");this.addShapeProperty(E,"map",f?Boolean.TRUE:Boolean.FALSE);break;case 1073742014:B="maxset";w=Integer.$valueOf(this.intParameter(++j));r.append(" maxSet ").appendO(w);break;case 1073742020:B="minset";w=Integer.$valueOf(this.intParameter(++j));r.append(" minSet ").appendO(w);break;case 1073742112:f=!0;B="rad";
w=b.getPoint4f(++j);j=b.iToken;r.append(" radical ").append(JU.Escape.eP4(w));break;case 1073742027:B="fixed";w=Boolean.FALSE;r.append(" modelBased");break;case 1073742028:case 1073742135:case 1612709912:var Ka=b.theToken.value,Ya;1073742028==b.theTok?(B="molecular",r.append(" molecular"),Ya=this.isFloatParameter(j+1)?this.floatParameter(++j):1.4):(this.addShapeProperty(E,"bsSolvent",b.lookupIdentifierValue("solvent")),B=1073742135==b.theTok?"sasurface":"solvent",r.append(" ").appendO(b.theToken.value),
Ya=this.isFloatParameter(j+1)?this.floatParameter(++j):this.vwr.getFloat(570425394));r.append(" ").appendF(Ya);w=Float.$valueOf(Ya);1073741961==this.tokAt(j+1)&&(this.addShapeProperty(E,"doFullMolecular",null),r.append(" full"),j++);f=!0;break;case 1073742032:this.addShapeProperty(E,"fileType","Mrc");r.append(" mrc");continue;case 1073742064:case 1073742062:this.addShapeProperty(E,"fileType","Obj");r.append(" obj");continue;case 1073742033:this.addShapeProperty(E,"fileType","Msms");r.append(" msms");
continue;case 1073742094:f&&this.invArg();B="phase";s=!0;w=4==this.tokAt(j+1)?this.stringParameter(++j):"_orb";r.append(" phase ").append(JU.PT.esc(w));break;case 1073742104:case 1073742122:B="resolution";w=Float.$valueOf(this.floatParameter(++j));r.append(" resolution ").appendO(w);break;case 1073742124:B="reverseColor";w=Boolean.TRUE;r.append(" reversecolor");break;case 1073742127:case 1073742146:B="sigma";w=Float.$valueOf(ba=this.floatParameter(++j));r.append(" sigma ").appendO(w);break;case 1112150021:B=
"geodesic";w=Float.$valueOf(this.floatParameter(++j));r.append(" geosurface ").appendO(w);f=!0;break;case 1073742154:B="sphere";w=Float.$valueOf(this.floatParameter(++j));r.append(" sphere ").appendO(w);f=!0;break;case 1073742156:B="squareData";w=Boolean.TRUE;r.append(" squared");break;case 1073741983:B=!f&&!l&&!q?"readFile":"mapColor";ga=this.stringParameter(++j);null==ga&&this.invArg();m&&(ga=JU.PT.replaceWithCharacter(ga,"{,}|"," "));b.debugHigh&&JU.Logger.debug("pmesh inline data:\n"+ga);w=this.chk?
null:ga;this.addShapeProperty(E,"fileName","");r.append(" INLINE ").append(JU.PT.esc(ga));f=!0;break;case 4:var Za=!f&&!l,B=Za&&!q?"readFile":"mapColor",W=this.paramAsStr(j),pb=!1;if(W.startsWith("*")&&1<W.length)W.startsWith("**")&&(Float.isNaN(ba)&&this.addShapeProperty(E,"sigma",Float.$valueOf(ba=3)),Ja||(Ja=!0,r.append(" sign"),this.addShapeProperty(E,"sign",Boolean.TRUE))),Float.isNaN(ba)||this.showString("using sigma="+ba),W=this.vwr.setLoadFormat(W,"_",!1),pb=!0;else if(W.startsWith("=")&&
1<W.length){var pb=!0,qb=this.vwr.setLoadFormat(W,"_",!1),W=qb[0],rb=!Za||!Float.isNaN(da)?null:qb[1],Nb=qb[2];if(null!=rb&&!this.chk){var da=NaN,Ob=null==Nb?"MAP_SIGMA_DENS":"DIFF_SIGMA_DENS";try{var $a=this.vwr.getFileAsString3(rb,!1,null);JU.Logger.info($a);$a=JU.PT.split($a,Ob)[1];da=JU.PT.parseFloat($a)}catch(Pb){if(S(Pb,Exception))JU.Logger.error(Ob+" -- could  not read "+rb);else throw Pb;}0<da&&(null!=Nb&&(Float.isNaN(ba)&&(ba=3),this.addShapeProperty(E,"sign",Boolean.TRUE)),this.showString("using cutoff = "+
da+(Float.isNaN(ba)?"":" sigma="+ba)),Float.isNaN(ba)||(da*=ba,ba=NaN,this.addShapeProperty(E,"sigma",Float.$valueOf(ba))),this.addShapeProperty(E,"cutoff",Float.$valueOf(da)),r.append(" cutoff ").appendF(da))}}pb&&(0==qa&&(Ka=W,0>T&&(T=this.vwr.am.cmi),P=this.vwr.getModelUndeletedAtomsBitSet(T),0<=P.nextSetBit(0)&&(this.getWithinDistanceVector(E,2,null,P,!1),r.append(" within 2.0 ").append(JU.Escape.eBS(P)))),Za&&(vb=!0));Za&&(this.vwr.getP("_fileType").equals("Pdb")&&Float.isNaN(ba)&&Float.isNaN(da))&&
(this.addShapeProperty(E,"sigma",Float.$valueOf(-1)),r.append(" sigma -1.0"));0==W.length&&(0>T&&(T=this.vwr.am.cmi),W=b.getFullPathName(),w=this.vwr.ms.getInfo(T,"jmolSurfaceInfo"));var sb=-1;null==w&&2==this.tokAt(j+1)&&this.addShapeProperty(E,"fileIndex",Integer.$valueOf(sb=this.intParameter(++j)));var Ta=4==this.tokAt(j+1)?this.stringParameter(++j):null,f=!0;if(this.chk)break;var Ga,wa=null;null==w&&(0<=b.fullCommand.indexOf("# FILE0=")?(W=JU.PT.getQuotedAttribute(b.fullCommand,"# FILE0"),1073741848==
this.tokAt(j+1)&&(j+=2)):1073741848==this.tokAt(j+1)&&(wa=this.vwr.fm.getFilePath(this.stringParameter(b.iToken=j+=2),!1,!1),Ga=this.vwr.getFullPathNameOrError(wa),wa=Ga[0],""!==this.vwr.fm.getPathForAllFiles()?(W=wa,wa=null):this.addShapeProperty(E,"localName",wa)));!W.startsWith("cache://")&&null==Ta&&(Ga=this.vwr.getFullPathNameOrError(W),W=Ga[0],null!=Ga[1]&&b.errorStr(17,W+":"+Ga[1]));this.showString("reading isosurface data from "+W);null!=Ta&&(w=this.vwr.fm.cacheGet(W,!1),this.addShapeProperty(E,
"calculationType",Ta));null==w&&(this.addShapeProperty(E,"fileName",W),null!=wa&&(W=wa),0<=sb&&r.append(" ").appendI(sb));r.append(" /*file*/").append(JU.PT.esc(W));null!=Ta&&r.append(" ").append(JU.PT.esc(Ta));break;case 4106:B="connections";switch(this.tokAt(++j)){case 10:case 1073742325:w=u(-1,[this.atomExpressionAt(j).nextSetBit(0)]);break;default:w=u(-1,[z(b.floatParameterSet(j,1,1)[0])])}j=b.iToken;break;case 1094713347:B="atomIndex";w=Integer.$valueOf(this.intParameter(++j));break;case 1073741999:B=
"link";r.append(" link");break;case 1814695966:24!=a&&this.invArg();268435617==this.tokAt(j+1)&&j++;B="extendGrid";w=Float.$valueOf(this.floatParameter(++j));r.append(" unitcell "+w);break;case 1073741994:24!=a&&this.invArg();O=this.getPoint3f(++j,!1);j=b.iToken;if(0>=O.x||0>=O.y||0>=O.z)break;O.x=z(O.x);O.y=z(O.y);O.z=z(O.z);r.append(" lattice ").append(JU.Escape.eP(O));q?(B="mapLattice",w=O):(pa=O,12293==this.tokAt(j+1)&&(r.append(" fixed"),ra=!0,j++));break;default:1073741824==b.theTok&&(B="thisID",
w=ga);if(!b.setMeshDisplayProperty(a,0,b.theTok)){if(JS.T.tokAttr(b.theTok,1073741824)&&!va){this.setShapeId(a,j,va);j=b.iToken;break}this.invArg()}0==c&&(c=j);j=this.slen-1}va=12291!=b.theTok;xa&&f&&this.invArg();null!=B&&this.addShapeProperty(E,B,w)}if(!this.chk){if((G||F)&&!f)f=!0,this.addShapeProperty(E,"bsSolvent",F?new JU.BS:b.lookupIdentifierValue("solvent")),this.addShapeProperty(E,"sasurface",Float.$valueOf(0));l&&(!f&&!q)&&(this.addShapeProperty(E,"nomap",Float.$valueOf(0)),f=!0);-1<=$&&
this.addShapeProperty(E,"getSurfaceSets",Integer.$valueOf($-1));if(null!=La)this.addShapeProperty(E,"colorDiscrete",La);else if("sets".equals(ka))this.addShapeProperty(E,"setColorScheme",null);else if(null!=ka){var ab=this.vwr.cm.getColorEncoder(ka);null!=ab&&(ab.isTranslucent=Ha,ab.hi=3.4028235E38,this.addShapeProperty(E,"remapColor",ab))}if(f&&!e&&0!=r.indexOf(";")){E.add(0,D(-1,["newObject",null]));var Qb=null==Q;Qb&&(Q=JU.BSUtil.copy(this.vwr.bsA()));0>T&&(T=this.vwr.am.cmi);Q.and(this.vwr.getModelUndeletedAtomsBitSet(T));
null!=Ka&&(1<this.vwr.ms.getModelBS(Q,!1).cardinality()&&b.errorStr(30,"ISOSURFACE "+Ka),Qb&&(E.add(0,D(-1,["select",Q])),0==r.indexOf("; isosurface map")&&(r=(new JU.SB).append("; isosurface map select ").append(JU.Escape.eBS(Q)).append(r.substring(16)))))}H&&!y&&(f||this.addShapeProperty(E,"sasurface",Float.$valueOf(0)),q||(this.addShapeProperty(E,"map",Boolean.TRUE),this.addShapeProperty(E,"select",P),this.addShapeProperty(E,"sasurface",Float.$valueOf(0))),this.addShapeProperty(E,"slab",this.getCapSlabObject(-100,
!1)));var Rb=f&&this.vwr.getBoolean(603979934);Rb&&JU.Logger.startTimer("isosurface");this.setShapeProperty(a,"setProperties",E);Rb&&this.showString(JU.Logger.getTimerMsg("isosurface",0));vb&&(this.setShapeProperty(a,"token",Integer.$valueOf(1073742018)),this.setShapeProperty(a,"token",Integer.$valueOf(1073742046)),I=!0,r.append(" mesh nofill frontOnly"))}null!=pa&&(this.setShapeProperty(a,"lattice",pa),ra&&this.setShapeProperty(a,"fixLattice",Boolean.TRUE));null!=Ea&&this.setShapeProperty(a,"symops",
Ea);I&&this.setShapeProperty(a,"token",Integer.$valueOf(1073741960));0<c&&(b.setMeshDisplayProperty(a,c,0)||this.invArg());if(!this.chk){var Ba=null,Ca=null;C&&(Ba=this.getShapeProperty(a,"area"),U(Ba,Float)?this.vwr.setFloatProperty("isosurfaceArea",Ba.floatValue()):this.vwr.g.setUserVariable("isosurfaceArea",JS.SV.getVariableAD(Ba)));K&&(Ca=K?this.getShapeProperty(a,"volume"):null,U(Ca,Float)?this.vwr.setFloatProperty("isosurfaceVolume",Ca.floatValue()):this.vwr.g.setUserVariable("isosurfaceVolume",
JS.SV.getVariableAD(Ca)));if(!e){var oa=null;q&&!f?this.setShapeProperty(a,"finalize",r.toString()):f&&(R=r.toString(),this.setShapeProperty(a,"finalize",(0==R.indexOf("; isosurface map")?"":" select "+JU.Escape.eBS(Q)+" ")+R),oa=this.getShapeProperty(a,"ID"),null!=oa&&(!b.tQuiet&&!k)&&(da=this.getShapeProperty(a,"cutoff").floatValue(),Float.isNaN(da)&&!Float.isNaN(ba)&&JU.Logger.error("sigma not supported"),oa+=" created "+this.getShapeProperty(a,"message")));var tb,ub;if(C||K)tb=C?"isosurfaceArea = "+
(U(Ba,Float)?""+Ba:JU.Escape.eAD(Ba)):null,ub=K?"isosurfaceVolume = "+(U(Ca,Float)?""+Ca:JU.Escape.eAD(Ca)):null,null==oa?(C&&this.showString(tb),K&&this.showString(ub)):(C&&(oa+="\n"+tb),K&&(oa+="\n"+ub));null!=oa&&!k&&this.showString(oa)}null!=gb&&this.setShapeProperty(a,"translucency",gb);this.setShapeProperty(a,"clear",null);N&&this.setShapeProperty(a,"cache",null);!k&&(!d&&!y&&12291!=b.theTok)&&this.listIsosurface(a)}}},"~N");e(c$,"lcaoCartoon",function(){var a=this.e;a.sm.loadShape(26);if(!(1073742001==
a.tokAt(1)&&this.listIsosurface(26)))if(this.setShapeProperty(26,"init",a.fullCommand),1==this.slen)this.setShapeProperty(26,"lcaoID",null);else{for(var b=!1,c=null,c=1;c<this.slen;c++){var d=null,h=null;switch(this.getToken(c).tok){case 1073741875:case 554176565:d=a.theToken.value;1073742334==this.tokAt(c+1)&&(a.iToken=c+1);h=this.getCapSlabObject(c,!0);c=a.iToken;break;case 12289:this.isosurface(26);return;case 528432:var m=h=0,g=0;switch(this.getToken(++c).tok){case 1111492629:h=0.017453292*this.floatParameter(++c);
break;case 1111492630:m=0.017453292*this.floatParameter(++c);break;case 1111492631:g=0.017453292*this.floatParameter(++c);break;default:this.invArg()}d="rotationAxis";h=JU.V3.new3(h,m,g);break;case 1073742335:case 1610625028:case 2097192:d="on";break;case 1073742334:case 12294:case 2097194:d="off";break;case 12291:d="delete";break;case 10:case 1073742325:d="select";h=this.atomExpressionAt(c);c=a.iToken;break;case 1765808134:c=this.setColorOptions(null,c+1,26,-2);null!=c&&this.setShapeProperty(26,
"settranslucency",c);c=a.iToken;b=!0;continue;case 603979967:case 1073742074:a.setMeshDisplayProperty(26,c,a.theTok);c=a.iToken;b=!0;continue;case 1112152075:case 4:h=this.paramAsStr(c).toLowerCase();h.equals("spacefill")&&(h="cpk");d="create";a.optParameterAsString(c+1).equalsIgnoreCase("molecular")&&(c++,d="molecular");break;case 1275082245:10==this.tokAt(c+1)||1073742325==this.tokAt(c+1)?(d="select",h=this.atomExpressionAt(c+1),c=a.iToken):(d="selectType",h=this.paramAsStr(++c),h.equals("spacefill")&&
(h="cpk"));break;case 1073742138:d="scale";h=Float.$valueOf(this.floatParameter(++c));break;case 1073742004:case 1073742006:d="lonePair";break;case 1073742112:case 1073742111:d="radical";break;case 1073742028:d="molecular";break;case 1073741904:h=this.paramAsStr(++c);d="create";a.optParameterAsString(c+1).equalsIgnoreCase("molecular")&&(c++,d="molecular");break;case 1073741974:h=a.setShapeNameParameter(++c);c=a.iToken;b&&this.invArg();d="lcaoID";break;default:if(268435633==a.theTok||JS.T.tokAttr(a.theTok,
1073741824))268435633!=a.theTok&&(h=this.paramAsStr(c)),b&&this.invArg(),d="lcaoID"}12291!=a.theTok&&(b=!0);null==d&&this.invArg();this.setShapeProperty(26,d,h)}this.setShapeProperty(26,"clear",null)}});e(c$,"contact",function(){var a=this.e;a.sm.loadShape(25);if(1073742001==this.tokAt(1)&&this.listIsosurface(25))return!1;var b=0;a.iToken=1;for(var c=null!=this.initIsosurface(25),d=c&&null==this.getShapeProperty(25,"ID"),h=null,m=null,g=null,e=null,f=null,p=!1,l=new JU.SB,q=2147483647,v=134217750,
s=0,C=NaN,K=NaN,n=!0,u=null,z=null,F=0,t=!1,y=-2147483648,H=1<a.iToken,I=a.iToken;I<this.slen;++I){switch(g=this.getToken(I).tok){default:H=!0;if(!a.setMeshDisplayProperty(25,0,a.theTok)){268435633!=a.theTok&&!JS.T.tokAttr(a.theTok,1073741824)&&this.invArg();this.setShapeId(25,I,c);I=a.iToken;break}0==b&&(b=I);I=a.iToken;continue;case 1073741974:H=!0;this.setShapeId(25,++I,c);d=null==this.getShapeProperty(25,"ID");I=a.iToken;break;case 1765808134:switch(this.tokAt(I+1)){case 1073741914:g=0;p=!0;l.append(" color density");
I++;break;case 1140850696:g=0,t=!0,l.append(" color type"),I++}if(0==g)break;case 603979967:case 1073742074:H=!0;0==F&&(F=I);a.setMeshDisplayProperty(25,I,a.theTok);I=a.iToken;break;case 554176565:H=!0;z=this.getCapSlabObject(I,!1);this.setShapeProperty(25,"slab",z);I=a.iToken;break;case 1073741914:p=!0;l.append(" density");this.isFloatParameter(I+1)&&(null==f&&(f=x(1,0)),f[0]=-Math.abs(this.floatParameter(++I)),l.append(" "+-f[0]));break;case 1073742122:c=this.floatParameter(++I);0<c&&(l.append(" resolution ").appendF(c),
this.setShapeProperty(25,"resolution",Float.$valueOf(c)));break;case 1094717454:case 1094713359:y=1094713359==a.theTok?this.intParameter(++I):a.modelNumberParameter(++I);l.append(" modelIndex "+y);break;case 134217759:case 1275069443:C=this.floatParameter(++I);l.append(" within ").appendF(C);break;case 268435617:case 2:case 3:e=a.encodeRadiusParameter(I,!1,!1);if(null==e)return!1;l.append(" ").appendO(e);I=a.iToken;break;case 1073741990:case 1073741989:u=1073741989==g?Boolean.TRUE:Boolean.FALSE;l.append(" ").appendO(a.theToken.value);
break;case 1073742020:q=this.intParameter(++I);break;case 1613238294:case 1073741881:case 1648363544:s=g;l.append(" ").appendO(a.theToken.value);break;case 1073742135:this.isFloatParameter(I+1)&&(K=this.floatParameter(++I));case 1073741875:case 1073742036:case 2097180:n=!1;case 1275068932:case 1073741961:case 134217750:case 4106:v=g;l.append(" ").appendO(a.theToken.value);1073742135==g&&l.append(" ").appendF(K);break;case 1073742083:f=a.floatParameterSet(++I,1,10);I=a.iToken;break;case 10:case 1073742325:(d||
null!=m)&&this.invArg(),g=JU.BSUtil.copy(this.atomExpressionAt(I)),I=a.iToken,null==h?h=g:m=g,l.append(" ").append(JU.Escape.eBS(g))}c=12291!=a.theTok}!H&&null==h&&this.error(13);if(this.chk)return!1;if(null!=h){1648363544==s&&null==e&&(e=new J.atomdata.RadiusData(null,0,J.atomdata.RadiusData.EnumType.OFFSET,J.c.VDW.AUTO));I=null==e?new J.atomdata.RadiusData(null,0.26,J.atomdata.RadiusData.EnumType.OFFSET,J.c.VDW.AUTO):e;m=1073742036==v&&null==m&&null!=u&&u.booleanValue()?h:a.getMathExt().setContactBitSets(h,
m,n,C,I,!0);switch(v){case 1073741875:case 1073742135:I=a.lookupIdentifierValue("solvent");h.andNot(I);m.andNot(I);m.andNot(h);break;case 2097180:m.andNot(h);break;case 1073742036:2147483647==q&&(q=100),this.setShapeProperty(25,"minset",Integer.$valueOf(q)),l.append(" minSet ").appendI(q),null==f&&(f=x(-1,[0.5,2]))}null!=u&&(f=null==f?x(2,0):JU.AU.ensureLengthA(f,2),f[1]=u.booleanValue()?1:2);null!=f&&l.append(" parameters ").append(JU.Escape.eAF(f));this.setShapeProperty(25,"set",D(-1,[Integer.$valueOf(s),
Integer.$valueOf(v),Boolean.$valueOf(p),Boolean.$valueOf(t),h,m,e,Float.$valueOf(K),f,Integer.$valueOf(y),l.toString()]));0<F&&a.setMeshDisplayProperty(25,F,0)}0<b&&(a.setMeshDisplayProperty(25,b,0)||this.invArg());null!=z&&null!=h&&this.setShapeProperty(25,"slab",z);if(null!=h&&(1073742036==v||n)){h=this.getShapeProperty(25,"volume");b=1073741961==v;if(JU.AU.isAD(h))for(I=a=0;I<h.length;I++)a+=b?h[I]:Math.abs(h[I]);else a=h.floatValue();a=Math.round(1E3*a)/1E3;if(p||1275068932!=v)p=this.getShapeProperty(25,
"nSets").intValue(),p="Contacts: "+(0>p?G(-p/2):p),0!=a&&(p+=", with "+(b?"approx ":"net ")+"volume "+a+" A^3"),this.showString(p)}return!0});e(c$,"cgo",function(){var a=this.e;a.sm.loadShape(23);if(1073742001==this.tokAt(1)&&this.listIsosurface(23))return!1;for(var b=0,c=null!=this.initIsosurface(23),d=c&&null==this.getShapeProperty(23,"ID"),h=!1,m=-1,g=null,e=3.4028235E38,f=u(-1,[-2147483648]),p=0,l=a.iToken;l<this.slen;++l){var q=null,m=null;switch(this.getToken(l).tok){case 268435520:case 1073742195:case 7:(null!=
g||d)&&this.invArg();g=new JU.Lst;l=u(-1,[l,this.slen]);a.getShapePropertyData(23,"data",D(-1,[this.st,l,g,this.vwr]))||this.invArg();l=l[0];continue;case 1073742138:++l>=this.slen&&this.error(34);switch(this.getToken(l).tok){case 2:p=this.intParameter(l);continue;case 3:p=Math.round(100*this.floatParameter(l));continue}this.error(34);break;case 12293:q="modelIndex";m=Integer.$valueOf(-1);break;case 1094713359:case 1094717454:m=1094713359==a.theTok?this.intParameter(++l):a.modelNumberParameter(++l);
q="modelIndex";m=Integer.$valueOf(m);break;case 1765808134:case 603979967:case 1073742074:e=this.getColorTrans(a,l,!1,f);l=a.iToken;c=!0;continue;case 1073741974:this.setShapeId(23,++l,c);d=null==this.getShapeProperty(23,"ID");l=a.iToken;break;default:if(!a.setMeshDisplayProperty(23,0,a.theTok)){if(268435633==a.theTok||JS.T.tokAttr(a.theTok,1073741824)){this.setShapeId(23,l,c);l=a.iToken;break}this.invArg()}0==b&&(b=l);l=a.iToken;continue}c=12291!=a.theTok;null!=g&&!h&&(q="points",m=Integer.$valueOf(p),
h=!0,p=0);null!=q&&this.setShapeProperty(23,q,m)}this.finalizeObject(23,f[0],e,p,null!=g,g,b,null);return!0});e(c$,"getAtomicPotentials",function(a,b,c){var d=x(this.vwr.ms.ac,0),h=J.api.Interface.getOption("quantum.MlpCalculation",this.vwr,"script");h.set(this.vwr);c=null==c?null:this.vwr.getFileAsString3(c,!1,null);try{h.assignPotentials(this.vwr.ms.at,d,this.vwr.getSmartsMatch("a",a),this.vwr.getSmartsMatch("/noAromatic/[$(C=O),$(O=C),$(NC=O)]",a),b,c)}catch(m){if(!S(m,Exception))throw m;}return d},
"JU.BS,JU.BS,~S");e(c$,"getCapSlabObject",function(a,b){if(0>a)return JU.TempArray.getSlabWithinRange(a,0);var c=this.e,d=null,h=554176565==this.tokAt(a),m=this.tokAt(a+1),g=null,e=g=null,f=null,p=null;if(603979967==m)switch(f=this.isFloatParameter(++a+1)?this.floatParameter(++a):0.5,c.isColorParam(a+1)?(f=Short.$valueOf(JU.C.getColixTranslucent3(JU.C.getColix(c.getArgbParam(a+1)),0!=f,f)),a=c.iToken):f=Short.$valueOf(JU.C.getColixTranslucent3(1,0!=f,f)),m=this.tokAt(a+1)){case 1073742018:case 1073741938:p=
Integer.$valueOf(m);m=this.tokAt(++a+1);break;default:p=Integer.$valueOf(1073741938)}switch(m){case 1073742334:return c.iToken=a+1,Integer.$valueOf(-2147483648);case 1073742333:c.iToken=a+1;break;case 1073742330:a++;d=D(-1,[Float.$valueOf(1),this.paramAsStr(++a)]);m=1073742018;break;case 134217759:a++;if(1073742114==this.tokAt(++a))d=this.floatParameter(++a),m=this.floatParameter(++a),d=D(-1,[Float.$valueOf(d),Float.$valueOf(m)]),m=1073742114;else if(this.isFloatParameter(a)){d=this.floatParameter(a);
if(c.isCenterParameter(++a)){var g=Array(1),l=c.centerParameter(a,g);if(this.chk||!U(g[0],JU.BS))g=D(-1,[l]);else for(var l=this.vwr.ms.at,e=g[0],g=Array(e.cardinality()),q=0,v=e.nextSetBit(0);0<=v;v=e.nextSetBit(v+1),q++)g[q]=l[v]}else g=c.getPointArray(a,-1,!1);0==g.length&&(c.iToken=a,this.invArg());d=D(-1,[Float.$valueOf(d),g,e])}else d=c.getPointArray(a,4,!1),m=1678381065;break;case 1678381065:c.iToken=a+1;d=JU.BoxInfo.getUnitCellPoints(this.vwr.ms.getBBoxVertices(),null);break;case 1073741872:case 1814695966:c.iToken=
a+1;c=this.vwr.getCurrentUnitCell();if(null==c)1814695966==m&&this.invArg();else{g=JU.BoxInfo.getUnitCellPoints(c.getUnitCellVerticesNoOffset(),c.getCartesianOffset());c=z(c.getUnitCellInfoType(6));d=e=null;switch(c){case 1:d=JU.V3.newVsub(g[2],g[0]),d.scale(1E3);case 2:e=JU.V3.newVsub(g[1],g[0]),e.scale(1E3),g[0].sub(e),g[1].scale(2E3),1==c&&(g[0].sub(d),g[2].scale(2E3))}d=g}break;case 10:case 1073742325:if(d=this.atomExpressionAt(a+1),m=3,!c.isCenterParameter(++c.iToken)){h=!0;break}default:if(!b&&
h&&this.isFloatParameter(a+1)){d=this.floatParameter(++a);if(!this.isFloatParameter(a+1))return Integer.$valueOf(z(d));m=this.floatParameter(++a);d=D(-1,[Float.$valueOf(d),Float.$valueOf(m)]);m=1073742114;break}g=c.planeParameter(++a);m=this.isFloatParameter(c.iToken+1)?this.floatParameter(++c.iToken):NaN;Float.isNaN(m)||(g.w-=m);d=g;m=134217750}f=null==p?null:D(-1,[p,f]);return JU.TempArray.getSlabObjectType(m,d,!h,f)},"~N,~B");e(c$,"setColorOptions",function(a,b,c,d){var h=this.e;this.getToken(b);
var m="opaque";if(603979967==h.theTok)if(m="translucent",0>d){var g=this.isFloatParameter(b+1)?this.floatParameter(++b):3.4028235E38;h.setShapeTranslucency(c,null,"translucent",g,null);null!=a&&(a.append(" translucent"),3.4028235E38!=g&&a.append(" ").appendF(g))}else h.setMeshDisplayProperty(c,b,h.theTok);else 1073742074==h.theTok?0<=d&&h.setMeshDisplayProperty(c,b,h.theTok):h.iToken--;d=Math.abs(d);for(g=0;g<d;g++)if(h.isColorParam(h.iToken+1)){var e=h.getArgbParam(++h.iToken);this.setShapeProperty(c,
"colorRGB",Integer.$valueOf(e));null!=a&&a.append(" ").append(JU.Escape.escapeColor(e))}else if(h.iToken<b)this.invArg();else break;return m},"JU.SB,~N,~N,~N");e(c$,"createFunction",function(a,b,c){var d=(new JS.ScriptEval).setViewer(this.vwr);try{d.compileScript(null,"function "+a+"("+b+") { return "+c+"}",!1);var h=new JU.Lst;for(a=0;a<b.length;a+=2)h.addLast(JS.SV.newF(0).setName(b.substring(a,a+1)));return D(-1,[d.aatoken[0][1].value,h])}catch(m){if(S(m,Exception))return null;throw m;}},"~S,~S,~S");
e(c$,"getWithinDistanceVector",function(a,b,c,d,h){var m=new JU.Lst,g=Array(2);if(null==d){var e=JU.P3.new3(b,b,b),f=JU.P3.newP(c);f.sub(e);e.add(c);g[0]=f;g[1]=e;m.addLast(c)}else c=this.vwr.ms.getBoxInfo(d,-Math.abs(b)),g[0]=c.getBoundBoxVertices()[0],g[1]=c.getBoundBoxVertices()[7],1==d.cardinality()&&m.addLast(this.vwr.ms.at[d.nextSetBit(0)]);1==m.size()&&!h&&(this.addShapeProperty(a,"withinDistance",Float.$valueOf(b)),this.addShapeProperty(a,"withinPoint",m.get(0)));this.addShapeProperty(a,h?
"displayWithin":"withinPoints",D(-1,[Float.$valueOf(b),g,d,m]))},"JU.Lst,~N,JU.P3,JU.BS,~B");e(c$,"addShapeProperty",function(a,b,c){this.chk||a.addLast(D(-1,[b,c]))},"JU.Lst,~S,~O");e(c$,"floatArraySetXYZ",function(a,b,c,d){var h=this.e,m=this.tokAt(a++);1073742195==m&&(m=this.tokAt(a++));(268435520!=m||0>=b)&&this.invArg();for(var g=JU.AU.newFloat3(b,-1),e=0;268435521!=m;)switch(m=this.getToken(a).tok,m){case 1073742195:case 268435521:continue;case 268435504:a++;break;case 268435520:g[e++]=this.floatArraySet(a,
c,d);a=++h.iToken;m=0;e==b&&268435521!=this.tokAt(a)&&this.invArg();break;default:this.invArg()}return g},"~N,~N,~N,~N");e(c$,"floatArraySet",function(a,b,c){var d=this.tokAt(a++);1073742195==d&&(d=this.tokAt(a++));268435520!=d&&this.invArg();for(var h=JU.AU.newFloat2(b),m=0;268435521!=d;)switch(d=this.getToken(a).tok,d){case 1073742195:case 268435521:continue;case 268435504:a++;break;case 268435520:a++;d=x(c,0);h[m++]=d;for(var g=0;g<c;g++)d[g]=this.floatParameter(a++),268435504==this.tokAt(a)&&
a++;268435521!=this.tokAt(a++)&&this.invArg();d=0;m==b&&268435521!=this.tokAt(a)&&this.invArg();break;default:this.invArg()}return h},"~N,~N,~N");e(c$,"initIsosurface",function(a){var b=this.e;this.setShapeProperty(a,"init",b.fullCommand);b.iToken=0;var c=this.tokAt(1),d=this.tokAt(2);if(12291==c||12291==d&&1073742327==this.tokAt(++b.iToken))return this.setShapeProperty(a,"delete",null),b.iToken+=2,this.slen>b.iToken&&(this.setShapeProperty(a,"init",b.fullCommand),this.setShapeProperty(a,"thisID",
"+PREVIOUS_MESH+")),null;b.iToken=1;return!b.setMeshDisplayProperty(a,0,c)&&(this.setShapeProperty(a,"thisID","+PREVIOUS_MESH+"),22!=a&&this.setShapeProperty(a,"title",D(-1,[b.thisCommand])),1073741974!=c&&(268435633==d||268435633==c&&b.setMeshDisplayProperty(a,0,d)))?(a=this.setShapeId(a,1,!1),b.iToken++,a):null},"~N");e(c$,"listIsosurface",function(a){var b=3<this.slen?"0":0==this.tokAt(2)?"":" "+this.getToken(2).value;this.chk||this.showString(this.getShapeProperty(a,"list"+b));return!0},"~N");
e(c$,"getPlaneIntersection",function(a,b,c,d,h){var m=null;switch(a){case 1814695966:if(null==c)return null;m=c.getCanonicalCopy(d,!0);break;case 1678381065:m=this.vwr.ms.getBoxInfo().getMyCanonicalCopy(d)}a=this.vwr.getTriangulator();if(null!=b)return a.intersectPlane(b,m,h);b=new JU.Lst;b.addLast(m);b.addLast(JU.Triangulator.fullCubePolygon);return b},"~N,JU.P4,J.api.SymmetryInterface,~N,~N")});F("JU");L(["JU.TriangleData"],"JU.Triangulator",["JU.AU","$.BS","$.Lst","$.P3"],function(){c$=xa(JU,"Triangulator",
JU.TriangleData);e(c$,"intersectPlane",function(a,b,c){for(var d=new JU.Lst,h=Array(12),m=0,g=x(8,0),e=0;8>e;e++)g[e]=a.x*b[e].x+a.y*b[e].y+a.z*b[e].z+a.w,0>g[e]&&(m|=JU.TriangleData.Pwr2[e]);a=JU.TriangleData.triangleTable2[m];if(null==a)return null;for(e=0;24>e;e+=2){var m=JU.TriangleData.edgeVertexes[e],f=JU.TriangleData.edgeVertexes[e+1],p=JU.P3.newP(b[f]);p.sub(b[m]);p.scale(g[m]/(g[m]-g[f]));p.add(b[m]);h[e>>1]=p}if(0==c){c=new JU.BS;for(e=0;e<a.length;e++)c.set(a[e]),2==e%4&&e++;e=c.cardinality();
g=Array(e);d.addLast(g);b=u(12,0);for(e=m=0;e<a.length;e++)f=a[e],c.get(f)&&(c.clear(f),g[m]=h[f],b[f]=m++),2==e%4&&e++;h=JU.AU.newInt2(a.length>>2);d.addLast(h);for(e=0;e<a.length;e++)h[e>>2]=u(-1,[b[a[e++]],b[a[e++]],b[a[e++]],a[e]]);return d}for(e=0;e<a.length;e++)b=h[a[e++]],g=h[a[e++]],m=h[a[e++]],1==(c&1)&&d.addLast(D(-1,[b,g,m])),2==(c&2)&&(f=a[e],1==(f&1)&&d.addLast(D(-1,[b,g])),2==(f&2)&&d.addLast(D(-1,[g,m])),4==(f&4)&&d.addLast(D(-1,[b,m])));return d},"JU.P4,~A,~N");$(c$,"fullCubePolygon",
D(-1,[u(-1,[0,4,5,3]),u(-1,[5,1,0,3]),u(-1,[1,5,6,2]),u(-1,[6,2,1,3]),u(-1,[2,6,7,2]),u(-1,[7,3,2,3]),u(-1,[3,7,4,2]),u(-1,[4,0,3,2]),u(-1,[6,5,4,0]),u(-1,[4,7,6,0]),u(-1,[0,1,2,0]),u(-1,[2,3,0,0])]))});F("JU");L(["JU.P3i"],"JU.TriangleData",null,function(){c$=xa(JU,"TriangleData");$(c$,"Pwr2",u(-1,[1,2,4,8,16,32,64,128,256,512,1024,2048]));c$.cubeVertexOffsets=c$.prototype.cubeVertexOffsets=D(-1,[JU.P3i.new3(0,0,0),JU.P3i.new3(1,0,0),JU.P3i.new3(1,0,1),JU.P3i.new3(0,0,1),JU.P3i.new3(0,1,0),JU.P3i.new3(1,
1,0),JU.P3i.new3(1,1,1),JU.P3i.new3(0,1,1)]);$(c$,"edgeVertexes",f(-1,[0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),"triangleTable2",D(-1,[null,f(-1,[0,8,3,7]),f(-1,[0,1,9,7]),f(-1,[1,8,3,6,9,8,1,5]),f(-1,[1,2,10,7]),f(-1,[0,8,3,7,1,2,10,7]),f(-1,[9,2,10,6,0,2,9,5]),f(-1,[2,8,3,6,2,10,8,1,10,9,8,3]),f(-1,[3,11,2,7]),f(-1,[0,11,2,6,8,11,0,5]),f(-1,[1,9,0,7,2,3,11,7]),f(-1,[1,11,2,6,1,9,11,1,9,8,11,3]),f(-1,[3,10,1,6,11,10,3,5]),f(-1,[0,10,1,6,0,8,10,1,8,11,10,3]),f(-1,[3,9,0,6,3,11,9,1,11,10,
9,3]),f(-1,[9,8,10,5,10,8,11,6]),f(-1,[4,7,8,7]),f(-1,[4,3,0,6,7,3,4,5]),f(-1,[0,1,9,7,8,4,7,7]),f(-1,[4,1,9,6,4,7,1,1,7,3,1,3]),f(-1,[1,2,10,7,8,4,7,7]),f(-1,[3,4,7,6,3,0,4,3,1,2,10,7]),f(-1,[9,2,10,6,9,0,2,3,8,4,7,7]),f(-1,[2,10,9,3,2,9,7,0,2,7,3,6,7,9,4,6]),f(-1,[8,4,7,7,3,11,2,7]),f(-1,[11,4,7,6,11,2,4,1,2,0,4,3]),f(-1,[9,0,1,7,8,4,7,7,2,3,11,7]),f(-1,[4,7,11,3,9,4,11,1,9,11,2,2,9,2,1,6]),f(-1,[3,10,1,6,3,11,10,3,7,8,4,7]),f(-1,[1,11,10,6,1,4,11,0,1,0,4,3,7,11,4,5]),f(-1,[4,7,8,7,9,0,11,1,9,11,
10,6,11,0,3,6]),f(-1,[4,7,11,3,4,11,9,4,9,11,10,6]),f(-1,[9,5,4,7]),f(-1,[9,5,4,7,0,8,3,7]),f(-1,[0,5,4,6,1,5,0,5]),f(-1,[8,5,4,6,8,3,5,1,3,1,5,3]),f(-1,[1,2,10,7,9,5,4,7]),f(-1,[3,0,8,7,1,2,10,7,4,9,5,7]),f(-1,[5,2,10,6,5,4,2,1,4,0,2,3]),f(-1,[2,10,5,3,3,2,5,1,3,5,4,2,3,4,8,6]),f(-1,[9,5,4,7,2,3,11,7]),f(-1,[0,11,2,6,0,8,11,3,4,9,5,7]),f(-1,[0,5,4,6,0,1,5,3,2,3,11,7]),f(-1,[2,1,5,3,2,5,8,0,2,8,11,6,4,8,5,5]),f(-1,[10,3,11,6,10,1,3,3,9,5,4,7]),f(-1,[4,9,5,7,0,8,1,5,8,10,1,2,8,11,10,3]),f(-1,[5,4,
0,3,5,0,11,0,5,11,10,6,11,0,3,6]),f(-1,[5,4,8,3,5,8,10,4,10,8,11,6]),f(-1,[9,7,8,6,5,7,9,5]),f(-1,[9,3,0,6,9,5,3,1,5,7,3,3]),f(-1,[0,7,8,6,0,1,7,1,1,5,7,3]),f(-1,[1,5,3,5,3,5,7,6]),f(-1,[9,7,8,6,9,5,7,3,10,1,2,7]),f(-1,[10,1,2,7,9,5,0,5,5,3,0,2,5,7,3,3]),f(-1,[8,0,2,3,8,2,5,0,8,5,7,6,10,5,2,5]),f(-1,[2,10,5,3,2,5,3,4,3,5,7,6]),f(-1,[7,9,5,6,7,8,9,3,3,11,2,7]),f(-1,[9,5,7,3,9,7,2,0,9,2,0,6,2,7,11,6]),f(-1,[2,3,11,7,0,1,8,5,1,7,8,2,1,5,7,3]),f(-1,[11,2,1,3,11,1,7,4,7,1,5,6]),f(-1,[9,5,8,5,8,5,7,6,10,
1,3,3,10,3,11,6]),f(-1,[5,7,0,1,5,0,9,6,7,11,0,1,1,0,10,5,11,10,0,1]),f(-1,[11,10,0,1,11,0,3,6,10,5,0,1,8,0,7,5,5,7,0,1]),f(-1,[11,10,5,3,7,11,5,5]),f(-1,[10,6,5,7]),f(-1,[0,8,3,7,5,10,6,7]),f(-1,[9,0,1,7,5,10,6,7]),f(-1,[1,8,3,6,1,9,8,3,5,10,6,7]),f(-1,[1,6,5,6,2,6,1,5]),f(-1,[1,6,5,6,1,2,6,3,3,0,8,7]),f(-1,[9,6,5,6,9,0,6,1,0,2,6,3]),f(-1,[5,9,8,3,5,8,2,0,5,2,6,6,3,2,8,5]),f(-1,[2,3,11,7,10,6,5,7]),f(-1,[11,0,8,6,11,2,0,3,10,6,5,7]),f(-1,[0,1,9,7,2,3,11,7,5,10,6,7]),f(-1,[5,10,6,7,1,9,2,5,9,11,2,
2,9,8,11,3]),f(-1,[6,3,11,6,6,5,3,1,5,1,3,3]),f(-1,[0,8,11,3,0,11,5,0,0,5,1,6,5,11,6,6]),f(-1,[3,11,6,3,0,3,6,1,0,6,5,2,0,5,9,6]),f(-1,[6,5,9,3,6,9,11,4,11,9,8,6]),f(-1,[5,10,6,7,4,7,8,7]),f(-1,[4,3,0,6,4,7,3,3,6,5,10,7]),f(-1,[1,9,0,7,5,10,6,7,8,4,7,7]),f(-1,[10,6,5,7,1,9,7,1,1,7,3,6,7,9,4,6]),f(-1,[6,1,2,6,6,5,1,3,4,7,8,7]),f(-1,[1,2,5,5,5,2,6,6,3,0,4,3,3,4,7,6]),f(-1,[8,4,7,7,9,0,5,5,0,6,5,2,0,2,6,3]),f(-1,[7,3,9,1,7,9,4,6,3,2,9,1,5,9,6,5,2,6,9,1]),f(-1,[3,11,2,7,7,8,4,7,10,6,5,7]),f(-1,[5,10,
6,7,4,7,2,1,4,2,0,6,2,7,11,6]),f(-1,[0,1,9,7,4,7,8,7,2,3,11,7,5,10,6,7]),f(-1,[9,2,1,6,9,11,2,2,9,4,11,1,7,11,4,5,5,10,6,7]),f(-1,[8,4,7,7,3,11,5,1,3,5,1,6,5,11,6,6]),f(-1,[5,1,11,1,5,11,6,6,1,0,11,1,7,11,4,5,0,4,11,1]),f(-1,[0,5,9,6,0,6,5,2,0,3,6,1,11,6,3,5,8,4,7,7]),f(-1,[6,5,9,3,6,9,11,4,4,7,9,5,7,11,9,1]),f(-1,[10,4,9,6,6,4,10,5]),f(-1,[4,10,6,6,4,9,10,3,0,8,3,7]),f(-1,[10,0,1,6,10,6,0,1,6,4,0,3]),f(-1,[8,3,1,3,8,1,6,0,8,6,4,6,6,1,10,6]),f(-1,[1,4,9,6,1,2,4,1,2,6,4,3]),f(-1,[3,0,8,7,1,2,9,5,2,
4,9,2,2,6,4,3]),f(-1,[0,2,4,5,4,2,6,6]),f(-1,[8,3,2,3,8,2,4,4,4,2,6,6]),f(-1,[10,4,9,6,10,6,4,3,11,2,3,7]),f(-1,[0,8,2,5,2,8,11,6,4,9,10,3,4,10,6,6]),f(-1,[3,11,2,7,0,1,6,1,0,6,4,6,6,1,10,6]),f(-1,[6,4,1,1,6,1,10,6,4,8,1,1,2,1,11,5,8,11,1,1]),f(-1,[9,6,4,6,9,3,6,0,9,1,3,3,11,6,3,5]),f(-1,[8,11,1,1,8,1,0,6,11,6,1,1,9,1,4,5,6,4,1,1]),f(-1,[3,11,6,3,3,6,0,4,0,6,4,6]),f(-1,[6,4,8,3,11,6,8,5]),f(-1,[7,10,6,6,7,8,10,1,8,9,10,3]),f(-1,[0,7,3,6,0,10,7,0,0,9,10,3,6,7,10,5]),f(-1,[10,6,7,3,1,10,7,1,1,7,8,2,
1,8,0,6]),f(-1,[10,6,7,3,10,7,1,4,1,7,3,6]),f(-1,[1,2,6,3,1,6,8,0,1,8,9,6,8,6,7,6]),f(-1,[2,6,9,1,2,9,1,6,6,7,9,1,0,9,3,5,7,3,9,1]),f(-1,[7,8,0,3,7,0,6,4,6,0,2,6]),f(-1,[7,3,2,3,6,7,2,5]),f(-1,[2,3,11,7,10,6,8,1,10,8,9,6,8,6,7,6]),f(-1,[2,0,7,1,2,7,11,6,0,9,7,1,6,7,10,5,9,10,7,1]),f(-1,[1,8,0,6,1,7,8,2,1,10,7,1,6,7,10,5,2,3,11,7]),f(-1,[11,2,1,3,11,1,7,4,10,6,1,5,6,7,1,1]),f(-1,[8,9,6,1,8,6,7,6,9,1,6,1,11,6,3,5,1,3,6,1]),f(-1,[0,9,1,7,11,6,7,7]),f(-1,[7,8,0,3,7,0,6,4,3,11,0,5,11,6,0,1]),f(-1,[7,11,
6,7]),f(-1,[7,6,11,7]),f(-1,[3,0,8,7,11,7,6,7]),f(-1,[0,1,9,7,11,7,6,7]),f(-1,[8,1,9,6,8,3,1,3,11,7,6,7]),f(-1,[10,1,2,7,6,11,7,7]),f(-1,[1,2,10,7,3,0,8,7,6,11,7,7]),f(-1,[2,9,0,6,2,10,9,3,6,11,7,7]),f(-1,[6,11,7,7,2,10,3,5,10,8,3,2,10,9,8,3]),f(-1,[7,2,3,6,6,2,7,5]),f(-1,[7,0,8,6,7,6,0,1,6,2,0,3]),f(-1,[2,7,6,6,2,3,7,3,0,1,9,7]),f(-1,[1,6,2,6,1,8,6,0,1,9,8,3,8,7,6,3]),f(-1,[10,7,6,6,10,1,7,1,1,3,7,3]),f(-1,[10,7,6,6,1,7,10,4,1,8,7,2,1,0,8,3]),f(-1,[0,3,7,3,0,7,10,0,0,10,9,6,6,10,7,5]),f(-1,[7,6,
10,3,7,10,8,4,8,10,9,6]),f(-1,[6,8,4,6,11,8,6,5]),f(-1,[3,6,11,6,3,0,6,1,0,4,6,3]),f(-1,[8,6,11,6,8,4,6,3,9,0,1,7]),f(-1,[9,4,6,3,9,6,3,0,9,3,1,6,11,3,6,5]),f(-1,[6,8,4,6,6,11,8,3,2,10,1,7]),f(-1,[1,2,10,7,3,0,11,5,0,6,11,2,0,4,6,3]),f(-1,[4,11,8,6,4,6,11,3,0,2,9,5,2,10,9,3]),f(-1,[10,9,3,1,10,3,2,6,9,4,3,1,11,3,6,5,4,6,3,1]),f(-1,[8,2,3,6,8,4,2,1,4,6,2,3]),f(-1,[0,4,2,5,4,6,2,3]),f(-1,[1,9,0,7,2,3,4,1,2,4,6,6,4,3,8,6]),f(-1,[1,9,4,3,1,4,2,4,2,4,6,6]),f(-1,[8,1,3,6,8,6,1,0,8,4,6,3,6,10,1,3]),f(-1,
[10,1,0,3,10,0,6,4,6,0,4,6]),f(-1,[4,6,3,1,4,3,8,6,6,10,3,1,0,3,9,5,10,9,3,1]),f(-1,[10,9,4,3,6,10,4,5]),f(-1,[4,9,5,7,7,6,11,7]),f(-1,[0,8,3,7,4,9,5,7,11,7,6,7]),f(-1,[5,0,1,6,5,4,0,3,7,6,11,7]),f(-1,[11,7,6,7,8,3,4,5,3,5,4,2,3,1,5,3]),f(-1,[9,5,4,7,10,1,2,7,7,6,11,7]),f(-1,[6,11,7,7,1,2,10,7,0,8,3,7,4,9,5,7]),f(-1,[7,6,11,7,5,4,10,5,4,2,10,2,4,0,2,3]),f(-1,[3,4,8,6,3,5,4,2,3,2,5,1,10,5,2,5,11,7,6,7]),f(-1,[7,2,3,6,7,6,2,3,5,4,9,7]),f(-1,[9,5,4,7,0,8,6,1,0,6,2,6,6,8,7,6]),f(-1,[3,6,2,6,3,7,6,3,1,
5,0,5,5,4,0,3]),f(-1,[6,2,8,1,6,8,7,6,2,1,8,1,4,8,5,5,1,5,8,1]),f(-1,[9,5,4,7,10,1,6,5,1,7,6,2,1,3,7,3]),f(-1,[1,6,10,6,1,7,6,2,1,0,7,1,8,7,0,5,9,5,4,7]),f(-1,[4,0,10,1,4,10,5,6,0,3,10,1,6,10,7,5,3,7,10,1]),f(-1,[7,6,10,3,7,10,8,4,5,4,10,5,4,8,10,1]),f(-1,[6,9,5,6,6,11,9,1,11,8,9,3]),f(-1,[3,6,11,6,0,6,3,4,0,5,6,2,0,9,5,3]),f(-1,[0,11,8,6,0,5,11,0,0,1,5,3,5,6,11,3]),f(-1,[6,11,3,3,6,3,5,4,5,3,1,6]),f(-1,[1,2,10,7,9,5,11,1,9,11,8,6,11,5,6,6]),f(-1,[0,11,3,6,0,6,11,2,0,9,6,1,5,6,9,5,1,2,10,7]),f(-1,
[11,8,5,1,11,5,6,6,8,0,5,1,10,5,2,5,0,2,5,1]),f(-1,[6,11,3,3,6,3,5,4,2,10,3,5,10,5,3,1]),f(-1,[5,8,9,6,5,2,8,0,5,6,2,3,3,8,2,5]),f(-1,[9,5,6,3,9,6,0,4,0,6,2,6]),f(-1,[1,5,8,1,1,8,0,6,5,6,8,1,3,8,2,5,6,2,8,1]),f(-1,[1,5,6,3,2,1,6,5]),f(-1,[1,3,6,1,1,6,10,6,3,8,6,1,5,6,9,5,8,9,6,1]),f(-1,[10,1,0,3,10,0,6,4,9,5,0,5,5,6,0,1]),f(-1,[0,3,8,7,5,6,10,7]),f(-1,[10,5,6,7]),f(-1,[11,5,10,6,7,5,11,5]),f(-1,[11,5,10,6,11,7,5,3,8,3,0,7]),f(-1,[5,11,7,6,5,10,11,3,1,9,0,7]),f(-1,[10,7,5,6,10,11,7,3,9,8,1,5,8,3,1,
3]),f(-1,[11,1,2,6,11,7,1,1,7,5,1,3]),f(-1,[0,8,3,7,1,2,7,1,1,7,5,6,7,2,11,6]),f(-1,[9,7,5,6,9,2,7,0,9,0,2,3,2,11,7,3]),f(-1,[7,5,2,1,7,2,11,6,5,9,2,1,3,2,8,5,9,8,2,1]),f(-1,[2,5,10,6,2,3,5,1,3,7,5,3]),f(-1,[8,2,0,6,8,5,2,0,8,7,5,3,10,2,5,5]),f(-1,[9,0,1,7,5,10,3,1,5,3,7,6,3,10,2,6]),f(-1,[9,8,2,1,9,2,1,6,8,7,2,1,10,2,5,5,7,5,2,1]),f(-1,[1,3,5,5,3,7,5,3]),f(-1,[0,8,7,3,0,7,1,4,1,7,5,6]),f(-1,[9,0,3,3,9,3,5,4,5,3,7,6]),f(-1,[9,8,7,3,5,9,7,5]),f(-1,[5,8,4,6,5,10,8,1,10,11,8,3]),f(-1,[5,0,4,6,5,11,0,
0,5,10,11,3,11,3,0,3]),f(-1,[0,1,9,7,8,4,10,1,8,10,11,6,10,4,5,6]),f(-1,[10,11,4,1,10,4,5,6,11,3,4,1,9,4,1,5,3,1,4,1]),f(-1,[2,5,1,6,2,8,5,0,2,11,8,3,4,5,8,5]),f(-1,[0,4,11,1,0,11,3,6,4,5,11,1,2,11,1,5,5,1,11,1]),f(-1,[0,2,5,1,0,5,9,6,2,11,5,1,4,5,8,5,11,8,5,1]),f(-1,[9,4,5,7,2,11,3,7]),f(-1,[2,5,10,6,3,5,2,4,3,4,5,2,3,8,4,3]),f(-1,[5,10,2,3,5,2,4,4,4,2,0,6]),f(-1,[3,10,2,6,3,5,10,2,3,8,5,1,4,5,8,5,0,1,9,7]),f(-1,[5,10,2,3,5,2,4,4,1,9,2,5,9,4,2,1]),f(-1,[8,4,5,3,8,5,3,4,3,5,1,6]),f(-1,[0,4,5,3,1,
0,5,5]),f(-1,[8,4,5,3,8,5,3,4,9,0,5,5,0,3,5,1]),f(-1,[9,4,5,7]),f(-1,[4,11,7,6,4,9,11,1,9,10,11,3]),f(-1,[0,8,3,7,4,9,7,5,9,11,7,2,9,10,11,3]),f(-1,[1,10,11,3,1,11,4,0,1,4,0,6,7,4,11,5]),f(-1,[3,1,4,1,3,4,8,6,1,10,4,1,7,4,11,5,10,11,4,1]),f(-1,[4,11,7,6,9,11,4,4,9,2,11,2,9,1,2,3]),f(-1,[9,7,4,6,9,11,7,2,9,1,11,1,2,11,1,5,0,8,3,7]),f(-1,[11,7,4,3,11,4,2,4,2,4,0,6]),f(-1,[11,7,4,3,11,4,2,4,8,3,4,5,3,2,4,1]),f(-1,[2,9,10,6,2,7,9,0,2,3,7,3,7,4,9,3]),f(-1,[9,10,7,1,9,7,4,6,10,2,7,1,8,7,0,5,2,0,7,1]),f(-1,
[3,7,10,1,3,10,2,6,7,4,10,1,1,10,0,5,4,0,10,1]),f(-1,[1,10,2,7,8,7,4,7]),f(-1,[4,9,1,3,4,1,7,4,7,1,3,6]),f(-1,[4,9,1,3,4,1,7,4,0,8,1,5,8,7,1,1]),f(-1,[4,0,3,3,7,4,3,5]),f(-1,[4,8,7,7]),f(-1,[9,10,8,5,10,11,8,3]),f(-1,[3,0,9,3,3,9,11,4,11,9,10,6]),f(-1,[0,1,10,3,0,10,8,4,8,10,11,6]),f(-1,[3,1,10,3,11,3,10,5]),f(-1,[1,2,11,3,1,11,9,4,9,11,8,6]),f(-1,[3,0,9,3,3,9,11,4,1,2,9,5,2,11,9,1]),f(-1,[0,2,11,3,8,0,11,5]),f(-1,[3,2,11,7]),f(-1,[2,3,8,3,2,8,10,4,10,8,9,6]),f(-1,[9,10,2,3,0,9,2,5]),f(-1,[2,3,8,
3,2,8,10,4,0,1,8,5,1,10,8,1]),f(-1,[1,10,2,7]),f(-1,[1,3,8,3,9,1,8,5]),f(-1,[0,9,1,7]),f(-1,[0,3,8,7]),null]))});F("J.jvxl.api");Ha(J.jvxl.api,"VertexDataServer");F("J.jvxl.api");L(["J.jvxl.api.VertexDataServer"],"J.jvxl.api.MeshDataServer",null,function(){Ha(J.jvxl.api,"MeshDataServer",J.jvxl.api.VertexDataServer)});F("J.shapesurface");L(["J.jvxl.api.MeshDataServer","J.shape.MeshCollection","JU.P3i","$.P4"],"J.shapesurface.Isosurface","java.io.BufferedReader java.lang.Boolean $.Float java.util.Hashtable JU.A4 $.AU $.BS $.CU $.Lst $.M3 $.M4 $.P3 $.PT $.Quat $.Rdr $.SB $.V3 J.jvxl.data.JvxlCoder $.JvxlData $.MeshData J.jvxl.readers.SurfaceGenerator J.shape.Mesh J.shapesurface.IsosurfaceMesh JU.C $.Escape $.Logger $.TempArray JV.JC $.Viewer".split(" "),
function(){c$=M(function(){this.actualID=this.thisMesh=this.isomeshes=null;this.explicitContours=this.iHaveBitSets=!1;this.moNumber=this.atomIndex=0;this.moLinearCombination=null;this.meshColix=this.defaultColix=this.colorType=0;this.center=null;this.scale3d=0;this.isColorExplicit=this.isPhaseColored=!1;this.scriptAppendix="";this.jvxlData=this.sg=null;this.withinDistance2=0;this.isWithinNot=!1;this.cutoffRange=this.withinPoints=null;this.allowMesh=!0;this.script=null;this.iHaveModelIndex=!1;this.nLCAO=
0;this.lcaoDir=null;this.associateNormals=!1;this.keyXy=this.ptXY=null;N(this,arguments)},J.shapesurface,"Isosurface",J.shape.MeshCollection,J.jvxl.api.MeshDataServer);Z(c$,function(){this.isomeshes=Array(4);this.lcaoDir=new JU.P4;this.ptXY=new JU.P3i});n(c$,"allocMesh",function(a,b){var c=this.meshCount++;this.meshes=this.isomeshes=JU.AU.ensureLength(this.isomeshes,2*this.meshCount);this.currentMesh=this.thisMesh=this.isomeshes[c]=null==b?new J.shapesurface.IsosurfaceMesh(this.vwr,a,this.colix,c):
b;this.currentMesh.index=c;null!=this.sg&&this.sg.setJvxlData(this.jvxlData=this.thisMesh.jvxlData)},"~S,J.shape.Mesh");e(c$,"initShape",function(){cb(this,J.shapesurface.Isosurface,"initShape",[]);this.myType="isosurface";this.newSg()});e(c$,"newSg",function(){this.sg=new J.jvxl.readers.SurfaceGenerator(this.vwr,this,null,this.jvxlData=new J.jvxl.data.JvxlData);this.sg.params.showTiming=this.vwr.getBoolean(603979934);this.sg.version="Jmol "+JV.Viewer.getJmolVersion()});e(c$,"clearSg",function(){this.sg=
null});n(c$,"setProperty",function(a,b,c){this.setPropI(a,b,c)},"~S,~O,JU.BS");e(c$,"setPropI",function(a,b,c){if("cache"===a){if(null!=this.currentMesh){var d=this.currentMesh.thisID;c=this.currentMesh.modelIndex;this.vwr.cachePut("cache://isosurface_"+d,this.getPropI("jvxlDataXml",-1));this.deleteMeshI(this.currentMesh.index);this.setPropI("init",null,null);this.setPropI("thisID",d,null);this.setPropI("modelIndex",Integer.$valueOf(c),null);this.setPropI("fileName","cache://isosurface_"+d,null);
this.setPropI("readFile",null,null);this.setPropI("finalize","isosurface ID "+JU.PT.esc(d)+(0<=c?" modelIndex "+c:"")+" /*file*/"+JU.PT.esc("cache://isosurface_"+d),null);this.setPropI("clear",null,null)}}else if("delete"===a)this.setPropertySuper(a,b,c),this.explicitID||(this.nLCAO=this.nUnnamed=0),this.currentMesh=this.thisMesh=null;else if("remapInherited"===a)for(d=this.meshCount;0<=--d;)null!=this.isomeshes[d]&&"#inherit;".equals(this.isomeshes[d].colorCommand)&&this.isomeshes[d].remapColors(this.vwr,
null,NaN);else if("remapColor"===a)null!=this.thisMesh&&this.thisMesh.remapColors(this.vwr,b,this.translucentLevel);else if("thisID"===a)null!=this.actualID&&(b=this.actualID),this.setPropertySuper("thisID",b,null);else if("params"===a){if(null!=this.thisMesh){this.ensureMeshSource();this.thisMesh.checkAllocColixes();a=b[0];var h=null;if(null!=a){for(d=0;d<a.length;d++)a[d]=a[d];h=u(c.length(),0);b=0;for(d=c.nextSetBit(0);0<=d;d=c.nextSetBit(d+1),b++)h[d]=b}this.thisMesh.setVertexColixesForAtoms(this.vwr,
a,h,c);this.thisMesh.setVertexColorMap()}}else if("atomcolor"===a)null!=this.thisMesh&&(this.ensureMeshSource(),this.thisMesh.colorVertices(JU.C.getColixO(b),c,!0));else if("pointSize"===a)null!=this.thisMesh&&(this.thisMesh.volumeRenderPointSize=b.floatValue());else if("vertexcolor"===a)null!=this.thisMesh&&this.thisMesh.colorVertices(JU.C.getColixO(b),c,!1);else if("colorPhase"===a){d=b;c=JU.C.getColix(d[0].intValue());b=JU.C.getColix(d[1].intValue());d=null!=this.thisMesh?this.thisMesh.thisID:
JU.PT.isWild(this.previousMeshID)?this.previousMeshID:null;h=this.getMeshList(d,!1);for(d=h.size();0<=--d;)this.setColorPhase(h.get(d),c,b)}else if("color"===a){var m=JU.C.getHexCode(JU.C.getColixO(b));if(null!=this.thisMesh)this.setIsoMeshColor(this.thisMesh,m);else{h=this.getMeshList(JU.PT.isWild(this.previousMeshID)?this.previousMeshID:null,!1);for(d=h.size();0<=--d;)this.setIsoMeshColor(h.get(d),m)}this.setPropertySuper(a,b,c)}else if("nocontour"===a)null!=this.thisMesh&&this.thisMesh.deleteContours();
else if("fixed"===a)this.isFixed=b.booleanValue(),this.setMeshI();else if("newObject"===a)null!=this.thisMesh&&this.thisMesh.clearType(this.thisMesh.meshType,!1);else if("moveIsosurface"===a)null!=this.thisMesh&&!this.thisMesh.isModelConnected&&(this.thisMesh.updateCoordinates(b,null),this.thisMesh.altVertices=null);else if("refreshTrajectories"===a){c=b[0].intValue();for(d=this.meshCount;0<=--d;)this.meshes[d].modelIndex==c&&(null!=this.meshes[d].connectedAtoms||this.meshes[d].isModelConnected)&&
this.meshes[d].updateCoordinates(b[2],b[1])}else if("modelIndex"===a)this.iHaveModelIndex||(this.modelIndex=b.intValue(),this.isFixed=0>this.modelIndex,this.sg.params.modelIndex=Math.abs(this.modelIndex));else if("lcaoCartoon"===a||"lonePair"===a||"radical"===a)d=b,this.explicitID||this.setPropertySuper("thisID",null,null),this.sg.setProp("lcaoCartoonCenter",d[2],null)||this.drawLcaoCartoon(d[0],d[1],d[3],"lonePair"===a?2:"radical"===a?1:0);else if(!("select"===a&&this.iHaveBitSets||"ignore"===a&&
this.iHaveBitSets))if("meshcolor"===a)d=b.intValue(),this.meshColix=JU.C.getColix(d),null!=this.thisMesh&&(this.thisMesh.meshColix=this.meshColix);else if("offset"===a)d=JU.P3.newP(b),d.equals(JV.JC.center)&&(d=null),null!=this.thisMesh&&(this.thisMesh.rotateTranslate(null,d,!0),this.thisMesh.altVertices=null);else if("rotate"===a)null!=this.thisMesh&&(this.thisMesh.rotateTranslate(JU.Quat.newP4(b),null,!0),this.thisMesh.altVertices=null);else if("bsDisplay"===a)this.bsDisplay=b;else if("displayWithin"===
a)d=b,this.displayWithinDistance2=d[0].floatValue(),this.isDisplayWithinNot=0>this.displayWithinDistance2,this.displayWithinDistance2*=this.displayWithinDistance2,this.displayWithinPoints=d[3],0==this.displayWithinPoints.size()&&(this.displayWithinPoints=this.vwr.ms.getAtomPointVector(d[2]));else if("finalize"===a)null!=this.thisMesh&&(d=b,null!=d&&!d.startsWith("; isosurface map")&&(this.thisMesh.setDiscreteColixes(this.sg.params.contoursDiscrete,this.sg.params.contourColixes),this.setJvxlInfo()),
this.setScriptInfo(d)),this.clearSg();else if("connections"===a)null!=this.currentMesh&&(this.connections=b,0<=this.connections[0]&&this.connections[0]<this.vwr.ms.ac?this.currentMesh.connectedAtoms=this.connections:this.connections=this.currentMesh.connectedAtoms=null);else if("cutoffRange"===a)this.cutoffRange=b;else if("fixLattice"===a)null!=this.thisMesh&&this.thisMesh.fixLattice();else{if("slab"===a){if(U(b,Integer)){null!=this.thisMesh&&(this.thisMesh.jvxlData.slabValue=b.intValue());return}if(null!=
this.thisMesh){switch(b[0].intValue()){case 1073742018:d=b[1];c=this.getMesh(d[1]);if(null==c)return;d[1]=c}this.slabPolygons(b);return}}if("cap"===a&&null!=this.thisMesh&&0!=this.thisMesh.pc)this.thisMesh.getMeshSlicer().slabPolygons(b,!0),this.thisMesh.initialize(this.thisMesh.lighting,null,null);else{if("map"===a&&(null!=this.sg&&(this.sg.params.isMapped=!0),this.setProperty("squareData",Boolean.FALSE,null),null==this.thisMesh||0==this.thisMesh.vc))return;if("deleteVdw"===a){for(d=this.meshCount;0<=
--d;)null!=this.isomeshes[d].bsVdw&&(null==c||c.intersects(this.isomeshes[d].bsVdw))&&this.deleteMeshI(d);this.currentMesh=this.thisMesh=null}else{if("mapColor"===a||"readFile"===a){if(null==b){b=this.vwr.fm.getBufferedReaderOrErrorMessageFromName(this.sg.params.fileName,null,!0,!0);if(U(b,String)){JU.Logger.error("Isosurface: could not open file "+this.sg.params.fileName+" -- "+b);return}if(!U(b,java.io.BufferedReader))try{b=JU.Rdr.getBufferedReader(b,"ISO-8859-1")}catch(g){if(!S(g,java.io.IOException))throw g;
}}}else if("atomIndex"===a)this.atomIndex=b.intValue(),null!=this.thisMesh&&(this.thisMesh.atomIndex=this.atomIndex);else if("center"===a)this.center.setT(b);else if("colorRGB"===a)d=b.intValue(),1296041986==d?this.colorType=d:(this.colorType=0,this.defaultColix=JU.C.getColix(d));else if("contour"===a)this.explicitContours=!0;else if("functionXY"===a)2==this.sg.params.state&&this.setScriptInfo(null);else if("init"===a)this.newSg();else if("getSurfaceSets"===a)null!=this.thisMesh&&(this.thisMesh.jvxlData.thisSet=
b.intValue(),this.thisMesh.calculatedVolume=null,this.thisMesh.calculatedArea=null);else if("localName"===a)b=this.vwr.getOutputChannel(b,null),a="outputChannel";else if("molecularOrbital"===a){if(this.isFixed=!1,this.setMeshI(),U(b,Integer)?(this.moNumber=b.intValue(),this.moLinearCombination=null):(this.moLinearCombination=b,this.moNumber=0),this.isColorExplicit||(this.isPhaseColored=!0),null==this.sg||!this.sg.params.isMapped)d=this.ms.am[this.currentMesh.modelIndex].mat4,null!=d&&(d=JU.M4.newM4(d),
d.invert(),this.setPropI("modelInvRotation",d,null))}else if("phase"===a)this.isPhaseColored=!0;else if("plane"!==a&&"pocket"!==a)if("scale3d"===a)this.scale3d=b.floatValue(),null!=this.thisMesh&&(this.thisMesh.scale3d=this.thisMesh.jvxlData.scale3d=this.scale3d,this.thisMesh.altVertices=null);else if("title"===a)U(b,String)&&"-".equals(b)&&(b=null),this.setPropertySuper(a,b,c),b=this.title;else if("withinPoints"===a)d=b,this.withinDistance2=d[0].floatValue(),this.isWithinNot=0>this.withinDistance2,
this.withinDistance2*=this.withinDistance2,this.withinPoints=d[3],0==this.withinPoints.size()&&(this.withinPoints=this.vwr.ms.getAtomPointVector(d[2]));else if(("nci"===a||"orbital"===a)&&null!=this.sg)this.sg.params.testFlags=this.vwr.getBoolean(603979962)?2:0;if(null!=this.sg&&this.sg.setProp(a,b,c)){if(this.sg.isValid){"molecularOrbital"===a&&(this.currentMesh.isModelConnected=!0,this.currentMesh.mat4=this.ms.am[this.currentMesh.modelIndex].mat4);return}a="delete"}if("init"===a)this.explicitID=
!1,this.scriptAppendix="",d=U(b,String)?b:null,b=null==d?-1:d.indexOf("# ID="),this.actualID=0<=b?JU.PT.getQuotedStringAt(d,b):null,this.setPropertySuper("thisID","+PREVIOUS_MESH+",null),null!=d&&!(this.iHaveBitSets=this.getScriptBitSets(d,null))&&this.sg.setProp("select",c,null),this.initializeIsosurface(),this.sg.params.modelIndex=this.isFixed?-1:this.modelIndex;else if("clear"===a)this.discardTempData(!0);else if("colorDensity"===a)null!=b&&null!=this.currentMesh&&(this.currentMesh.volumeRenderPointSize=
b.floatValue());else if("deleteModelAtoms"===a){a=b[2][0];h=b[2][1];b=b[2][2];for(d=this.meshCount;0<=--d;)c=this.meshes[d],null!=c&&(null!=c.connectedAtoms&&(m=c.connectedAtoms[0],m>=h+b?c.connectedAtoms[0]=m-b:m>=h&&(c.connectedAtoms=null)),c.connectedAtoms=null,c.modelIndex==a?(this.meshCount--,c===this.currentMesh&&(this.currentMesh=this.thisMesh=null),this.meshes=this.isomeshes=JU.AU.deleteElements(this.meshes,d,1)):c.modelIndex>a&&(c.modelIndex--,c.atomIndex>=h&&(c.atomIndex-=b)))}else this.setPropertySuper(a,
b,c)}}}},"~S,~O,JU.BS");e(c$,"setIsoMeshColor",function(a,b){a.jvxlData.baseColor=b;a.isColorSolid=!0;a.pcs=null;a.colorsExplicit=!1;a.colorEncoder=null;a.vertexColorMap=null},"J.shapesurface.IsosurfaceMesh,~S");e(c$,"setColorPhase",function(a,b,c){a.colorPhased=!0;a.colix=a.jvxlData.minColorIndex=b;a.jvxlData.maxColorIndex=c;a.jvxlData.isBicolorMap=!0;a.jvxlData.colorDensity=!1;a.isColorSolid=!1;a.remapColors(this.vwr,null,this.translucentLevel)},"J.shapesurface.IsosurfaceMesh,~N,~N");e(c$,"ensureMeshSource",
function(){var a=null!=this.thisMesh.vertexSource;if(a)for(var b=this.thisMesh.vc;0<=--b;)if(0>this.thisMesh.vertexSource[b]){a=!1;break}if(!a){var a=this.thisMesh.vertexSource,c=this.thisMesh.vcs,b=this.thisMesh.isColorSolid?this.thisMesh.colix:0;this.setProperty("init",null,null);this.setProperty("map",Boolean.FALSE,null);this.setProperty("property",x(this.vwr.ms.ac,0),null);0!=b&&(this.thisMesh.colorCommand="color isosurface "+JU.C.getHexCode(b),this.setProperty("color",Integer.$valueOf(JU.C.getArgb(b)),
null));if(null!=a){for(b=this.thisMesh.vc;0<=--b;)0>a[b]&&(a[b]=this.thisMesh.vertexSource[b]);this.thisMesh.vertexSource=a;this.thisMesh.vcs=c}}});e(c$,"slabPolygons",function(a){this.thisMesh.calculatedVolume=null;this.thisMesh.calculatedArea=null;this.thisMesh.getMeshSlicer().slabPolygons(a,!1);this.thisMesh.reinitializeLightingAndColor(this.vwr)},"~A");e(c$,"setPropertySuper",function(a,b,c){"thisID"===a&&null!=this.currentMesh&&null!=this.currentMesh.thisID&&this.currentMesh.thisID.equals(b)?
this.checkExplicit(b):(this.currentMesh=this.thisMesh,this.setPropMC(a,b,c),this.thisMesh=this.currentMesh,this.jvxlData=null==this.thisMesh?null:this.thisMesh.jvxlData,null!=this.sg&&this.sg.setJvxlData(this.jvxlData))},"~S,~O,JU.BS");n(c$,"getPropertyData",function(a,b){if("keys"===a){var c=U(b[1],JU.Lst)?b[1]:new JU.Lst;b[1]=c;c.addLast("info");c.addLast("data");c.addLast("atoms")}if("colorEncoder"===a)return c=this.getMesh(b[0]),null!=c&&null!=(b[1]=c.colorEncoder);if("intersectPlane"===a){c=
this.getMesh(b[0]);if(null==c||4>b.length)return!1;b[3]=Integer.$valueOf(c.modelIndex);c.getMeshSlicer().getIntersection(0,b[1],null,b[2],null,null,null,!1,!1,134217750,!1);return!0}if("getBoundingBox"===a){c=b[0];c=this.getMesh(c);if(null==c||null==c.vs)return!1;b[2]=c.jvxlData.boundingBox;if(null!=c.mat4){var d=Array(2);d[0]=JU.P3.newP(c.jvxlData.boundingBox[0]);d[1]=JU.P3.newP(c.jvxlData.boundingBox[1]);var h=new JU.V3;c.mat4.getTranslation(h);d[0].add(h);d[1].add(h);b[2]=d}return!0}if("unitCell"===
a)return c=this.getMesh(b[0]),null!=c&&null!=(b[1]=c.getUnitCell());if("getCenter"===a&&-2147483648==b[1].intValue()){c=b[0];c=this.getMesh(c);if(null==c||null==c.vs)return!1;d=JU.P3.newP(c.jvxlData.boundingBox[0]);d.add(c.jvxlData.boundingBox[1]);d.scale(0.5);null!=c.mat4&&(h=new JU.V3,c.mat4.getTranslation(h),d.add(h));b[2]=d;return!0}return this.getPropDataMC(a,b)},"~S,~A");n(c$,"getProperty",function(a,b){return this.getPropI(a,b)},"~S,~N");e(c$,"getPropI",function(a,b){var c=this.thisMesh;if(0<=
b&&(b>=this.meshCount||null==(c=this.isomeshes[b])))return null;var d=this.getPropMC(a,b);if(null!=d)return d;if("message"===a){c="";if(!this.jvxlData.isValid)return"invalid! (no atoms selected?)";Float.isNaN(this.jvxlData.integration)||(c+="integration "+this.jvxlData.integration);if(24==this.shapeID||27==this.shapeID||28==this.shapeID)c+=" with cutoff="+this.jvxlData.cutoff;if(27==this.shapeID||28==this.shapeID)return c;3.4028235E38!=this.jvxlData.dataMin&&(c+=" min="+this.jvxlData.dataMin+" max="+
this.jvxlData.dataMax);c+="; "+JV.JC.shapeClassBases[this.shapeID].toLowerCase()+" count: "+this.getPropMC("count",b);return c+this.getPropI("dataRangeStr",b)+this.jvxlData.msg}if("dataRange"===a)return this.getDataRange(c);if("dataRangeStr"===a)return c=this.getDataRange(c),null!=c&&3.4028235E38!=c[0]&&c[0]!=c[1]?"\nisosurface full data range "+c[0]+" to "+c[1]+" with color scheme spanning "+c[2]+" to "+c[3]:"";if("moNumber"===a)return Integer.$valueOf(this.moNumber);if("moLinearCombination"===a)return this.moLinearCombination;
if("nSets"===a)return Integer.$valueOf(null==c?0:c.nSets);if("area"===a)return null==c?Float.$valueOf(NaN):this.calculateVolumeOrArea(c,!0);if("volume"===a)return null==c?Float.$valueOf(NaN):this.calculateVolumeOrArea(c,!1);if(null==c)return null;if("cutoff"===a)return Float.$valueOf(this.jvxlData.cutoff);if("minMaxInfo"===a)return x(-1,[this.jvxlData.dataMin,this.jvxlData.dataMax]);if("plane"===a)return this.jvxlData.jvxlPlane;if("contours"===a)return c.getContours();if("jvxlDataXml"===a||"jvxlMeshXml"===
a){var h=null;this.jvxlData.slabInfo=null;"jvxlMeshXml"===a||this.jvxlData.vertexDataOnly||null!=c.bsSlabDisplay&&null==c.bsSlabGhost?(h=new J.jvxl.data.MeshData,this.fillMeshData(h,1,c),h.polygonColorData=J.shapesurface.Isosurface.getPolygonColorData(h.pc,h.pcs,h.colorsExplicit?h.pis:null,h.bsSlabDisplay)):null!=c.bsSlabGhost&&(this.jvxlData.slabInfo=c.slabOptions.toString());d=new JU.SB;this.getMeshCommand(d,c.index);c.setJvxlColorMap(!0);return J.jvxl.data.JvxlCoder.jvxlGetFileVwr(this.vwr,this.jvxlData,
h,this.title,"",!0,1,d.toString(),null)}if("jvxlFileInfo"===a)return c.setJvxlColorMap(!1),J.jvxl.data.JvxlCoder.jvxlGetInfo(this.jvxlData);if("command"===a){d=new JU.SB;for(c=this.getMeshList(0>b?this.previousMeshID:c.thisID,!1).size();0<=--c;)this.getMeshCommand(d,c);return d.toString()}return"atoms"===a?c.surfaceAtoms:"colorEncoder"===a?c.colorEncoder:null},"~S,~N");e(c$,"getDataRange",function(a){return null==a?null:a.getDataRange()},"J.shapesurface.IsosurfaceMesh");e(c$,"calculateVolumeOrArea",
function(a,b){if(b){if(null!=a.calculatedArea)return a.calculatedArea}else if(null!=a.calculatedVolume)return a.calculatedVolume;var c=new J.jvxl.data.MeshData;this.fillMeshData(c,1,a);c.nSets=a.nSets;c.vertexSets=a.vertexSets;if(!b&&a.jvxlData.colorDensity)return c=a.jvxlData.voxelVolume,c*=null==a.bsSlabDisplay?a.vc:a.bsSlabDisplay.cardinality(),a.calculatedVolume=Float.$valueOf(c);var d=J.jvxl.data.MeshData.calculateVolumeOrArea(c,a.jvxlData.thisSet,b,!1);0>=a.nSets&&(a.nSets=-c.nSets);b?a.calculatedArea=
d:a.calculatedVolume=d;return d},"J.shapesurface.IsosurfaceMesh,~B");c$.getPolygonColorData=e(c$,"getPolygonColorData",function(a,b,c,d){var h=null!=c;if(null==b&&null==c)return null;for(var m=new JU.SB,g=0,e=0,f=0,p=0,l=!1,q=0;q<a||!0==(l=!0);q++)if(l||null==d||d.get(q))if(l||(h?(p=c[q][4])!=f:b[q]!=e)){0!=g&&m.append(" ").appendI(g).append(" ").appendI(h?f:0==e?0:JU.C.getArgb(e));if(l)break;h?f=p:e=b[q];g=1}else g++;m.append("\n");return m.toString()},"~N,~A,~A,JU.BS");n(c$,"getShapeState",function(){this.clean();
var a=new JU.SB;a.append("\n");for(var b=0;b<this.meshCount;b++)this.getMeshCommand(a,b);return a.toString()});e(c$,"getMeshCommand",function(a,b){var c=this.meshes[b];if(!(null==c||null==c.scriptCommand)){var d=c.scriptCommand;1<this.vwr.ms.mc&&J.shape.Shape.appendCmd(a,"frame "+this.vwr.getModelNumberDotted(c.modelIndex));var d=JU.PT.rep(d,";; isosurface map"," map"),d=JU.PT.rep(d,"; isosurface map"," map"),d=d.$replace("\t"," "),d=JU.PT.rep(d,";#","; #"),h=d.indexOf("; #");0<=h&&(d=d.substring(0,
h));null!=c.connectedAtoms&&(d+=" connect "+JU.Escape.eAI(c.connectedAtoms));d=JU.PT.trim(d,";");null!=c.linkedMesh&&(d+=" LINK");"lcaoCartoon"===this.myType&&0<=c.atomIndex&&(d+=" ATOMINDEX "+c.atomIndex);J.shape.Shape.appendCmd(a,d);h=this.myType+" ID "+JU.PT.esc(c.thisID);0<=c.jvxlData.thisSet&&J.shape.Shape.appendCmd(a,h+" set "+(c.jvxlData.thisSet+1));null!=c.mat4&&!c.isModelConnected&&J.shape.Shape.appendCmd(a,h+" move "+JU.Escape.matrixToScript(c.mat4));0!=c.scale3d&&J.shape.Shape.appendCmd(a,
h+" scale3d "+c.scale3d);-2147483648!=c.jvxlData.slabValue&&J.shape.Shape.appendCmd(a,h+" slab "+c.jvxlData.slabValue);null!=c.slabOptions&&J.shape.Shape.appendCmd(a,c.slabOptions.toString());if("#"!=d.charAt(0)&&(this.allowMesh&&J.shape.Shape.appendCmd(a,c.getState(this.myType)),!c.isColorSolid&&(0==c.colorType&&JU.C.isColixTranslucent(c.colix))&&J.shape.Shape.appendCmd(a,"color "+this.myType+" "+J.shape.Shape.getTranslucentLabel(c.colix)),null!=c.colorCommand&&(0==c.colorType&&!c.colorCommand.equals("#inherit;"))&&
J.shape.Shape.appendCmd(a,c.colorCommand),d=c.isColorSolid&&null!=c.pcs,c.isColorSolid&&0==c.colorType&&!c.colorsExplicit&&!d?J.shape.Shape.appendCmd(a,J.shape.Shape.getColorCommandUnk(this.myType,c.colix,this.translucentAllowed)):c.jvxlData.isBicolorMap&&c.colorPhased&&J.shape.Shape.appendCmd(a,"color isosurface phase "+J.shape.Shape.encodeColor(c.jvxlData.minColorIndex)+" "+J.shape.Shape.encodeColor(c.jvxlData.maxColorIndex)),null!=c.vertexColorMap))for(var m,c=c.vertexColorMap.entrySet().iterator();c.hasNext()&&
((m=c.next())||1);)d=m.getValue(),d.isEmpty()||J.shape.Shape.appendCmd(a,"color "+this.myType+" "+JU.Escape.eBS(d)+" "+m.getKey())}},"JU.SB,~N");e(c$,"getScriptBitSets",function(a,b){this.script=a;var c;this.iHaveModelIndex=!1;this.modelIndex=-1;if(null!=a&&0<=(c=a.indexOf("MODEL({"))){var d=a.indexOf("})",c);0<d&&(c=JU.BS.unescape(a.substring(c+3,d+1)),this.modelIndex=null==c?-1:c.nextSetBit(0),this.iHaveModelIndex=0<=this.modelIndex)}if(null==a)return!1;this.getCapSlabInfo(a);c=a.indexOf("# ({");
if(0>c)return!1;d=a.indexOf("})",c);if(0>d)return!1;c=JU.BS.unescape(a.substring(c+2,d+2));null==b?this.sg.setProp("select",c,null):b[0]=c;if(0>(c=a.indexOf("({",d)))return!0;d=a.indexOf("})",c);if(0>d)return!1;c=JU.BS.unescape(a.substring(c+1,d+1));null==b?this.sg.setProp("ignore",c,null):b[1]=c;if((c=a.indexOf("/({",d))==d+2){if(0>(d=a.indexOf("})",c)))return!1;c=JU.BS.unescape(a.substring(c+3,d+1));null==b?this.vwr.ms.setTrajectoryBs(c):b[2]=c}return!0},"~S,~A");e(c$,"getCapSlabInfo",function(a){var b=
a.indexOf("# SLAB=");0<=b&&this.sg.setProp("slab",this.getCapSlabObject(JU.PT.getQuotedStringAt(a,b),!1),null);b=a.indexOf("# CAP=");0<=b&&this.sg.setProp("slab",this.getCapSlabObject(JU.PT.getQuotedStringAt(a,b),!0),null)},"~S");e(c$,"getCapSlabObject",function(a,b){try{if(0==a.indexOf("array")){var c=JU.PT.split(a.substring(6,a.length-1),",");return JU.TempArray.getSlabObjectType(1678381065,D(-1,[JU.Escape.uP(c[0]),JU.Escape.uP(c[1]),JU.Escape.uP(c[2]),JU.Escape.uP(c[3])]),b,null)}var d=JU.Escape.uP(a);
if(U(d,JU.P4))return JU.TempArray.getSlabObjectType(134217750,d,b,null)}catch(h){if(!S(h,Exception))throw h;}return null},"~S,~B");e(c$,"initializeIsosurface",function(){this.iHaveModelIndex||(this.modelIndex=this.vwr.am.cmi);this.atomIndex=-1;this.bsDisplay=null;this.center=JU.P3.new3(NaN,0,0);this.colix=5;this.cutoffRange=this.connections=null;this.colorType=this.defaultColix=this.meshColix=0;this.displayWithinPoints=null;this.explicitContours=!1;this.isFixed=0>this.modelIndex;this.isPhaseColored=
this.isColorExplicit=!1;this.linkedMesh=null;0>this.modelIndex&&(this.modelIndex=0);this.scale3d=0;this.title=null;this.translucentLevel=0;this.withinPoints=null;this.initState()});e(c$,"initState",function(){this.associateNormals=!0;this.sg.initState()});e(c$,"setMeshI",function(){this.thisMesh.visible=!0;this.thisMesh.modelIndex=0<=(this.thisMesh.atomIndex=this.atomIndex)?this.vwr.ms.at[this.atomIndex].mi:this.isFixed?-1:0<=this.modelIndex?this.modelIndex:this.vwr.am.cmi;this.thisMesh.scriptCommand=
this.script;this.thisMesh.ptCenter.setT(this.center);this.thisMesh.scale3d=null==this.thisMesh.jvxlData.jvxlPlane?0:this.scale3d});e(c$,"discardTempData",function(a){a&&(this.title=null,null!=this.thisMesh&&(this.thisMesh.surfaceSet=null))},"~B");e(c$,"getDefaultColix",function(){return 0!=this.defaultColix?this.defaultColix:!this.sg.jvxlData.wasCubic?this.colix:JU.C.getColix(0<=this.sg.params.cutoff?-11525984:-6283184)});e(c$,"drawLcaoCartoon",function(a,b,c,d){var h=this.sg.setLcao(),m=c.x+c.y+
c.z;this.defaultColix=JU.C.getColix(this.sg.params.colorPos);var g=JU.C.getColix(this.sg.params.colorNeg),e=new JU.V3,f=0<h.length&&"-"==h.charAt(0);f&&(h=h.substring(1));f=f?-1:1;e.cross(a,b);if(0!=m){var p=new JU.A4;0!=c.x?p.setVA(b,m):0!=c.y?p.setVA(e,m):p.setVA(a,m);c=(new JU.M3).setAA(p);c.rotate(b);c.rotate(e);c.rotate(a)}null==this.thisMesh&&0==this.nLCAO&&(this.nLCAO=this.meshCount);c=null==this.thisMesh?(0<d?"lp":"lcao")+ ++this.nLCAO+"_"+h:this.thisMesh.thisID;null==this.thisMesh&&this.allocMesh(c,
null);h.equals("px")?(this.thisMesh.thisID+="a",h=this.thisMesh,this.createLcaoLobe(b,f,d),0<d||(this.setProperty("thisID",c+"b",null),this.createLcaoLobe(b,-f,d),this.thisMesh.colix=g,this.linkedMesh=this.thisMesh.linkedMesh=h)):h.equals("py")?(this.thisMesh.thisID+="a",h=this.thisMesh,this.createLcaoLobe(e,f,d),0<d||(this.setProperty("thisID",c+"b",null),this.createLcaoLobe(e,-f,d),this.thisMesh.colix=g,this.linkedMesh=this.thisMesh.linkedMesh=h)):h.equals("pz")?(this.thisMesh.thisID+="a",h=this.thisMesh,
this.createLcaoLobe(a,f,d),0<d||(this.setProperty("thisID",c+"b",null),this.createLcaoLobe(a,-f,d),this.thisMesh.colix=g,this.linkedMesh=this.thisMesh.linkedMesh=h)):h.equals("pza")||0==h.indexOf("sp")||0==h.indexOf("d")||0==h.indexOf("lp")?this.createLcaoLobe(a,f,d):h.equals("pzb")?this.createLcaoLobe(a,-f,d):h.equals("pxa")?this.createLcaoLobe(b,f,d):h.equals("pxb")?this.createLcaoLobe(b,-f,d):h.equals("pya")?this.createLcaoLobe(e,f,d):h.equals("pyb")?this.createLcaoLobe(e,-f,d):h.equals("spacefill")||
h.equals("cpk")?this.createLcaoLobe(null,2*this.vwr.ms.at[this.atomIndex].getRadius(),d):this.createLcaoLobe(null,1,d)},"JU.V3,JU.V3,JU.V3,~N");e(c$,"createLcaoLobe",function(a,b,c){this.initState();JU.Logger.debugging&&JU.Logger.debug("creating isosurface ID "+this.thisMesh.thisID);null==a?this.setProperty("sphere",Float.$valueOf(b/2),null):(this.lcaoDir.x=a.x*b,this.lcaoDir.y=a.y*b,this.lcaoDir.z=a.z*b,this.lcaoDir.w=0.7,this.setProperty(2==c?"lp":1==c?"rad":"lobe",this.lcaoDir,null));this.thisMesh.colix=
this.defaultColix;this.setScriptInfo(null)},"JU.V3,~N,~N");n(c$,"invalidateTriangles",function(){this.thisMesh.invalidatePolygons()});n(c$,"setOutputChannel",function(a,b){a.setOutputChannel(b)},"javajs.api.GenericBinaryDocument,JU.OC");n(c$,"fillMeshData",function(a,b,c){if(null==a){if(null==this.thisMesh&&this.allocMesh(null,null),this.thisMesh.isMerged||this.thisMesh.clearType(this.myType,this.sg.params.iAddGridPoints),this.thisMesh.connectedAtoms=this.connections,this.thisMesh.colix=this.getDefaultColix(),
this.thisMesh.colorType=this.colorType,this.thisMesh.meshColix=this.meshColix,this.isPhaseColored||this.thisMesh.jvxlData.isBicolorMap)this.thisMesh.isColorSolid=!1}else if(null==c&&(c=this.thisMesh),null!=c)switch(b){case 1:a.mergeVertexCount0=c.mergeVertexCount0;a.vs=c.vs;a.vertexSource=c.vertexSource;a.vvs=c.vvs;a.vc=c.vc;a.vertexIncrement=c.vertexIncrement;a.pc=c.pc;a.pis=c.pis;a.pcs=c.pcs;a.bsSlabDisplay=c.bsSlabDisplay;a.bsSlabGhost=c.bsSlabGhost;a.slabColix=c.slabColix;a.slabMeshType=c.slabMeshType;
a.polygonCount0=c.polygonCount0;a.vertexCount0=c.vertexCount0;a.slabOptions=c.slabOptions;a.colorsExplicit=c.colorsExplicit;break;case 2:if(null==c.vcs||c.vc>c.vcs.length)c.vcs=V(c.vc,0);a.vcs=c.vcs;break;case 3:c.surfaceSet=a.surfaceSet;c.vertexSets=a.vertexSets;c.nSets=a.nSets;break;case 4:c.vs=a.vs,c.vvs=a.vvs,c.vc=a.vc,c.vertexIncrement=a.vertexIncrement,c.vertexSource=a.vertexSource,c.pc=a.pc,c.pis=a.pis,c.pcs=a.pcs,c.bsSlabDisplay=a.bsSlabDisplay,c.bsSlabGhost=a.bsSlabGhost,c.slabColix=a.slabColix,
c.slabMeshType=a.slabMeshType,c.polygonCount0=a.polygonCount0,c.vertexCount0=a.vertexCount0,c.mergeVertexCount0=a.mergeVertexCount0,c.slabOptions=a.slabOptions,c.colorsExplicit=a.colorsExplicit}},"J.jvxl.data.MeshData,~N,J.shapesurface.IsosurfaceMesh");n(c$,"notifySurfaceGenerationCompleted",function(){this.setMeshI();this.setBsVdw();this.thisMesh.surfaceAtoms=this.sg.params.bsSelected;this.thisMesh.insideOut=this.sg.params.isInsideOut();this.thisMesh.isModelConnected=this.sg.params.isModelConnected;
this.thisMesh.vertexSource=this.sg.params.vertexSource;this.thisMesh.spanningVectors=this.sg.getSpanningVectors();this.thisMesh.calculatedArea=null;this.thisMesh.calculatedVolume=null;if(!this.thisMesh.isMerged)return this.thisMesh.initialize(this.sg.params.isFullyLit()?1073741964:1073741958,null,this.sg.params.thePlane),null!=this.jvxlData.fixedLattice&&(this.thisMesh.lattice=this.jvxlData.fixedLattice,this.thisMesh.fixLattice()),this.thisMesh.setColorsFromJvxlData(this.sg.params.colorRgb);this.sg.params.allowVolumeRender||
(this.thisMesh.jvxlData.allowVolumeRender=!1);this.thisMesh.setColorsFromJvxlData(this.sg.params.colorRgb);null!=this.thisMesh.jvxlData.slabInfo&&this.vwr.runScriptCautiously("isosurface "+this.thisMesh.jvxlData.slabInfo);0<this.sg.params.psi_monteCarloCount&&(this.thisMesh.diameter=-1);return!1});n(c$,"notifySurfaceMappingCompleted",function(){this.thisMesh.isMerged||this.thisMesh.initialize(this.sg.params.isFullyLit()?1073741964:1073741958,null,this.sg.params.thePlane);this.setBsVdw();this.thisMesh.isColorSolid=
!1;this.thisMesh.colorDensity=this.jvxlData.colorDensity;this.thisMesh.volumeRenderPointSize=this.jvxlData.pointSize;this.thisMesh.colorEncoder=this.sg.params.colorEncoder;this.thisMesh.getContours();0!=this.thisMesh.jvxlData.nContours&&-1!=this.thisMesh.jvxlData.nContours&&(this.explicitContours=!0);this.explicitContours&&null!=this.thisMesh.jvxlData.jvxlPlane&&(this.thisMesh.havePlanarContours=!0);this.setPropertySuper("token",Integer.$valueOf(this.explicitContours?1073742046:1073741938),null);
this.setPropertySuper("token",Integer.$valueOf(this.explicitContours?1073741898:1073742039),null);this.thisMesh.isMerged||this.thisMesh.setJvxlDataRendering();null!=this.sg.params.slabInfo&&(this.thisMesh.slabPolygonsList(this.sg.params.slabInfo,!1),this.thisMesh.reinitializeLightingAndColor(this.vwr));this.thisMesh.setColorCommand()});e(c$,"setBsVdw",function(){null!=this.sg.bsVdw&&(null==this.thisMesh.bsVdw&&(this.thisMesh.bsVdw=new JU.BS),this.thisMesh.bsVdw.or(this.sg.bsVdw))});n(c$,"calculateGeodesicSurface",
function(a,b){return this.vwr.calculateSurface(a,b)},"JU.BS,~N");n(c$,"getSurfacePointIndexAndFraction",function(){return 0},"~N,~B,~N,~N,~N,JU.P3i,~N,~N,~N,~N,JU.T3,JU.V3,~B,~A");n(c$,"addVertexCopy",function(a,b,c,d){return null!=this.cutoffRange&&(b<this.cutoffRange[0]||b>this.cutoffRange[1])?-1:null!=this.withinPoints&&!J.shape.Mesh.checkWithin(a,this.withinPoints,this.withinDistance2,this.isWithinNot)?-1:this.thisMesh.addVertexCopy(a,b,c,this.associateNormals,d)},"JU.T3,~N,~N,~B");n(c$,"addTriangleCheck",
function(a,b,c,d,h,m,g){return 0>a||0>b||0>c||m&&!J.jvxl.data.MeshData.checkCutoff(a,b,c,this.thisMesh.vvs)?-1:this.thisMesh.addTriangleCheck(a,b,c,d,h,g)},"~N,~N,~N,~N,~N,~B,~N");e(c$,"setScriptInfo",function(a){a=null==a?this.sg.params.script:a;var b=null==a?-1:a.indexOf("; isosurface map");if(0==b)null!=this.thisMesh.scriptCommand&&(b=this.thisMesh.scriptCommand.indexOf("; isosurface map"),0<=b&&(this.thisMesh.scriptCommand=this.thisMesh.scriptCommand.substring(0,b)),this.thisMesh.scriptCommand+=
a);else if(this.thisMesh.title=this.sg.params.title,this.thisMesh.dataType=this.sg.params.dataType,this.thisMesh.scale3d=this.sg.params.scale3d,null!=a&&" "==a.charAt(0)&&(a=this.myType+" ID "+JU.PT.esc(this.thisMesh.thisID)+a,b=a.indexOf("; isosurface map")),this.thisMesh.scriptCommand=0<b&&0<this.scriptAppendix.length?a.substring(0,b)+this.scriptAppendix+a.substring(b):a+this.scriptAppendix,!this.explicitID&&null!=a&&0<=(b=a.indexOf("# ID=")))this.thisMesh.thisID=JU.PT.getQuotedStringAt(a,b)},"~S");
n(c$,"addRequiredFile",function(a){a=' # /*file*/"'+a+'"';0>this.scriptAppendix.indexOf(a)&&(this.scriptAppendix+=a)},"~S");e(c$,"setJvxlInfo",function(){if(this.sg.jvxlData!==this.jvxlData||this.sg.jvxlData!==this.thisMesh.jvxlData)this.jvxlData=this.thisMesh.jvxlData=this.sg.jvxlData});n(c$,"getShapeDetail",function(){for(var a=new JU.Lst,b=0;b<this.meshCount;b++){var c=new java.util.Hashtable,d=this.isomeshes[b];null==d||(null==d.vs||0==d.vc&&0==d.pc)||(this.addMeshInfo(d,c),a.addLast(c))}return a});
e(c$,"addMeshInfo",function(a,b){b.put("ID",null==a.thisID?"<noid>":a.thisID);b.put("visible",Boolean.$valueOf(a.visible));b.put("vertexCount",Integer.$valueOf(a.vc));null!=a.calculatedVolume&&b.put("volume",a.calculatedVolume);null!=a.calculatedArea&&b.put("area",a.calculatedArea);Float.isNaN(a.ptCenter.x)||b.put("center",a.ptCenter);null!=a.mat4&&b.put("mat4",a.mat4);0!=a.scale3d&&b.put("scale3d",Float.$valueOf(a.scale3d));b.put("xyzMin",a.jvxlData.boundingBox[0]);b.put("xyzMax",a.jvxlData.boundingBox[1]);
var c=J.jvxl.data.JvxlCoder.jvxlGetInfo(a.jvxlData);null!=c&&b.put("jvxlInfo",c.$replace("\n"," "));b.put("modelIndex",Integer.$valueOf(a.modelIndex));b.put("color",JU.CU.colorPtFromInt(JU.C.getArgb(a.colix),null));null!=a.colorEncoder&&b.put("colorKey",a.colorEncoder.getColorKey());null!=a.title&&b.put("title",a.title);(null!=a.jvxlData.contourValues||null!=a.jvxlData.contourValuesUsed)&&b.put("contours",a.getContourList(this.vwr))},"J.shapesurface.IsosurfaceMesh,java.util.Map");n(c$,"getPlane",
function(){return null},"~N");n(c$,"getValue",function(){return 0},"~N,~N,~N,~N");n(c$,"checkObjectHovered",function(a,b,c){if(null!=this.keyXy&&a>=this.keyXy[0]&&b>=this.keyXy[1]&&a<this.keyXy[2]&&b<this.keyXy[3])return this.hoverKey(a,b),!0;if(!this.vwr.getDrawHover())return!1;c=this.findValue(a,b,!1,c);if(null==c)return!1;this.vwr.gdata.antialiasEnabled&&(a<<=1,b<<=1);this.vwr.hoverOnPt(a,b,c,this.pickedMesh.thisID,this.pickedPt);return!0},"~N,~N,JU.BS");e(c$,"hoverKey",function(a,b){try{var c,
d=1-1*(b-this.keyXy[1])/(this.keyXy[3]-this.keyXy[1]);if(this.thisMesh.showContourLines){var h=this.thisMesh.getContours();if(null==h){if(null==this.thisMesh.jvxlData.contourValues)return;var m=G(Math.floor(d*this.thisMesh.jvxlData.contourValues.length));if(0>m||m>this.thisMesh.jvxlData.contourValues.length)return;c=""+this.thisMesh.jvxlData.contourValues[m]}else{m=G(Math.floor(d*h.length));if(0>m||m>h.length)return;c=""+h[m].get(2).floatValue()}}else{var g=this.thisMesh.colorEncoder.quantize(d,!0),
d=this.thisMesh.colorEncoder.quantize(d,!1);c=""+g+" - "+d}this.vwr.gdata.isAntialiased()&&(a<<=1,b<<=1);this.vwr.hoverOnPt(a,b,c,null,null)}catch(e){if(!S(e,Exception))throw e;}},"~N,~N");n(c$,"checkObjectClicked",function(a,b,c,d,h){if(!h||!this.vwr.isBound(c,18))return null;c=100;this.vwr.gdata.isAntialiased()&&(a<<=1,b<<=1,c<<=1);for(var m=h=-1,g=-2147483648,e=2147483647,f=0;f<this.meshCount;f++){var p=this.isomeshes[f];if(this.isPickable(p,d)&&(p=p.vs,null!=p))for(var l=p.length;0<=--l;){var q=
p[l];null!=q&&0<=this.coordinateInRange(a,b,q,c,this.ptXY)&&(this.ptXY.z<e&&(h=f,e=this.ptXY.z,m=l),this.ptXY.z>g&&(g=this.ptXY.z))}}if(0>h)return null;this.pickedMesh=this.isomeshes[h];this.setPropertySuper("thisID",this.pickedMesh.thisID,null);this.pickedVertex=m;a=new JU.P3;a.setT(this.pickedMesh.vs[this.pickedVertex]);this.pickedModel=this.pickedMesh.modelIndex;b=this.getPickedPoint(a,this.pickedModel);this.setStatusPicked(-4,a,b);return b},"~N,~N,~N,JU.BS,~B");e(c$,"isPickable",function(a,b){return 0!=
a.visibilityFlags&&(0>a.modelIndex||b.get(a.modelIndex))&&!JU.C.isColixTranslucent(a.colix)},"J.shapesurface.IsosurfaceMesh,JU.BS");e(c$,"findValue",function(a,b,c,d){c=100;this.vwr.gdata.isAntialiased()&&(a<<=1,b<<=1,c<<=1);for(var h=-1,m=null,g=null,e=0;e<this.meshCount;e++)if(g=this.isomeshes[e],this.isPickable(g,d)){var f=g.jvxlData.vContours,p=0>g.firstRealVertex?0:g.firstRealVertex,l=0;if(null!=f&&0<f.length){for(p=0;p<f.length;p++)for(var q=f[p],v=q.size()-1,s=6;s<v;s++){var C=q.get(s),n=this.coordinateInRange(a,
b,C,c,this.ptXY);0<=n&&(c=n,m=q,l=p,this.pickedMesh=g,this.pickedPt=C)}if(null!=m)return m.get(2).toString()+(JU.Logger.debugging?" "+l:"")}else if(null!=g.jvxlData.jvxlPlane&&null!=g.vvs){f=null==g.mat4&&0==g.scale3d?g.vs:g.getOffsetVertices(g.jvxlData.jvxlPlane);for(s=g.vc;--s>=p;)C=f[s],n=this.coordinateInRange(a,b,C,c,this.ptXY),0<=n&&(c=n,h=s,this.pickedMesh=g,this.pickedPt=C);if(-1!=h)break}else if(null!=g.vvs){if(null!=g.bsSlabDisplay)for(s=g.bsSlabDisplay.nextSetBit(0);0<=s;s=g.bsSlabDisplay.nextSetBit(s+
1)){if(f=g.pis[s],null!=f)for(l=0;3>l;l++)C=g.vs[f[l]],n=this.coordinateInRange(a,b,C,c,this.ptXY),0<=n&&(c=n,h=f[l],this.pickedMesh=g,this.pickedPt=C)}else for(s=g.vc;--s>=p;)C=g.vs[s],n=this.coordinateInRange(a,b,C,c,this.ptXY),0<=n&&(c=n,h=s,this.pickedMesh=g,this.pickedPt=C);if(-1!=h)break}}return-1==h?null:(JU.Logger.debugging?"$"+g.thisID+"["+(h+1)+"] "+g.vs[h]+": ":g.thisID+": ")+g.vvs[h]},"~N,~N,~B,JU.BS");e(c$,"getCmd",function(a){var b=(new JU.SB).append("\n");this.getMeshCommand(b,a);return b.toString()},
"~N");$(c$,"MAX_OBJECT_CLICK_DISTANCE_SQUARED",100)});F("J.jvxl.data");L(null,"J.jvxl.data.JvxlCoder","java.lang.Float JU.BS $.Lst $.P3 $.PT $.SB J.api.Interface J.jvxl.data.VolumeData JU.BSUtil $.C $.Escape $.Logger".split(" "),function(){c$=xa(J.jvxl.data,"JvxlCoder");c$.jvxlGetFileVwr=e(c$,"jvxlGetFileVwr",function(a,b,c,d,h,m,g,e,f){J.jvxl.data.JvxlCoder.haveXMLUtil||(a.isJS&&J.api.Interface.getInterface("JU.XmlUtil",a,"show"),J.jvxl.data.JvxlCoder.haveXMLUtil=!0);a=new JU.SB;if("TRAILERONLY".equals(h))return JU.XmlUtil.closeTag(a,
"jvxlSurfaceSet"),JU.XmlUtil.closeTag(a,"jvxl"),a.toString();var p=null!=c,l="HEADERONLY".equals(h);if(m){JU.XmlUtil.openDocument(a);JU.XmlUtil.openTagAttr(a,"jvxl",D(-1,["version","2.3","jmolVersion",b.version,"xmlns","http://jmol.org/jvxl_schema","xmlns:cml","http://www.xml-cml.org/schema"]));null!=b.jvxlFileTitle&&JU.XmlUtil.appendCdata(a,"jvxlFileTitle",null,"\n"+b.jvxlFileTitle);null!=b.moleculeXml&&a.append(b.moleculeXml);var q=p?null:b.jvxlVolumeDataXml;null==q&&(q=(new J.jvxl.data.VolumeData).setVolumetricXml());
a.append(q);JU.XmlUtil.openTagAttr(a,"jvxlSurfaceSet",D(-1,["count",""+(0<g?g:1)]));if(l)return a.toString()}g=p?"pmesh":null==b.jvxlPlane?"isosurface":"plane";null!=b.jvxlColorData&&0<b.jvxlColorData.length&&(g="mapped "+g);JU.XmlUtil.openTagAttr(a,"jvxlSurface",D(-1,["type",g]));a.append(J.jvxl.data.JvxlCoder.jvxlGetInfoData(b,p));J.jvxl.data.JvxlCoder.jvxlAppendCommandState(a,f,e);if(null!=d||null!=h&&0<h.length){e=new JU.SB;null!=h&&0<h.length&&e.append(h).append("\n");if(null!=d)for(h=0;h<d.length;h++)e.append(d[h]).appendC("\n");
JU.XmlUtil.appendCdata(a,"jvxlSurfaceTitle",null,e.toString())}e=new JU.SB;JU.XmlUtil.openTagAttr(e,"jvxlSurfaceData",p||null==b.jvxlPlane?null:null==b.mapLattice?D(-1,["plane",JU.Escape.eP4(b.jvxlPlane)]):D(-1,["plane",JU.Escape.eP4(b.jvxlPlane),"maplattice",JU.Escape.eP(b.mapLattice)]));if(p)J.jvxl.data.JvxlCoder.appendXmlVertexOnlyData(e,b,c,!0);else{if(null==b.jvxlPlane){if(null==b.jvxlEdgeData)return"";J.jvxl.data.JvxlCoder.appendXmlEdgeData(e,b)}J.jvxl.data.JvxlCoder.appendXmlColorData(e,b.jvxlColorData,
!0,b.isJvxlPrecisionColor,b.valueMappedToRed,b.valueMappedToBlue)}J.jvxl.data.JvxlCoder.appendEncodedBitSetTag(e,"jvxlInvalidatedVertexData",b.jvxlExcluded[1],-1,null);0<b.excludedVertexCount&&(J.jvxl.data.JvxlCoder.appendEncodedBitSetTag(e,"jvxlExcludedVertexData",b.jvxlExcluded[0],b.excludedVertexCount,null),J.jvxl.data.JvxlCoder.appendEncodedBitSetTag(e,"jvxlExcludedPlaneData",b.jvxlExcluded[2],-1,null));J.jvxl.data.JvxlCoder.appendEncodedBitSetTag(e,"jvxlExcludedTriangleData",b.jvxlExcluded[3],
b.excludedTriangleCount,null);JU.XmlUtil.closeTag(e,"jvxlSurfaceData");c=e.length();a.appendSB(e);null!=b.vContours&&0<b.vContours.length&&J.jvxl.data.JvxlCoder.jvxlEncodeContourData(b.vContours,a);if(null!=b.vertexColorMap){null==b.baseColor?JU.XmlUtil.openTag(a,"jvxlVertexColorData"):JU.XmlUtil.openTagAttr(a,"jvxlVertexColorData",D(-1,["baseColor",b.baseColor]));var v;for(d=b.vertexColorMap.entrySet().iterator();d.hasNext()&&((v=d.next())||1);)J.jvxl.data.JvxlCoder.appendEncodedBitSetTag(a,"jvxlColorMap",
v.getValue(),-1,D(-1,["color",v.getKey()]));b.vertexColorMap=null;JU.XmlUtil.closeTag(a,"jvxlVertexColorData")}JU.XmlUtil.closeTag(a,"jvxlSurface");m&&(JU.XmlUtil.closeTag(a,"jvxlSurfaceSet"),JU.XmlUtil.closeTag(a,"jvxl"));return J.jvxl.data.JvxlCoder.jvxlSetCompressionRatio(a,b,c)},"JV.Viewer,J.jvxl.data.JvxlData,J.jvxl.data.MeshData,~A,~S,~B,~N,~S,~S");c$.appendEncodedBitSetTag=e(c$,"appendEncodedBitSetTag",function(a,b,c,d,h){0>d&&(d=JU.BSUtil.cardinalityOf(c));if(0!=d){var m=new JU.SB;m.append("\n ");
J.jvxl.data.JvxlCoder.jvxlEncodeBitSetBuffer(c,-1,m);JU.XmlUtil.appendTagObj(a,b,D(-1,[h,"bsEncoding","base90+35","count",""+d,"len",""+c.length()]),J.jvxl.data.JvxlCoder.jvxlCompressString(m.toString(),!0))}},"JU.SB,~S,JU.BS,~N,~A");c$.jvxlSetCompressionRatio=e(c$,"jvxlSetCompressionRatio",function(a,b,c){a=a.toString();b=z(0<b.nBytes?b.nBytes/c:13*b.nPointsX*b.nPointsY*b.nPointsZ/c);return JU.PT.rep(a,'"not calculated"',0<b?'"'+b+':1"':'"?"')},"JU.SB,J.jvxl.data.JvxlData,~N");c$.appendXmlEdgeData=
e(c$,"appendXmlEdgeData",function(a,b){JU.XmlUtil.appendTagObj(a,"jvxlEdgeData",D(-1,["count",""+(b.jvxlEdgeData.length-1),"encoding","base90f1","bsEncoding","base90+35c","isXLowToHigh",""+b.isXLowToHigh,"data",J.jvxl.data.JvxlCoder.jvxlCompressString(b.jvxlEdgeData,!0)]),"\n"+J.jvxl.data.JvxlCoder.jvxlCompressString(b.jvxlSurfaceData,!0))},"JU.SB,J.jvxl.data.JvxlData");c$.jvxlAppendCommandState=e(c$,"jvxlAppendCommandState",function(a,b,c){null!=b&&JU.XmlUtil.appendCdata(a,"jvxlIsosurfaceCommand",
null,"\n"+(0>b.indexOf("#")?b:b.substring(0,b.indexOf("#")))+"\n");null!=c&&(0<=c.indexOf("** XML ** ")?(c=JU.PT.split(c,"** XML **")[1].trim(),JU.XmlUtil.appendTag(a,"jvxlIsosurfaceState","\n"+c+"\n")):JU.XmlUtil.appendCdata(a,"jvxlIsosurfaceState",null,"\n"+c))},"JU.SB,~S,~S");c$.appendXmlColorData=e(c$,"appendXmlColorData",function(a,b,c,d,h,m){var g;if(!(null==b||0>(g=b.length-1)))d&&(g/=2),JU.XmlUtil.appendTagObj(a,"jvxlColorData",D(-1,["count",""+g,"encoding",c?"base90f"+(d?"2":"1"):"none",
"min",""+h,"max",""+m,"data",J.jvxl.data.JvxlCoder.jvxlCompressString(b,!0)]),null)},"JU.SB,~S,~B,~B,~N,~N");c$.jvxlGetInfo=e(c$,"jvxlGetInfo",function(a){return J.jvxl.data.JvxlCoder.jvxlGetInfoData(a,a.vertexDataOnly)},"J.jvxl.data.JvxlData");c$.jvxlGetInfoData=e(c$,"jvxlGetInfoData",function(a,b){if(null==a.jvxlSurfaceData)return"";var c=new JU.Lst,d=a.nSurfaceInts,h=b?0:a.jvxlEdgeData.length-1,m=null==a.jvxlColorData?-1:a.jvxlColorData.length-1;J.jvxl.data.JvxlCoder.addAttrib(c,"\n  isModelConnected",
""+a.isModelConnected);if(!b){J.jvxl.data.JvxlCoder.addAttrib(c,"\n  cutoff",""+a.cutoff);J.jvxl.data.JvxlCoder.addAttrib(c,"\n  isCutoffAbsolute",""+a.isCutoffAbsolute);J.jvxl.data.JvxlCoder.addAttrib(c,"\n  pointsPerAngstrom",""+a.pointsPerAngstrom);var g=a.jvxlSurfaceData.length+h+m+1;0<g&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  nBytesData",""+g);J.jvxl.data.JvxlCoder.addAttrib(c,"\n  isXLowToHigh",""+a.isXLowToHigh);null==a.jvxlPlane&&(J.jvxl.data.JvxlCoder.addAttrib(c,"\n  nSurfaceInts",""+d),
J.jvxl.data.JvxlCoder.addAttrib(c,"\n  nBytesUncompressedEdgeData",""+h));0<m&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  nBytesUncompressedColorData",""+m)}a.excludedVertexCount=JU.BSUtil.cardinalityOf(a.jvxlExcluded[0]);a.excludedTriangleCount=JU.BSUtil.cardinalityOf(a.jvxlExcluded[3]);0<a.excludedVertexCount&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  nExcludedVertexes",""+a.excludedVertexCount);0<a.excludedTriangleCount&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  nExcludedTriangles",""+a.excludedTriangleCount);
g=JU.BSUtil.cardinalityOf(a.jvxlExcluded[1]);0<g&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  nInvalidatedVertexes",""+g);null!=a.slabInfo&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  slabInfo",a.slabInfo);a.isJvxlPrecisionColor&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  precisionColor","true");a.colorDensity&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  colorDensity","true");Float.isNaN(a.pointSize)?0!=a.diameter&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  diameter",""+a.diameter):J.jvxl.data.JvxlCoder.addAttrib(c,"\n  pointSize",
""+a.pointSize);a.allowVolumeRender||J.jvxl.data.JvxlCoder.addAttrib(c,"\n  allowVolumeRender","false");null==a.jvxlPlane||b?(null!=a.fixedLattice&&!b&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  fixedLattice",""+a.fixedLattice),a.isContoured?(J.jvxl.data.JvxlCoder.addAttrib(c,"\n  contoured","true"),J.jvxl.data.JvxlCoder.addAttrib(c,"\n  colorMapped","true")):a.isBicolorMap?(J.jvxl.data.JvxlCoder.addAttrib(c,"\n  bicolorMap","true"),J.jvxl.data.JvxlCoder.addAttrib(c,"\n  colorNegative",JU.C.getHexCode(a.minColorIndex)),
J.jvxl.data.JvxlCoder.addAttrib(c,"\n  colorPositive",JU.C.getHexCode(a.maxColorIndex))):0<m&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  colorMapped","true"),null!=a.vContours&&0<a.vContours.length&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  nContourData",""+a.vContours.length)):(null!=a.mapLattice&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  mapLattice",""+a.mapLattice),0!=a.scale3d&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  scale3d",""+a.scale3d),0<m&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  colorMapped","true"),
J.jvxl.data.JvxlCoder.addAttrib(c,"\n  plane",JU.Escape.eP4(a.jvxlPlane)));null!=a.color&&0>a.color.indexOf("null")&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  color",a.color);J.jvxl.data.JvxlCoder.addAttrib(c,"\n  translucency",""+a.translucency);null!=a.meshColor&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  meshColor",a.meshColor);null!=a.colorScheme&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  colorScheme",a.colorScheme);null!=a.rendering&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  rendering",a.rendering);0<=a.thisSet&&
J.jvxl.data.JvxlCoder.addAttrib(c,"\n  set",""+(a.thisSet+1));-2147483648!=a.slabValue&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  slabValue",""+a.slabValue);a.isSlabbable&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  slabbable","true");0<a.nVertexColors&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  nVertexColors",""+a.nVertexColors);d=3.4028235E38==a.mappedDataMin?0:a.mappedDataMin;h=a.isColorReversed?a.valueMappedToRed:a.valueMappedToBlue;m=a.isColorReversed?a.valueMappedToBlue:a.valueMappedToRed;null!=a.jvxlColorData&&
(0<a.jvxlColorData.length&&!a.isBicolorMap)&&(J.jvxl.data.JvxlCoder.addAttrib(c,"\n  dataMinimum",""+d),J.jvxl.data.JvxlCoder.addAttrib(c,"\n  dataMaximum",""+a.mappedDataMax),J.jvxl.data.JvxlCoder.addAttrib(c,"\n  valueMappedToRed",""+m),J.jvxl.data.JvxlCoder.addAttrib(c,"\n  valueMappedToBlue",""+h));a.isContoured&&(null==a.contourValues||null==a.contourColixes?null==a.vContours&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  nContours",""+Math.abs(a.nContours)):(null!=a.jvxlPlane&&J.jvxl.data.JvxlCoder.addAttrib(c,
"\n  contoured","true"),J.jvxl.data.JvxlCoder.addAttrib(c,"\n  nContours",""+a.contourValues.length),J.jvxl.data.JvxlCoder.addAttrib(c,"\n  contourValues",JU.Escape.eAF(null==a.contourValuesUsed?a.contourValues:a.contourValuesUsed)),J.jvxl.data.JvxlCoder.addAttrib(c,"\n  contourColors",a.contourColors)),0<a.thisContour&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  thisContour",""+a.thisContour));a.insideOut&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  insideOut","true");a.vertexDataOnly?J.jvxl.data.JvxlCoder.addAttrib(c,
"\n  note","vertex/face data only"):a.isXLowToHigh&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  note","progressive JVXL+ -- X values read from low(0) to high("+(a.nPointsX-1)+")");J.jvxl.data.JvxlCoder.addAttrib(c,"\n  xyzMin",JU.Escape.eP(a.boundingBox[0]));J.jvxl.data.JvxlCoder.addAttrib(c,"\n  xyzMax",JU.Escape.eP(a.boundingBox[1]));J.jvxl.data.JvxlCoder.addAttrib(c,"\n  approximateCompressionRatio","not calculated");J.jvxl.data.JvxlCoder.addAttrib(c,"\n  jmolVersion",a.version);d=new JU.SB;JU.XmlUtil.openTagAttr(d,
"jvxlSurfaceInfo",c.toArray(Array(c.size())));JU.XmlUtil.closeTag(d,"jvxlSurfaceInfo");return d.toString()},"J.jvxl.data.JvxlData,~B");c$.addAttrib=e(c$,"addAttrib",function(a,b,c){a.addLast(D(-1,[b,c]))},"JU.Lst,~S,~S");c$.jvxlEncodeContourData=e(c$,"jvxlEncodeContourData",function(a,b){JU.XmlUtil.openTagAttr(b,"jvxlContourData",D(-1,["count",""+a.length]));for(var c=0;c<a.length;c++)if(!(6>a[c].size())){var d=a[c].get(0).intValue(),h=new JU.SB;h.append("\n");var m=a[c].get(1);J.jvxl.data.JvxlCoder.jvxlEncodeBitSetBuffer(m,
d,h);JU.XmlUtil.appendTagObj(b,"jvxlContour",D(-1,["index",""+c,"value",""+a[c].get(2),"color",JU.Escape.escapeColor(a[c].get(4)[0]),"count",""+m.length(),"encoding","base90iff1","bsEncoding","base90+35c","data",J.jvxl.data.JvxlCoder.jvxlCompressString(a[c].get(5).toString(),!0)]),J.jvxl.data.JvxlCoder.jvxlCompressString(h.toString(),!0))}JU.XmlUtil.closeTag(b,"jvxlContourData")},"~A,JU.SB");c$.set3dContourVector=e(c$,"set3dContourVector",function(a,b,c){if(!(6>a.size()))for(var d=a.get(5),h=a.get(1),
m=0,g=d.length(),e=0,f=" ",p=" ",l=h.nextSetBit(0);0<=l;l=h.nextSetBit(l+1)){for(var q=b[l];m<g&&!JU.PT.isDigit(f=d.charAt(m++)););for(e=f.charCodeAt(0)-48;m<g&&JU.PT.isWhitespace(f=d.charAt(m++)););for(;m<g&&JU.PT.isWhitespace(p=d.charAt(m++)););var v=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(f.charCodeAt(0),35,90,0),s=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(p.charCodeAt(0),35,90,0),C,n;0==(e&1)?(C=q[1],n=e=q[2],q=q[0]):(C=q[0],n=q[1],0!=(e&2)?(e=n,q=q[2]):(e=q[2],q=C));a.addLast(J.jvxl.data.JvxlCoder.getContourPoint(c,
C,n,v));a.addLast(J.jvxl.data.JvxlCoder.getContourPoint(c,e,q,s))}},"JU.Lst,~A,~A");c$.getContourPoint=e(c$,"getContourPoint",function(a,b,c,d){var h=new JU.P3;h.sub2(a[c],a[b]);h.scaleAdd2(d,h,a[b]);return h},"~A,~N,~N,~N");c$.appendContourTriangleIntersection=e(c$,"appendContourTriangleIntersection",function(a,b,c,d){d.appendI(a);d.appendC(J.jvxl.data.JvxlCoder.jvxlFractionAsCharacter(b));d.appendC(J.jvxl.data.JvxlCoder.jvxlFractionAsCharacter(c))},"~N,~N,~N,JU.SB");c$.jvxlCreateColorData=e(c$,
"jvxlCreateColorData",function(a,b){if(null==b)a.jvxlColorData="";else{var c=a.isJvxlPrecisionColor,d=a.isTruncated,h=a.colorFractionBase,m=a.colorFractionRange,e=a.valueMappedToBlue,f=a.valueMappedToRed,k=0<a.saveVertexCount?a.saveVertexCount:a.vertexCount;k>b.length&&System.out.println("JVXLCODER ERROR");var p=a.mappedDataMin,l=a.mappedDataMax,q=new JU.SB,v=new JU.SB;b.length<k&&System.out.println("JVXLCOLOR OHOHO");for(var s=0;s<k;s++){var C=b[s];Float.isNaN(C)&&(C=p);d&&(C=0<C?0.999:-0.999);c?
J.jvxl.data.JvxlCoder.jvxlAppendCharacter2(C,p,l,h,m,q,v):q.appendC(J.jvxl.data.JvxlCoder.jvxlValueAsCharacter(C,f,e,h,m))}a.jvxlColorData=q.appendSB(v).appendC("\n").toString()}},"J.jvxl.data.JvxlData,~A");c$.appendXmlVertexOnlyData=e(c$,"appendXmlVertexOnlyData",function(a,b,c,d){var h=u(c.vc,0);J.jvxl.data.JvxlCoder.appendXmlTriangleData(a,c.pis,c.pc,c.bsSlabDisplay,h,d)&&J.jvxl.data.JvxlCoder.appendXmlVertexData(a,b,h,c.vs,c.vvs,c.vc,c.polygonColorData,c.pc,c.bsSlabDisplay,b.vertexColors,0<b.jvxlColorData.length,
d)},"JU.SB,J.jvxl.data.JvxlData,J.jvxl.data.MeshData,~B");c$.appendXmlTriangleData=e(c$,"appendXmlTriangleData",function(a,b,c,d,h,m){for(var e=new JU.SB,f=new JU.SB,k=1,p=0,l=0,q=!1,v=0,s=null!=d,C=0;C<c;)if(null==b[C]||s&&!d.get(C))C++;else{var n=b[C][p],n=0<h[n]?h[n]:h[n]=++l,u=n-k,k=n;0==u?(e.appendC("!"),q=!1):32<u?(q&&e.appendC("+"),e.appendI(u),q=!0):-32>u?(e.appendI(u),q=!0):(e.appendC(String.fromCharCode(92+u)),q=!1);0==++p%3&&(f.appendI(b[C][3]),p=0,C++,v++)}if(0==e.length())return!0;JU.XmlUtil.appendTagObj(a,
"jvxlTriangleData",D(-1,["count",""+v,"encoding","jvxltdiff","data",J.jvxl.data.JvxlCoder.jvxlCompressString(e.toString(),m)]),null);JU.XmlUtil.appendTagObj(a,"jvxlTriangleEdgeData",D(-1,["count",""+v,"encoding","jvxlsc","data",J.jvxl.data.JvxlCoder.jvxlCompressString(f.toString(),m)]),null);return!0},"JU.SB,~A,~N,JU.BS,~A,~B");c$.appendXmlVertexData=e(c$,"appendXmlVertexData",function(a,b,c,d,h,m,e,f,k,p,l,q){var v=b.colorFractionBase,s=b.colorFractionRange,n,K=b.boundingBox[0],x=b.boundingBox[1],
z=new JU.SB,G=new JU.SB,F=null,t=null!=k;if(0<f){t&&(f=k.cardinality());for(var t=!1,F=u(m,0),y=0;y<m;y++)0<c[y]&&(F[c[y]-1]=y)}for(y=c=0;y<m;y++)if(!t||k.get(y))c++,n=d[0==f?y:F[y]],J.jvxl.data.JvxlCoder.jvxlAppendCharacter2(n.x,K.x,x.x,v,s,z,G),J.jvxl.data.JvxlCoder.jvxlAppendCharacter2(n.y,K.y,x.y,v,s,z,G),J.jvxl.data.JvxlCoder.jvxlAppendCharacter2(n.z,K.z,x.z,v,s,z,G);z.appendSB(G);JU.XmlUtil.appendTagObj(a,"jvxlVertexData",D(-1,["count",""+c,"min",JU.Escape.eP(K),"max",JU.Escape.eP(x),"encoding",
"base90xyz2","data",J.jvxl.data.JvxlCoder.jvxlCompressString(z.toString(),q)]),null);null!=e&&JU.XmlUtil.appendTagObj(a,"jvxlPolygonColorData",D(-1,["encoding","jvxlnc","count",""+f]),"\n"+e);if(l){z=new JU.SB;G=new JU.SB;if(null==p)for(y=0;y<m;y++){if(!t||k.get(y))J.jvxl.data.JvxlCoder.jvxlAppendCharacter2(h[0==f?y:F[y]],b.mappedDataMin,b.mappedDataMax,v,s,z,G)}else{d=0;z.appendI(c).append(" ");for(y=0;y<m;y++)if(!t||k.get(y))h=p[0==f?y:F[y]],h==d?h=0:d=h,z.appendI(h),z.append(" ")}J.jvxl.data.JvxlCoder.appendXmlColorData(a,
z.appendSB(G).append("\n").toString(),null==p,!0,b.valueMappedToRed,b.valueMappedToBlue)}},"JU.SB,J.jvxl.data.JvxlData,~A,~A,~A,~N,~S,~N,JU.BS,~A,~B,~B");c$.jvxlFractionAsCharacter=e(c$,"jvxlFractionAsCharacter",function(a){return J.jvxl.data.JvxlCoder.jvxlFractionAsCharacterRange(a,35,90)},"~N");c$.jvxlFractionAsCharacterRange=e(c$,"jvxlFractionAsCharacterRange",function(a,b,c){0.9999<a?a=0.9999:Float.isNaN(a)&&(a=1.0001);a=G(Math.floor(a*c+b));return a<b?String.fromCharCode(b):92==a?"!":String.fromCharCode(a)},
"~N,~N,~N");c$.jvxlAppendCharacter2=e(c$,"jvxlAppendCharacter2",function(a,b,c,d,h,e,g){a=b==c?a:(a-b)/(c-b);b=J.jvxl.data.JvxlCoder.jvxlFractionAsCharacterRange(a,d,h);e.appendC(b);a-=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(b.charCodeAt(0),d,h,0);g.appendC(J.jvxl.data.JvxlCoder.jvxlFractionAsCharacterRange(a*h,d,h))},"~N,~N,~N,~N,~N,JU.SB,JU.SB");c$.jvxlFractionFromCharacter=e(c$,"jvxlFractionFromCharacter",function(a,b,c,d){if(a==b+c)return NaN;a<b&&(a=92);a=(a-b+d)/c;return 0>a?0:1<a?0.999999:
a},"~N,~N,~N,~N");c$.jvxlFractionFromCharacter2=e(c$,"jvxlFractionFromCharacter2",function(a,b,c,d){a=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(a,c,d,0);b=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(b,c,d,0.5);return a+b/d},"~N,~N,~N,~N");c$.jvxlValueAsCharacter=e(c$,"jvxlValueAsCharacter",function(a,b,c,d,h){return J.jvxl.data.JvxlCoder.jvxlFractionAsCharacterRange(b==c?a:(a-b)/(c-b),d,h)},"~N,~N,~N,~N,~N");c$.jvxlValueFromCharacter2=e(c$,"jvxlValueFromCharacter2",function(a,b,c,d,h,e){a=
J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter2(a,b,h,e);return d==c?a:c+a*(d-c)},"~N,~N,~N,~N,~N,~N");c$.jvxlEncodeBitSet0=e(c$,"jvxlEncodeBitSet0",function(a,b,c){var d=0,h=-1,e=0;0>b&&(b=a.length());for(var g=0,f=!1,k=b-1,p=0;p<b;++p)f==a.get(p)?d++:(d==h&&p!=k?e++:(0<e&&(c.appendC(" ").appendI(-e),e=0,g++),c.appendC(" ").appendI(d),g++,h=d),d=1,f=!f);c.appendC(" ").appendI(d).appendC("\n");return g},"JU.BS,~N,JU.SB");c$.jvxlEncodeBitSet=e(c$,"jvxlEncodeBitSet",function(a){var b=new JU.SB;J.jvxl.data.JvxlCoder.jvxlEncodeBitSetBuffer(a,
-1,b);return b.toString()},"JU.BS");c$.jvxlEncodeBitSetBuffer=e(c$,"jvxlEncodeBitSetBuffer",function(a,b,c){var d=0,h=0,e=!1;0>b&&(b=a.length());if(0==b)return 0;c.append("-");for(var g=0;g<b;++g)e==a.get(g)?d++:(J.jvxl.data.JvxlCoder.jvxlAppendEncodedNumber(c,d,35,90),h++,d=1,e=!e);J.jvxl.data.JvxlCoder.jvxlAppendEncodedNumber(c,d,35,90);c.appendC("\n");return h},"JU.BS,~N,JU.SB");c$.jvxlAppendEncodedNumber=e(c$,"jvxlAppendEncodedNumber",function(a,b,c,d){var h=b<d;for(0==b?a.appendC(String.fromCharCode(c)):
h||a.appendC(String.fromCharCode(c+d));0<b;){var e=G(b/d);b=c+b-e*d;92==b&&(b=33);a.appendC(String.fromCharCode(b));b=e}h||a.append(" ")},"JU.SB,~N,~N,~N");c$.jvxlDecodeBitSetRange=e(c$,"jvxlDecodeBitSetRange",function(a,b,c){for(var d=new JU.BS,h=0,e=0,g=!1,f=u(1,0);-2147483648!=(h=J.jvxl.data.JvxlCoder.jvxlParseEncodedInt(a,b,c,f));)g&&d.setBits(e,e+h),e+=h,g=!g;return d},"~S,~N,~N");c$.jvxlParseEncodedInt=e(c$,"jvxlParseEncodedInt",function(a,b,c,d){var h=!1,e=0,g=d[0],f=a.length;if(0>g)return-2147483648;
for(;g<f&&JU.PT.isWhitespace(a.charAt(g));)++g;if(g>=f)return-2147483648;var k=1,p=a.charCodeAt(g)==b+c;for(p&&g++;g<f&&!JU.PT.isWhitespace(a.charAt(g));){h=a.charCodeAt(g);h<b&&(h=92);e+=(h-b)*k;h=!0;++g;if(!p)break;k*=c}h||(e=-2147483648);d[0]=g;return e},"~S,~N,~N,~A");c$.jvxlDecodeBitSet=e(c$,"jvxlDecodeBitSet",function(a){if(a.startsWith("-"))return J.jvxl.data.JvxlCoder.jvxlDecodeBitSetRange(J.jvxl.data.JvxlCoder.jvxlDecompressString(a.substring(1)),35,90);for(var b=new JU.BS,c=0,d=0,h=0,e=
0,g=!1,f=u(1,0);;){c=0>h++?c:JU.PT.parseIntNext(a,f);if(-2147483648==c)break;0>c?(h=c,c=d):(g&&b.setBits(e,e+c),e+=c,d=c,g=!g)}return b},"~S");c$.jvxlCompressString=e(c$,"jvxlCompressString",function(a,b){if(0<=a.indexOf("~"))return a;for(var c=new JU.SB,d="\x00",h=!1,e=!1,g=0,f=a.length,k=0;k<=f;k++){var p=k==f?"\x00":a.charAt(k);switch(p){case "\n":case "\r":continue;case "&":case "<":h=b;break;default:h=!1}if(p==d)++g,p="\x00";else if(0<g||e){if(4>g&&!e||" "==d||"\t"==d)for(;0<=--g;)c.appendC(d);
else e?e=!1:c.appendC("~"),c.appendI(g),c.appendC(" ");g=0}"\x00"!=p&&(h?(e=!0,c.appendC("~"),d=p,p=String.fromCharCode(p.charCodeAt(0)-1)):d=p,c.appendC(p))}return c.toString()},"~S,~B");c$.jvxlDecompressString=e(c$,"jvxlDecompressString",function(a){if(0>a.indexOf("~"))return a;for(var b=new JU.SB,c="\x00",d=u(1,0),h=0;h<a.length;h++){var e=a.charAt(h);if("~"==e)switch(d[0]=++h,e=a.charAt(h)){case ";":case "%":d[0]++,b.appendC(c=String.fromCharCode(e.charCodeAt(0)+1));case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":h=
JU.PT.parseIntNext(a,d);for(e=0;e<h;e++)b.appendC(c);h=d[0];continue;case "~":--h;break;default:JU.Logger.error("Error uncompressing string "+a.substring(0,h)+"?")}b.appendC(e);c=e}return b.toString()},"~S");c$.jvxlCreateHeaderWithoutTitleOrAtoms=e(c$,"jvxlCreateHeaderWithoutTitleOrAtoms",function(a,b){J.jvxl.data.JvxlCoder.jvxlCreateHeader(a,b)},"J.jvxl.data.VolumeData,JU.SB");c$.jvxlCreateHeader=e(c$,"jvxlCreateHeader",function(a,b){a.setVolumetricXml();0==b.length()&&b.append("Line 1\nLine 2\n")},
"J.jvxl.data.VolumeData,JU.SB");$(c$,"JVXL_VERSION1","2.0","JVXL_VERSION_XML","2.3","haveXMLUtil",!1,"CONTOUR_NPOLYGONS",0,"CONTOUR_BITSET",1,"CONTOUR_VALUE",2,"CONTOUR_COLIX",3,"CONTOUR_COLOR",4,"CONTOUR_FDATA",5,"CONTOUR_POINTS",6,"defaultEdgeFractionBase",35,"defaultEdgeFractionRange",90,"defaultColorFractionBase",35,"defaultColorFractionRange",90)});F("J.jvxl.data");L(["JU.M3","$.P3","$.V3"],"J.jvxl.data.VolumeData",["java.lang.Float","java.util.Hashtable","JU.SB","JU.Escape","$.Logger"],function(){c$=
M(function(){this.sr=null;this.doIterate=!0;this.voxelCounts=this.volumetricVectors=this.origin=this.volumetricOrigin=null;this.nPoints=0;this.volumetricVectorLengths=this.voxelMap=this.voxelData=null;this.yzCount=this.minToPlaneDistance=this.maxVectorLength=0;this.thePlane=this.inverseMatrix=this.volumetricMatrix=this.unitVolumetricVectors=null;this.thePlaneNormalMag=0;this.mappingPlane=this.xmlData=this.ptXyzTemp=null;this.voxelVolume=this.maxGrid=this.minGrid=this.mappingPlaneNormalMag=0;this.spanningVectors=
null;this.isSquared=this.isPeriodic=!1;this.ptTemp=this.edgeVector=null;N(this,arguments)},J.jvxl.data,"VolumeData");Z(c$,function(){this.volumetricOrigin=new JU.P3;this.origin=x(3,0);this.volumetricVectors=Array(3);this.voxelCounts=u(3,0);this.volumetricVectorLengths=x(3,0);this.unitVolumetricVectors=Array(3);this.volumetricMatrix=new JU.M3;this.inverseMatrix=new JU.M3;this.ptXyzTemp=new JU.P3;this.edgeVector=new JU.V3;this.ptTemp=new JU.P3});e(c$,"getVoxelData",function(){return this.voxelData});
e(c$,"setVoxelDataAsArray",function(a){this.voxelData=a;null!=a&&(this.sr=null)},"~A");e(c$,"hasPlane",function(){return null!=this.thePlane});R(c$,function(){this.volumetricVectors[0]=new JU.V3;this.volumetricVectors[1]=new JU.V3;this.volumetricVectors[2]=new JU.V3;this.unitVolumetricVectors[0]=new JU.V3;this.unitVolumetricVectors[1]=new JU.V3;this.unitVolumetricVectors[2]=new JU.V3});e(c$,"setMappingPlane",function(a){this.mappingPlane=a;null!=a&&(this.mappingPlaneNormalMag=Math.sqrt(a.x*a.x+a.y*
a.y+a.z*a.z))},"JU.P4");e(c$,"distanceToMappingPlane",function(a){return(this.mappingPlane.x*a.x+this.mappingPlane.y*a.y+this.mappingPlane.z*a.z+this.mappingPlane.w)/this.mappingPlaneNormalMag},"JU.T3");e(c$,"setVolumetricOrigin",function(a,b,c){this.volumetricOrigin.set(a,b,c)},"~N,~N,~N");e(c$,"getOriginFloat",function(){return this.origin});e(c$,"getYzCount",function(){this.minGrid=this.volumetricVectors[0].length();this.minGrid=Math.min(this.minGrid,this.volumetricVectors[1].length());this.minGrid=
Math.min(this.minGrid,this.volumetricVectors[2].length());this.maxGrid=this.volumetricVectors[0].length();this.maxGrid=Math.max(this.maxGrid,this.volumetricVectors[1].length());this.maxGrid=Math.max(this.maxGrid,this.volumetricVectors[2].length());this.nPoints=this.voxelCounts[0]*this.voxelCounts[1]*this.voxelCounts[2];return this.yzCount=this.voxelCounts[1]*this.voxelCounts[2]});e(c$,"getVolumetricVectorLengths",function(){return this.volumetricVectorLengths});e(c$,"setVolumetricVector",function(a,
b,c,d){this.volumetricVectors[a].x=b;this.volumetricVectors[a].y=c;this.volumetricVectors[a].z=d;this.setUnitVectors()},"~N,~N,~N,~N");e(c$,"getVoxelCounts",function(){return this.voxelCounts});e(c$,"setVoxelCounts",function(a,b,c){this.voxelCounts[0]=a;this.voxelCounts[1]=b;this.voxelCounts[2]=c;return a*b*c},"~N,~N,~N");e(c$,"getVoxelDataAt",function(a){var b=G(a/this.yzCount);a-=b*this.yzCount;var c=G(a/this.voxelCounts[2]);return this.voxelData[b][c][a-c*this.voxelCounts[2]]},"~N");e(c$,"getPointIndex",
function(a,b,c){return a*this.yzCount+b*this.voxelCounts[2]+c},"~N,~N,~N");e(c$,"getPoint",function(a,b){var c=G(a/this.yzCount);a-=c*this.yzCount;var d=G(a/this.voxelCounts[2]);this.voxelPtToXYZ(c,d,a-d*this.voxelCounts[2],b)},"~N,JU.P3");e(c$,"setVoxelData",function(a,b){var c=G(a/this.yzCount);a-=c*this.yzCount;var d=G(a/this.voxelCounts[2]);this.voxelData[c][d][a-d*this.voxelCounts[2]]=b},"~N,~N");e(c$,"setVoxelMap",function(){this.voxelMap=new java.util.Hashtable;this.getYzCount()});e(c$,"setMatrix",
function(){for(var a=0;3>a;a++)this.volumetricMatrix.setColumnV(a,this.volumetricVectors[a]);try{this.inverseMatrix.invertM(this.volumetricMatrix)}catch(b){if(S(b,Exception))return JU.Logger.error("VolumeData error setting matrix -- bad unit vectors? "),!1;throw b;}return!0});e(c$,"transform",function(a,b){this.volumetricMatrix.rotate2(a,b)},"JU.V3,JU.V3");e(c$,"setPlaneParameters",function(a){this.thePlane=a;this.thePlaneNormalMag=Math.sqrt(a.x*a.x+a.y*a.y+a.z*a.z)},"JU.P4");e(c$,"calcVoxelPlaneDistance",
function(a,b,c){this.voxelPtToXYZ(a,b,c,this.ptXyzTemp);return this.distancePointToPlane(this.ptXyzTemp)},"~N,~N,~N");e(c$,"getToPlaneParameter",function(){return Math.sqrt(this.thePlane.x*this.thePlane.x+this.thePlane.y*this.thePlane.y+this.thePlane.z*this.thePlane.z)*this.minToPlaneDistance});e(c$,"isNearPlane",function(a,b,c,d){this.voxelPtToXYZ(a,b,c,this.ptXyzTemp);return this.thePlane.x*this.ptXyzTemp.x+this.thePlane.y*this.ptXyzTemp.y+this.thePlane.z*this.ptXyzTemp.z+this.thePlane.w<d},"~N,~N,~N,~N");
e(c$,"distancePointToPlane",function(a){return(this.thePlane.x*a.x+this.thePlane.y*a.y+this.thePlane.z*a.z+this.thePlane.w)/this.thePlaneNormalMag},"JU.T3");e(c$,"voxelPtToXYZ",function(a,b,c,d){d.scaleAdd2(a,this.volumetricVectors[0],this.volumetricOrigin);d.scaleAdd2(b,this.volumetricVectors[1],d);d.scaleAdd2(c,this.volumetricVectors[2],d)},"~N,~N,~N,JU.T3");e(c$,"setUnitVectors",function(){this.maxVectorLength=0;this.voxelVolume=1;for(var a=0;3>a;a++){var b=this.volumetricVectorLengths[a]=this.volumetricVectors[a].length();
if(0==b)return!1;b>this.maxVectorLength&&(this.maxVectorLength=b);this.voxelVolume*=b;this.unitVolumetricVectors[a].setT(this.volumetricVectors[a]);this.unitVolumetricVectors[a].normalize()}this.minToPlaneDistance=2*this.maxVectorLength;this.origin[0]=this.volumetricOrigin.x;this.origin[1]=this.volumetricOrigin.y;this.origin[2]=this.volumetricOrigin.z;this.spanningVectors=Array(4);this.spanningVectors[0]=JU.V3.newV(this.volumetricOrigin);for(a=0;3>a;a++)b=this.spanningVectors[a+1]=new JU.V3,b.scaleAdd2(this.voxelCounts[a]-
1,this.volumetricVectors[a],b);return this.setMatrix()});e(c$,"xyzToVoxelPt",function(a,b,c,d){this.ptXyzTemp.set(a,b,c);this.ptXyzTemp.sub(this.volumetricOrigin);this.inverseMatrix.rotate(this.ptXyzTemp);d.set(Math.round(this.ptXyzTemp.x),Math.round(this.ptXyzTemp.y),Math.round(this.ptXyzTemp.z))},"~N,~N,~N,JU.T3i");e(c$,"lookupInterpolatedVoxelValue",function(a,b){if(null!=this.mappingPlane)return this.distanceToMappingPlane(a);if(null!=this.sr){var c=this.sr.getValueAtPoint(a,b);return this.isSquared?
c*c:c}this.ptXyzTemp.sub2(a,this.volumetricOrigin);this.inverseMatrix.rotate(this.ptXyzTemp);var d,h=this.indexLower(this.ptXyzTemp.x,d=this.voxelCounts[0]-1),e=this.indexUpper(this.ptXyzTemp.x,h,d),g=this.indexLower(this.ptXyzTemp.y,d=this.voxelCounts[1]-1),f=this.indexUpper(this.ptXyzTemp.y,g,d),c=this.indexLower(this.ptXyzTemp.z,d=this.voxelCounts[2]-1),k=this.indexUpper(this.ptXyzTemp.z,c,d);d=J.jvxl.data.VolumeData.getFractional2DValue(this.mantissa(this.ptXyzTemp.x-h),this.mantissa(this.ptXyzTemp.y-
g),this.getVoxelValue(h,g,c),this.getVoxelValue(e,g,c),this.getVoxelValue(h,f,c),this.getVoxelValue(e,f,c));h=J.jvxl.data.VolumeData.getFractional2DValue(this.mantissa(this.ptXyzTemp.x-h),this.mantissa(this.ptXyzTemp.y-g),this.getVoxelValue(h,g,k),this.getVoxelValue(e,g,k),this.getVoxelValue(h,f,k),this.getVoxelValue(e,f,k));return d+this.mantissa(this.ptXyzTemp.z-c)*(h-d)},"JU.T3,~B");e(c$,"mantissa",function(a){return this.isPeriodic?a-Math.floor(a):a},"~N");e(c$,"getVoxelValue",function(a,b,c){if(null==
this.voxelMap)return this.voxelData[a][b][c];a=this.voxelMap.get(Integer.$valueOf(this.getPointIndex(a,b,c)));return null==a?NaN:a.floatValue()},"~N,~N,~N");c$.getFractional2DValue=e(c$,"getFractional2DValue",function(a,b,c,d,h,e){c+=a*(d-c);return c+b*(h+a*(e-h)-c)},"~N,~N,~N,~N,~N,~N");e(c$,"indexLower",function(a,b){if(this.isPeriodic&&0<b){for(;0>a;)a+=b;for(;a>=b;)a-=b;return G(Math.floor(a))}if(0>a)return 0;var c=G(Math.floor(a));return c>b?b:c},"~N,~N");e(c$,"indexUpper",function(a,b,c){return!this.isPeriodic&&
0>a||b==c?b:b+1},"~N,~N,~N");e(c$,"offsetCenter",function(a){var b=new JU.P3;b.scaleAdd2((this.voxelCounts[0]-1)/2,this.volumetricVectors[0],b);b.scaleAdd2((this.voxelCounts[1]-1)/2,this.volumetricVectors[1],b);b.scaleAdd2((this.voxelCounts[2]-1)/2,this.volumetricVectors[2],b);this.volumetricOrigin.sub2(a,b)},"JU.P3");e(c$,"setDataDistanceToPlane",function(a){this.setPlaneParameters(a);a=this.voxelCounts[0];var b=this.voxelCounts[1],c=this.voxelCounts[2];this.voxelData=x(a,b,c,0);for(var d=0;d<a;d++)for(var h=
0;h<b;h++)for(var e=0;e<c;e++)this.voxelData[d][h][e]=this.calcVoxelPlaneDistance(d,h,e)},"JU.P4");e(c$,"filterData",function(a,b){var c=!Float.isNaN(b);if(null!=this.sr)this.isSquared=a;else{var d=this.voxelCounts[0],h=this.voxelCounts[1],e=this.voxelCounts[2];if(a)for(var g=0;g<d;g++)for(var f=0;f<h;f++)for(var k=0;k<e;k++)this.voxelData[g][f][k]*=this.voxelData[g][f][k];if(c)for(g=0;g<d;g++)for(f=0;f<h;f++)for(k=0;k<e;k++)this.voxelData[g][f][k]=b-this.voxelData[g][f][k]}},"~B,~N");e(c$,"capData",
function(a,b){if(null!=this.voxelData){var c=this.voxelCounts[0],d=this.voxelCounts[1],h=this.voxelCounts[2],e=JU.V3.new3(a.x,a.y,a.z);e.normalize();for(var g=0;g<c;g++)for(var f=0;f<d;f++)for(var k=0;k<h;k++){var p=this.voxelData[g][f][k]-b;this.voxelPtToXYZ(g,f,k,this.ptXyzTemp);var l=(this.ptXyzTemp.x*e.x+this.ptXyzTemp.y*e.y+this.ptXyzTemp.z*e.z+a.w-b)/1;if(0<=l||l>p)this.voxelData[g][f][k]=l}}},"JU.P4,~N");e(c$,"setVolumetricXml",function(){var a=new JU.SB;if(0==this.voxelCounts[0])a.append("<jvxlVolumeData>\n");
else{a.append('<jvxlVolumeData origin="'+JU.Escape.eP(this.volumetricOrigin)+'">\n');for(var b=0;3>b;b++)a.append('<jvxlVolumeVector type="'+b+'" count="'+this.voxelCounts[b]+'" vector="'+JU.Escape.eP(this.volumetricVectors[b])+'"></jvxlVolumeVector>\n')}a.append("</jvxlVolumeData>\n");return this.xmlData=a.toString()});e(c$,"setVoxelMapValue",function(a,b,c,d){null!=this.voxelMap&&this.voxelMap.put(Integer.$valueOf(this.getPointIndex(a,b,c)),Float.$valueOf(d))},"~N,~N,~N,~N");e(c$,"calculateFractionalPoint",
function(a,b,c,d,h,e){var g=h-d,f=(a-d)/g;this.edgeVector.sub2(c,b);e.scaleAdd2(f,this.edgeVector,b);if(null==this.sr||!this.doIterate||h==d||0.01>f||0.99<f||0.01>this.edgeVector.length())return a;b=0;this.ptTemp.setT(e);c=this.lookupInterpolatedVoxelValue(this.ptTemp,!1);for(h=NaN;10>++b;){var k=(c-d)/g;if(0>k||1<k)break;k=(a-c)/g/2;f+=k;if(0>f||1<f)break;e.setT(this.ptTemp);h=c;if(0.005>Math.abs(k))break;this.ptTemp.scaleAdd2(k,this.edgeVector,e);c=this.lookupInterpolatedVoxelValue(this.ptTemp,
!1)}return h},"~N,JU.P3,JU.P3,~N,~N,JU.P3")});F("J.jvxl.data");L(null,"J.jvxl.data.JvxlData",["java.lang.Float","JU.SB","J.jvxl.data.JvxlCoder"],function(){c$=M(function(){this.msg="";this.wasCubic=this.wasJvxl=!1;this.jvxlPlane=this.jvxlExcluded=this.jvxlVolumeDataXml=this.jvxlColorData=this.jvxlEdgeData=this.jvxlSurfaceData=this.jvxlFileMessage=this.jvxlFileTitle=null;this.isColorReversed=this.jvxlDataIsColorDensity=this.jvxlDataIs2dContour=this.jvxlDataIsColorMapped=this.isJvxlPrecisionColor=!1;
this.thisSet=-2147483648;this.edgeFractionBase=35;this.edgeFractionRange=90;this.colorFractionBase=35;this.colorFractionRange=90;this.isValid=!0;this.vertexDataOnly=this.isModelConnected=this.isCutoffAbsolute=this.isTruncated=this.isBicolorMap=this.isContoured=this.isXLowToHigh=this.insideOut=!1;this.vertexCount=this.nSurfaceInts=this.nEdges=this.nContours=this.nBytes=this.nPointsZ=this.nPointsY=this.nPointsX=this.pointsPerAngstrom=this.cutoff=this.valueMappedToBlue=this.valueMappedToRed=this.mappedDataMax=
this.mappedDataMin=0;this.contourValuesUsed=this.contourValues=this.contourColors=this.contourColixes=this.vContours=null;this.thisContour=-1;this.scale3d=0;this.minColorIndex=-1;this.maxColorIndex=0;this.boundingBox=this.version=this.title=null;this.excludedVertexCount=this.excludedTriangleCount=0;this.colorDensity=!1;this.pointSize=0;this.moleculeXml=null;this.saveVertexCount=this.dataMax=this.dataMin=0;this.vertexColorMap=null;this.nVertexColors=0;this.meshColor=this.color=this.vertexColors=null;
this.translucency=0;this.rendering=this.colorScheme=null;this.slabValue=-2147483648;this.isSlabbable=!1;this.diameter=0;this.slabInfo=null;this.allowVolumeRender=!1;this.voxelVolume=0;this.baseColor=this.fixedLattice=this.mapLattice=null;this.integration=NaN;N(this,arguments)},J.jvxl.data,"JvxlData");Z(c$,function(){this.jvxlExcluded=Array(4)});R(c$,function(){});e(c$,"clear",function(){this.allowVolumeRender=!0;this.jvxlVolumeDataXml=this.jvxlColorData=this.jvxlEdgeData=this.jvxlSurfaceData="";this.colorScheme=
this.color=null;this.colorDensity=!1;this.pointSize=NaN;this.contourColors=this.contourColixes=this.contourValuesUsed=this.contourValues=null;this.integration=NaN;this.isSlabbable=!1;this.isValid=!0;this.meshColor=this.mapLattice=null;this.msg="";this.nVertexColors=this.nPointsX=0;this.slabInfo=this.fixedLattice=null;this.thisSet=this.slabValue=-2147483648;this.rendering=null;this.thisContour=-1;this.translucency=0;this.vertexColors=this.vertexColorMap=this.vContours=null;this.voxelVolume=0});e(c$,
"setSurfaceInfo",function(a,b,c,d){this.jvxlSurfaceData=d;0==this.jvxlSurfaceData.indexOf("--")&&(this.jvxlSurfaceData=this.jvxlSurfaceData.substring(2));this.jvxlPlane=a;this.mapLattice=b;this.nSurfaceInts=c},"JU.P4,JU.P3,~N,~S");e(c$,"setSurfaceInfoFromBitSet",function(a,b){this.setSurfaceInfoFromBitSetPts(a,b,null)},"JU.BS,JU.P4");e(c$,"setSurfaceInfoFromBitSetPts",function(a,b,c){var d=new JU.SB;a=null!=b?0:J.jvxl.data.JvxlCoder.jvxlEncodeBitSetBuffer(a,this.nPointsX*this.nPointsY*this.nPointsZ,
d);this.setSurfaceInfo(b,c,a,d.toString())},"JU.BS,JU.P4,JU.P3");e(c$,"jvxlUpdateInfo",function(a,b){this.title=a;this.nBytes=b},"~A,~N");c$.updateSurfaceData=e(c$,"updateSurfaceData",function(a,b,c,d,h){if(0==a.length)return"";a=a.toCharArray();for(var e=0,g=0;e<c;e+=d,g++)Float.isNaN(b[e])&&(a[g]=h);return String.copyValueOf(a)},"~S,~A,~N,~N,~S")});F("J.jvxl.data");L(["JU.MeshSurface"],"J.jvxl.data.MeshData",["java.lang.Float","java.util.Arrays","JU.AU","$.BS","$.V3"],function(){c$=M(function(){this.setsSuccessful=
!1;this.vertexIncrement=1;this.polygonColorData=null;pa("J.jvxl.data.MeshData.SSet")||J.jvxl.data.MeshData.$MeshData$SSet$();pa("J.jvxl.data.MeshData.SortSet")||J.jvxl.data.MeshData.$MeshData$SortSet$();N(this,arguments)},J.jvxl.data,"MeshData",JU.MeshSurface);e(c$,"addVertexCopy",function(a,b,c,d){0>c&&(this.vertexIncrement=-c);return this.addVCVal(a,b,d)},"JU.T3,~N,~N,~B");e(c$,"getSurfaceSet",function(){return null==this.surfaceSet?this.getSurfaceSetForLevel(0):this.surfaceSet});e(c$,"getSurfaceSetForLevel",
function(a){0==a&&(this.surfaceSet=Array(100),this.nSets=0);this.setsSuccessful=!0;for(var b=0;b<this.pc;b++)if(null!=this.pis[b]&&(null==this.bsSlabDisplay||this.bsSlabDisplay.get(b))){var c=this.pis[b],d=this.findSet(c[0]),h=this.findSet(c[1]),e=this.findSet(c[2]);0>d&&0>h&&0>e?this.createSet(c[0],c[1],c[2]):d==h&&h==e||(0<=d?(this.surfaceSet[d].set(c[1]),this.surfaceSet[d].set(c[2]),0<=h&&h!=d&&this.mergeSets(d,h),0<=e&&(e!=d&&e!=h)&&this.mergeSets(d,e)):0<=h?(this.surfaceSet[h].set(c[0]),this.surfaceSet[h].set(c[2]),
0<=e&&e!=h&&this.mergeSets(h,e)):(this.surfaceSet[e].set(c[0]),this.surfaceSet[e].set(c[1])))}for(b=c=0;b<this.nSets;b++)null!=this.surfaceSet[b]&&c++;d=Array(this.surfaceSet.length);for(b=c=0;b<this.nSets;b++)null!=this.surfaceSet[b]&&(d[c++]=this.surfaceSet[b]);this.nSets=c;this.surfaceSet=d;!this.setsSuccessful&&2>a&&this.getSurfaceSetForLevel(a+1);if(0==a){a=Array(this.nSets);for(b=0;b<this.nSets;b++)a[b]=ja(J.jvxl.data.MeshData.SSet,this,null,this.surfaceSet[b]);java.util.Arrays.sort(a,ja(J.jvxl.data.MeshData.SortSet,
this,null));for(b=0;b<this.nSets;b++)this.surfaceSet[b]=a[b].bs;this.setVertexSets(!1)}return this.surfaceSet},"~N");e(c$,"setVertexSets",function(a){if(null!=this.surfaceSet){for(var b=0,c=0;c<this.nSets;c++)null!=this.surfaceSet[c]&&0>this.surfaceSet[c].nextSetBit(0)&&(this.surfaceSet[c]=null),null==this.surfaceSet[c]&&b++;if(0<b){a=Array(this.nSets-b);for(var d=c=0;c<this.nSets;c++)null!=this.surfaceSet[c]&&(a[d++]=this.surfaceSet[c]);this.surfaceSet=a;this.nSets-=b}else if(a)return;this.vertexSets=
u(this.vc,0);for(c=0;c<this.nSets;c++)for(b=this.surfaceSet[c].nextSetBit(0);0<=b;b=this.surfaceSet[c].nextSetBit(b+1))this.vertexSets[b]=c}},"~B");e(c$,"findSet",function(a){for(var b=0;b<this.nSets;b++)if(null!=this.surfaceSet[b]&&this.surfaceSet[b].get(a))return b;return-1},"~N");e(c$,"createSet",function(a,b,c){var d;for(d=0;d<this.nSets&&null!=this.surfaceSet[d];d++);d==this.surfaceSet.length&&(this.surfaceSet=JU.AU.ensureLength(this.surfaceSet,this.surfaceSet.length+100));this.surfaceSet[d]=
new JU.BS;this.surfaceSet[d].set(a);this.surfaceSet[d].set(b);this.surfaceSet[d].set(c);d==this.nSets&&this.nSets++},"~N,~N,~N");e(c$,"mergeSets",function(a,b){this.surfaceSet[a].or(this.surfaceSet[b]);this.surfaceSet[b]=null},"~N,~N");e(c$,"invalidateSurfaceSet",function(a){for(var b=this.surfaceSet[a].nextSetBit(0);0<=b;b=this.surfaceSet[a].nextSetBit(b+1))this.vvs[b]=NaN;this.surfaceSet[a]=null},"~N");c$.checkCutoff=e(c$,"checkCutoff",function(a,b,c,d){if(0>a||0>b||0>c)return!1;a=d[a];b=d[b];c=
d[c];return 0<=a&&0<=b&&0<=c||0>=a&&0>=b&&0>=c},"~N,~N,~N,~A");c$.calculateVolumeOrArea=e(c$,"calculateVolumeOrArea",function(a,b,c,d){(d||0>=a.nSets)&&a.getSurfaceSet();for(var h=(d=-1<=b)||0>=a.nSets?1:a.nSets,e=db(h,0),g=new JU.V3,f=new JU.V3,k=new JU.V3,p=a.pc;0<=--p;)if(null!=a.setABC(p)){var l=0>=a.nSets?0:a.vertexSets[a.iA];0<=b&&l!=b||(c?(g.sub2(a.vs[a.iB],a.vs[a.iA]),f.sub2(a.vs[a.iC],a.vs[a.iA]),k.cross(g,f),e[d?0:l]+=k.length()):(g.setT(a.vs[a.iB]),f.setT(a.vs[a.iC]),k.cross(g,f),f.setT(a.vs[a.iA]),
e[d?0:l]+=f.dot(k)))}a=c?2:6;for(p=0;p<h;p++)e[p]/=a;return d?Float.$valueOf(e[0]):e},"J.jvxl.data.MeshData,~N,~B,~B");e(c$,"updateInvalidatedVertices",function(a){a.clearAll();for(var b=0;b<this.vc;b+=this.vertexIncrement)Float.isNaN(this.vvs[b])&&a.set(b)},"JU.BS");e(c$,"invalidateVertices",function(a){for(var b=a.nextSetBit(0);0<=b;b=a.nextSetBit(b+1))this.vvs[b]=NaN},"JU.BS");c$.$MeshData$SSet$=function(){ia(self.c$);c$=M(function(){ra(this,arguments);this.bs=null;this.n=0;N(this,arguments)},
J.jvxl.data.MeshData,"SSet");R(c$,function(a){this.bs=a;this.n=a.cardinality()},"JU.BS");c$=qa()};c$.$MeshData$SortSet$=function(){ia(self.c$);c$=M(function(){ra(this,arguments);N(this,arguments)},J.jvxl.data.MeshData,"SortSet",null,java.util.Comparator);n(c$,"compare",function(a,b){return a.n>b.n?-1:a.n<b.n?1:0},"J.jvxl.data.MeshData.SSet,J.jvxl.data.MeshData.SSet");c$=qa()};$(c$,"MODE_GET_VERTICES",1,"MODE_GET_COLOR_INDEXES",2,"MODE_PUT_SETS",3,"MODE_PUT_VERTICES",4)});F("J.jvxl.readers");L(null,
"J.jvxl.readers.XmlReader",["JU.P3","$.PT","$.SB","JU.Escape"],function(){c$=M(function(){this.line=this.br=null;N(this,arguments)},J.jvxl.readers,"XmlReader");e(c$,"getLine",function(){return this.line});R(c$,function(a){this.br=a},"java.io.BufferedReader");e(c$,"toTag",function(a){this.skipTo("<"+a);if(null==this.line)return"";var b=this.line.indexOf("<"+a)+a.length+1;if(b==this.line.length||" "==this.line.charAt(b)||">"==this.line.charAt(b))return this.line;this.line=null;return this.toTag(a)},
"~S");e(c$,"skipTag",function(a){this.skipTo("</"+a+">")},"~S");e(c$,"getXmlData",function(a,b,c,d){var h="</"+a+">";a="<"+a;if(null==b){b=new JU.SB;try{null==this.line&&(this.line=this.br.readLine());for(;0>this.line.indexOf(a);)this.line=this.br.readLine()}catch(e){if(S(e,Exception))return null;throw e;}b.append(this.line);var g=!1,f=this.line.indexOf("/>"),k=this.line.indexOf(">");if(0>k||f==k-1)g=d;for(;0>this.line.indexOf(h)&&(!g||0>this.line.indexOf("/>"));)b.append(this.line=this.br.readLine());
b=b.toString()}return J.jvxl.readers.XmlReader.extractTag(b,a,h,c)},"~S,~S,~B,~B");c$.extractTagOnly=e(c$,"extractTagOnly",function(a,b){return J.jvxl.readers.XmlReader.extractTag(a,"<"+b+">","</"+b+">",!1)},"~S,~S");c$.extractTag=e(c$,"extractTag",function(a,b,c,d){b=a.indexOf(b);if(0>b)return"";var h=a.indexOf(c,b);0>h&&(h=a.indexOf("/>",b),c="/>");if(0>h)return"";if(d)return h+=c.length,a.substring(b,h);for(c=!1;b<h;b++)if('"'==(d=a.charAt(b)))c=!c;else if(c&&"\\"==d)b++;else if(!c&&(">"==d||"/"==
d))break;if(b>=h)return"";for(;JU.PT.isWhitespace(a.charAt(++b)););return J.jvxl.readers.XmlReader.unwrapCdata(a.substring(b,h))},"~S,~S,~S,~B");c$.unwrapCdata=e(c$,"unwrapCdata",function(a){return a.startsWith("<![CDATA[")&&a.endsWith("]]\x3e")?JU.PT.rep(a.substring(9,a.length-3),"]]]]\x3e<![CDATA[>","]]\x3e"):a},"~S");c$.getXmlAttrib=e(c$,"getXmlAttrib",function(a,b){var c=u(1,0),d=J.jvxl.readers.XmlReader.setNext(a,b,c,1);if(2>d||2>(d=J.jvxl.readers.XmlReader.setNext(a,'"',c,0)))return"";c=J.jvxl.readers.XmlReader.setNext(a,
'"',c,-1);return 0>=c?"":a.substring(d,c)},"~S,~S");e(c$,"getXmlPoint",function(a,b){var c=J.jvxl.readers.XmlReader.getXmlAttrib(a,b).$replace("(","{").$replace(")","}"),c=JU.Escape.uP(c);return U(c,JU.P3)?c:new JU.P3},"~S,~S");c$.setNext=e(c$,"setNext",function(a,b,c,d){var h=c[0];if(0>h||0>(h=a.indexOf(b,c[0])))return-1;h+=b.length;c[0]=h+d;return 0<d&&h<a.length&&"="!=a.charAt(h)?J.jvxl.readers.XmlReader.setNext(a,b,c,d):c[0]},"~S,~S,~A,~N");e(c$,"skipTo",function(a){null==this.line&&(this.line=
this.br.readLine());for(;null!=this.line&&0>this.line.indexOf(a);)this.line=this.br.readLine()},"~S");e(c$,"isNext",function(a){if(null==this.line||0<=this.line.indexOf("</")&&this.line.indexOf("</")==this.line.indexOf("<"))this.line=this.br.readLine();return 0<=this.line.indexOf("<"+a)},"~S")});F("J.jvxl.readers");L(["JU.P3","$.V3"],"J.jvxl.readers.SurfaceGenerator","java.lang.Float java.util.Map JU.AU $.BS $.Measure $.P4 $.PT $.Rdr J.jvxl.data.JvxlData $.MeshData $.VolumeData J.jvxl.readers.Parameters $.SurfaceReader JU.Logger JV.FileManager".split(" "),
function(){c$=M(function(){this.version=this.marchingSquares=this.atomDataServer=this.meshDataServer=this.volumeDataTemp=this.meshData=this.jvxlData=this.params=null;this.isValid=!0;this.bsVdw=this.fileType=null;this.colorPtr=0;this.ptRef=this.vNorm=this.vAB=this.readerData=this.out=this.surfaceReader=null;N(this,arguments)},J.jvxl.readers,"SurfaceGenerator");Z(c$,function(){this.vAB=new JU.V3;this.vNorm=new JU.V3;this.ptRef=JU.P3.new3(0,0,1E15)});R(c$,function(a,b,c,d){this.atomDataServer=a;this.meshDataServer=
b;this.params=new J.jvxl.readers.Parameters;this.meshData=null==c?new J.jvxl.data.MeshData:c;this.jvxlData=null==d?new J.jvxl.data.JvxlData:d;this.volumeDataTemp=new J.jvxl.data.VolumeData;this.initializeIsosurface()},"J.atomdata.AtomDataServer,J.jvxl.api.MeshDataServer,J.jvxl.data.MeshData,J.jvxl.data.JvxlData");e(c$,"setJvxlData",function(a){this.jvxlData=a;null!=a&&(a.version=this.version)},"J.jvxl.data.JvxlData");e(c$,"setProp",function(a,b){if("debug"===a){var c=b.booleanValue();this.params.logMessages=
c;this.params.logCube=c;return!0}if("init"===a)return this.initializeIsosurface(),U(b,J.jvxl.readers.Parameters)?this.params=b:(this.params.script=b,null!=this.params.script&&0<=this.params.script.indexOf(";#")&&(this.params.script=JU.PT.rep(this.params.script,";#","; #"))),!1;if("silent"===a)return this.params.isSilent=!0;if("map"===a)return this.params.resetForMapping(b.booleanValue()),null!=this.surfaceReader&&(this.surfaceReader.minMax=null),!0;if("finalize"===a)return this.initializeIsosurface(),
!0;if("clear"===a)return null!=this.surfaceReader&&this.surfaceReader.discardTempData(!0),!1;if("fileIndex"===a)return this.params.fileIndex=b.intValue(),0>this.params.fileIndex&&(this.params.fileIndex=0),this.params.readAllData=!1,!0;if("blockData"===a)return this.params.blockCubeData=b.booleanValue(),!0;if("withinPoints"===a)return this.params.boundingBox=b[1],!0;if("boundingBox"===a)return this.params.boundingBox=D(-1,[JU.P3.newP(b[0]),JU.P3.newP(b[b.length-1])]),!0;if("func"===a)return this.params.func=
b,!0;if("intersection"===a)return this.params.intersection=b,!0;if("bsSolvent"===a)return this.params.bsSolvent=b,!0;if("select"===a)return this.params.bsSelected=b,!0;if("ignore"===a)return this.params.bsIgnore=b,!0;if("propertySmoothing"===a)return this.params.propertySmoothing=b.booleanValue(),!0;if("propertyDistanceMax"===a)return this.params.propertyDistanceMax=b.floatValue(),!0;if("propertySmoothingPower"===a)return this.params.propertySmoothingPower=b.intValue(),!0;if("title"===a){if(null==
b)this.params.title=null;else if(JU.AU.isAS(b)&&(this.params.title=b,JU.Logger.debugging))for(var d=0;d<this.params.title.length;d++)0<this.params.title[d].length&&JU.Logger.info(this.params.title[d]);return!0}if("sigma"===a)return this.params.cutoff=this.params.sigma=b.floatValue(),this.params.isPositiveOnly=!1,this.params.cutoffAutomatic=!1,!0;if("cutoff"===a)return this.params.cutoff=b.floatValue(),this.params.isPositiveOnly=!1,this.params.cutoffAutomatic=!1,!0;if("parameters"===a)return this.params.parameters=
JU.AU.ensureLengthA(b,2),0<this.params.parameters.length&&0!=this.params.parameters[0]&&(this.params.cutoff=this.params.parameters[0]),!0;if("cutoffPositive"===a)return this.params.cutoff=b.floatValue(),this.params.isPositiveOnly=!0;if("cap"===a||"slab"===a)return null!=b&&this.params.addSlabInfo(b),!0;if("scale"===a)return this.params.scale=b.floatValue(),!0;if("scale3d"===a)return this.params.scale3d=b.floatValue(),!0;if("angstroms"===a)return this.params.isAngstroms=!0;if("resolution"===a)return c=
b.floatValue(),this.params.resolution=0<c?c:3.4028235E38,!0;if("downsample"===a)return c=b.intValue(),this.params.downsampleFactor=0<=c?c:0,!0;if("anisotropy"===a)return 0==(this.params.dataType&32)&&this.params.setAnisotropy(b),!0;if("eccentricity"===a)return this.params.setEccentricity(b),!0;if("addHydrogens"===a)return this.params.addHydrogens=b.booleanValue(),!0;if("squareData"===a)return this.params.isSquared=null==b?!1:b.booleanValue(),!0;if("squareLinear"===a)return this.params.isSquaredLinear=
null==b?!1:b.booleanValue(),!0;if("gridPoints"===a)return this.params.iAddGridPoints=!0;if("atomIndex"===a)return this.params.atomIndex=b.intValue(),!0;if("insideOut"===a)return this.params.insideOut=!0;if("sign"===a)return this.params.isCutoffAbsolute=!0,this.params.colorBySign=!0,this.colorPtr=0,!0;if("colorRGB"===a)return c=b.intValue(),this.params.colorRgb=this.params.colorPos=this.params.colorPosLCAO=c,0==this.colorPtr++?this.params.colorNeg=this.params.colorNegLCAO=c:this.params.colorRgb=2147483647,
!0;if("monteCarloCount"===a)return this.params.psi_monteCarloCount=b.intValue(),!0;if("rangeAll"===a)return this.params.rangeAll=!0;if("rangeSelected"===a)return this.params.rangeSelected=!0;if("red"===a)return this.params.valueMappedToRed=b.floatValue(),!0;if("blue"===a)return this.params.valueMappedToBlue=b.floatValue(),this.params.valueMappedToRed>this.params.valueMappedToBlue&&(c=this.params.valueMappedToRed,this.params.valueMappedToRed=this.params.valueMappedToBlue,this.params.valueMappedToBlue=
c,this.params.isColorReversed=!this.params.isColorReversed),this.params.rangeDefined=!0,this.params.rangeAll=!1,!0;if("reverseColor"===a)return this.params.isColorReversed=!0;if("setColorScheme"===a)return this.getSurfaceSets(),this.params.colorBySets=!0,this.mapSurface(),!0;if("center"===a)return this.params.center.setT(b),!0;if("origin"===a)return this.params.origin=b,!0;if("step"===a)return this.params.steps=b,!0;if("modelInvRotation"===a)return this.params.modelInvRotation=b,!0;if("point"===a)return this.params.points=
b,!0;if("withinDistance"===a)return this.params.distance=b.floatValue(),!0;if("withinPoint"===a)return this.params.point=b,!0;if("progressive"===a)return this.params.isXLowToHigh=!0;if("phase"===a)return this.params.isCutoffAbsolute=!0,this.params.colorBySign=!0,this.params.colorByPhase=!0,this.params.colorPhase=J.jvxl.readers.SurfaceReader.getColorPhaseIndex(b),0>this.params.colorPhase&&(JU.Logger.warn(" invalid color phase: "+b),this.params.colorPhase=0),this.params.colorByPhase=0!=this.params.colorPhase,
2<=this.params.state&&(this.params.dataType=this.params.surfaceType,this.params.state=3,this.params.isBicolorMap=!0,this.surfaceReader.applyColorScale()),!0;if("radius"===a)return JU.Logger.info("solvent probe radius set to "+b),this.params.atomRadiusData=b,!0;if("envelopeRadius"===a)return this.params.envelopeRadius=b.floatValue(),!0;if("cavityRadius"===a)return this.params.cavityRadius=b.floatValue(),!0;if("cavity"===a)return this.params.isCavity=!0;if("doFullMolecular"===a)return this.params.doFullMolecular=
!0;if("pocket"===a)return this.params.pocket=b,this.params.fullyLit=this.params.pocket.booleanValue(),!0;if("minset"===a)return this.params.minSet=b.intValue(),!0;if("maxset"===a)return this.params.maxSet=b.intValue(),!0;if("plane"===a)return this.params.setPlane(b),!0;if("contour"===a){this.params.isContoured=!0;if(JU.AU.isAF(b))this.params.contoursDiscrete=b,this.params.nContours=this.params.contoursDiscrete.length;else if(U(b,JU.P3)){var c=this.params.contourIncrements=b,d=c.x,h=c.y,e=c.z;0>=e&&
(e=1);for(var c=0,g=d;g<=h+e/10;g+=e,c++);this.params.contoursDiscrete=x(c,0);g=d;for(d=0;d<c;d++,g+=e)this.params.contoursDiscrete[d]=g;this.params.nContours=c}else c=b.intValue(),this.params.thisContour=0,0==c?this.params.nContours=9:0<c?this.params.nContours=c:this.params.thisContour=-c;return!0}if("colorDiscrete"===a)return this.params.contourColixes=b,!0;if("colorDensity"===a)return this.params.colorDensity=!0,null!=b&&(this.params.pointSize=b.floatValue()),!1;if("fullPlane"===a)return this.params.contourFromZero=
!b.booleanValue(),!0;if("mapLattice"===a)return this.params.mapLattice=b,!0;if("extendGrid"===a)return this.params.extendGrid=b.floatValue(),!0;if("property"===a)return this.params.dataType=1206,this.params.theProperty=b,this.mapSurface(),!0;if("sphere"===a)return this.params.setSphere(b.floatValue(),!1),this.readerData=Float.$valueOf(this.params.distance),this.surfaceReader=this.newReader("IsoShapeReader"),this.generateSurface(),!0;if("geodesic"===a)return this.params.setSphere(b.floatValue(),!0),
this.readerData=Float.$valueOf(this.params.distance),this.surfaceReader=this.newReader("IsoShapeReader"),this.generateSurface(),!0;if("ellipsoid"===a){if(U(b,JU.P4))this.params.setEllipsoidP4(b);else if(JU.AU.isAF(b))this.params.setEllipsoidAF(b);else return!0;this.readerData=Float.$valueOf(this.params.distance);this.surfaceReader=this.newReader("IsoShapeReader");this.generateSurface();return!0}if("ellipsoid3"===a)return this.params.setEllipsoidAF(b),this.readerData=Float.$valueOf(this.params.distance),
this.surfaceReader=this.newReader("IsoShapeReader"),this.generateSurface(),!0;if("lp"===a)return this.params.setLp(b),this.readerData=x(-1,[3,2,0,15,0]),this.surfaceReader=this.newReader("IsoShapeReader"),this.generateSurface(),!0;if("rad"===a)return this.params.setRadical(b),this.readerData=x(-1,[3,2,0,15,0]),this.surfaceReader=this.newReader("IsoShapeReader"),this.generateSurface(),!0;if("lobe"===a)return this.params.setLobe(b),this.readerData=x(-1,[3,2,0,15,0]),this.surfaceReader=this.newReader("IsoShapeReader"),
this.generateSurface(),!0;if("hydrogenOrbital"===a){if(!this.params.setAtomicOrbital(b))return this.isValid=!1,!0;this.readerData=x(-1,[this.params.psi_n,this.params.psi_l,this.params.psi_m,this.params.psi_Znuc,this.params.psi_monteCarloCount]);this.surfaceReader=this.newReader("IsoShapeReader");this.processState();return!0}if("functionXY"===a)return this.params.setFunctionXY(b),this.params.isContoured&&this.volumeDataTemp.setPlaneParameters(null==this.params.thePlane?this.params.thePlane=JU.P4.new4(0,
0,1,0):this.params.thePlane),0<=this.params.functionInfo.get(0).indexOf("_xyz")&&this.getFunctionZfromXY(),this.processState(),!0;if("functionXYZ"===a)return this.params.setFunctionXYZ(b),this.processState(),!0;if("lcaoType"===a)return this.params.setLcao(b,this.colorPtr),!0;if("lcaoCartoonCenter"===a){if(2!=++this.params.state)return!0;Float.isNaN(this.params.center.x)&&this.params.center.setT(b);return!1}if("molecular"===a||"solvent"===a||"sasurface"===a||"nomap"===a)return this.params.setSolvent(a,
b.floatValue()),this.params.isSilent||JU.Logger.info(this.params.calculationType),this.processState(),!0;if("moData"===a)return this.params.moData=b,!0;if("mepCalcType"===a)return this.params.mep_calcType=b.intValue(),!0;if("mep"===a)return this.params.setMep(b,!1),this.processState(),!0;if("mlp"===a)return this.params.setMep(b,!0),this.processState(),!0;if("nci"===a)return c=b.booleanValue(),this.params.setNci(c),c&&this.processState(),!0;if("calculationType"===a)return this.params.calculationType=
b,!0;if("charges"===a)return this.params.theProperty=b,!0;if("randomSeed"===a)return this.params.randomSeed=b.intValue(),!0;if("molecularOrbital"===a)return c=0,d=null,U(b,Integer)?c=b.intValue():d=b,this.params.setMO(c,d),JU.Logger.info(this.params.calculationType),this.processState(),!0;if("fileType"===a)return this.fileType=b,!0;if("fileName"===a)return this.params.fileName=b,!0;if("outputChannel"===a)return this.out=b,!0;if("readFile"===a){if(null==(this.surfaceReader=this.setFileData(this.atomDataServer,
b)))return JU.Logger.error("Could not set the surface data"),!0;this.surfaceReader.setOutputChannel(this.out);this.generateSurface();return!0}if("mapColor"===a){if(null==(this.surfaceReader=this.setFileData(this.atomDataServer,b)))return JU.Logger.error("Could not set the mapping data"),!0;this.surfaceReader.setOutputChannel(this.out);this.mapSurface();return!0}if("getSurfaceSets"===a)return this.getSurfaceSets(),!0;"periodic"===a&&(this.params.isPeriodic=!0);return!1},"~S,~O,JU.BS");e(c$,"newReader",
function(a){a=J.jvxl.readers.SurfaceGenerator.getInterface(a);null!=a&&a.init(this);return a},"~S");e(c$,"newReaderBr",function(a,b){var c=J.jvxl.readers.SurfaceGenerator.getInterface(a);null!=c&&c.init2(this,b);return c},"~S,java.io.BufferedReader");c$.getInterface=e(c$,"getInterface",function(a){try{var b=bb._4Name("J.jvxl.readers."+a);return null==b?null:b.newInstance()}catch(c){if(S(c,Exception))return JU.Logger.error("Interface.java Error creating instance for "+a+": \n"+c.toString()),null;throw c;
}},"~S");e(c$,"getSurfaceSets",function(){null==this.meshDataServer?this.meshData.getSurfaceSet():(this.meshDataServer.fillMeshData(this.meshData,1,null),this.meshData.getSurfaceSet(),this.meshDataServer.fillMeshData(this.meshData,3,null))});e(c$,"processState",function(){1==this.params.state&&null!=this.params.thePlane&&this.params.state++;2<=this.params.state?this.mapSurface():this.generateSurface()});e(c$,"setReader",function(){this.readerData=null;if(null!=this.surfaceReader)return!this.surfaceReader.vertexDataOnly;
switch(this.params.dataType){case 1205:this.surfaceReader=this.newReader("IsoPlaneReader");break;case 1206:this.surfaceReader=this.newReader("AtomPropertyMapper");break;case 1328:case 1329:this.readerData=1328==this.params.dataType?"Mep":"Mlp";this.surfaceReader=3==this.params.state?this.newReader("AtomPropertyMapper"):this.newReader("Iso"+this.readerData+"Reader");break;case 1333:this.surfaceReader=this.newReader("IsoIntersectReader");break;case 1195:case 1203:case 1196:this.surfaceReader=this.newReader("IsoSolventReader");
break;case 1844:case 1837:this.surfaceReader=this.newReader("IsoMOReader");break;case 8:this.surfaceReader=this.newReader("IsoFxyReader");break;case 9:this.surfaceReader=this.newReader("IsoFxyzReader")}JU.Logger.debugging&&JU.Logger.info("Using surface reader "+this.surfaceReader);this.params.isSilent&&null!=this.surfaceReader&&(this.surfaceReader.isQuiet=!0);return!0});e(c$,"generateSurface",function(){if(2==++this.params.state){this.setReader();var a=null!=this.meshDataServer;this.params.colorBySign&&
(this.params.isBicolorMap=!0);if(null==this.surfaceReader)JU.Logger.error("surfaceReader is null for "+this.params.dataType);else if(this.surfaceReader.createIsosurface(!1)){null!=this.params.pocket&&a&&this.surfaceReader.selectPocket(!this.params.pocket.booleanValue());0<this.params.minSet&&this.surfaceReader.excludeMinimumSet();0<this.params.maxSet&&this.surfaceReader.excludeMaximumSet();null!=this.params.slabInfo&&this.surfaceReader.slabIsosurface(this.params.slabInfo);a&&this.meshDataServer.notifySurfaceGenerationCompleted()&&
(this.surfaceReader.hasColorData=!1);0<=this.jvxlData.thisSet&&this.getSurfaceSets();this.jvxlData.jvxlDataIs2dContour&&(this.surfaceReader.colorIsosurface(),this.params.state=3);this.jvxlData.jvxlDataIsColorDensity&&(this.params.state=3);if(this.params.colorBySign||this.params.isBicolorMap)this.params.state=3,this.surfaceReader.applyColorScale();null!=this.jvxlData.vertexColorMap&&(this.jvxlData.vertexColorMap=null,this.surfaceReader.hasColorData=!1);this.surfaceReader.jvxlUpdateInfo();this.marchingSquares=
this.surfaceReader.marchingSquares;this.surfaceReader.discardTempData(!1);this.params.mappedDataMin=3.4028235E38;this.surfaceReader.closeReader();if(3!=this.params.state&&(this.surfaceReader.hasColorData||this.params.colorDensity))this.params.state=3,this.colorIsosurface();this.surfaceReader=null}else JU.Logger.error("Could not create isosurface"),this.params.cutoff=NaN,this.surfaceReader.closeReader()}});e(c$,"mapSurface",function(){1==this.params.state&&null!=this.params.thePlane&&this.params.state++;
if(!(3>++this.params.state)&&this.setReader()){this.params.isPeriodic&&(this.surfaceReader.volumeData.isPeriodic=!0);if(null!=this.params.thePlane){var a=this.params.isSquared;this.params.isSquared=!1;this.params.cutoff=0;this.surfaceReader.volumeData.setMappingPlane(this.params.thePlane);this.surfaceReader.createIsosurface(!this.params.isPeriodic);this.surfaceReader.volumeData.setMappingPlane(null);null!=this.meshDataServer&&this.meshDataServer.notifySurfaceGenerationCompleted();if(1205==this.params.dataType){this.surfaceReader.discardTempData(!0);
return}this.params.isSquared=a;this.params.mappedDataMin=3.4028235E38;this.surfaceReader.readVolumeData(!0);null!=this.params.mapLattice&&(this.surfaceReader.volumeData.isPeriodic=!0)}else!this.params.colorBySets&&!this.params.colorDensity&&(this.surfaceReader.readAndSetVolumeParameters(!0),this.params.mappedDataMin=3.4028235E38,this.surfaceReader.readVolumeData(!0));this.colorIsosurface();this.surfaceReader.closeReader();this.surfaceReader=null}});e(c$,"colorIsosurface",function(){this.surfaceReader.colorIsosurface();
this.surfaceReader.jvxlUpdateInfo();this.surfaceReader.updateTriangles();this.surfaceReader.discardTempData(!0);null!=this.meshDataServer&&this.meshDataServer.notifySurfaceMappingCompleted()});e(c$,"setFileData",function(a,b){var c=this.fileType;this.fileType=null;if(U(b,java.util.Map)){var d=b;if(d.containsKey("__pymolSurfaceData__"))return this.readerData=d,this.newReaderBr("PyMOLMeshReader",null);b=d.get("volumeData")}if(U(b,J.jvxl.data.VolumeData))return this.volumeDataTemp=b,this.newReader("VolumeDataReader");
d=null;U(b,String)&&(d=b,b=JU.Rdr.getBR(b));var h=b;null==c&&(c=JV.FileManager.determineSurfaceFileType(h));if(null!=c&&c.startsWith("UPPSALA")){var e=this.params.fileName,e=e.substring(0,e.indexOf("/",10)),e=e+JU.PT.getQuotedStringAt(c,c.indexOf("A HREF")+1);this.params.fileName=e;b=this.atomDataServer.getBufferedInputStream(e);if(null==b)return JU.Logger.error("Isosurface: could not open file "+e),null;try{h=JU.Rdr.getBufferedReader(b,null)}catch(g){if(!S(g,Exception))throw g;}c=JV.FileManager.determineSurfaceFileType(h)}null==
c&&(c="UNKNOWN");JU.Logger.info("data file type was determined to be "+c);if(c.equals("Jvxl+"))return this.newReaderBr("JvxlReader",h);this.readerData=D(-1,[this.params.fileName,d]);if(0<="MRC DELPHI DSN6".indexOf(c.toUpperCase())){try{h.close()}catch(f){if(!S(f,java.io.IOException))throw f;}h=null;c+="Binary"}return this.newReaderBr(c+"Reader",h)},"JV.Viewer,~O");e(c$,"getReaderData",function(){var a=this.readerData;this.readerData=null;return a});e(c$,"initializeIsosurface",function(){this.params.initialize();
this.colorPtr=0;this.marchingSquares=this.surfaceReader=null;this.initState()});e(c$,"initState",function(){this.params.state=1;this.params.dataType=this.params.surfaceType=0});e(c$,"setLcao",function(){this.params.colorPos=this.params.colorPosLCAO;this.params.colorNeg=this.params.colorNegLCAO;return this.params.lcaoType});e(c$,"getFunctionZfromXY",function(){for(var a=this.params.functionInfo.get(1),b=u(3,0),c=u(3,0),d=Array(3),h=0;3>h;h++){var e=this.params.functionInfo.get(h+2);b[h]=Math.abs(z(e.x));
d[h]=JU.V3.new3(e.y,e.z,e.w)}for(var e=b[0],b=b[1],g=new JU.P3,f=new JU.P3,k=new JU.P3,p=new JU.P3,l=this.params.functionInfo.get(5),q=x(e,b,0),v,h=0;h<e;h++)for(var s=0;s<b;s++){g.scaleAdd2(h,d[0],a);g.scaleAdd2(s,d[1],g);var n=J.jvxl.readers.SurfaceGenerator.findNearestThreePoints(g.x,g.y,l,c);f.set((v=l[c[0]])[0],v[1],v[2]);1E-5>n?g.z=v[2]:(k.set((v=l[c[1]])[0],v[1],v[2]),p.set((v=l[c[2]])[0],v[1],v[2]),g.z=this.distanceVerticalToPlane(g.x,g.y,f,k,p));q[h][s]=g.z}this.params.functionInfo.set(5,
q)});e(c$,"distanceVerticalToPlane",function(a,b,c,d,h){c=JU.Measure.getDirectedNormalThroughPoints(c,d,h,this.ptRef,this.vNorm,this.vAB);return(this.vNorm.x*a+this.vNorm.y*b+c)/-this.vNorm.z},"~N,~N,JU.P3,JU.P3,JU.P3");c$.findNearestThreePoints=e(c$,"findNearestThreePoints",function(a,b,c,d){var h,e,g,f,k,p,l;k=p=l=-1;e=g=f=3.4028235E38;for(var q=c.length;0<=--q;)h=(h=c[q][0]-a)*h+(h=c[q][1]-b)*h,h<e?(f=g,g=e,e=h,l=p,p=k,k=q):h<g?(f=g,g=h,l=p,p=q):h<f&&(f=h,l=q);d[0]=k;d[1]=p;d[2]=l;return e},"~N,~N,~A,~A");
e(c$,"addRequiredFile",function(a){null!=this.meshDataServer&&this.meshDataServer.addRequiredFile(a)},"~S");e(c$,"log",function(a){null==this.atomDataServer?System.out.println(a):this.atomDataServer.log(a)},"~S");e(c$,"setOutputChannel",function(a,b){null!=this.meshDataServer&&this.meshDataServer.setOutputChannel(a,b)},"javajs.api.GenericBinaryDocument,JU.OC");e(c$,"fillAtomData",function(a,b){0!=(b&2)&&null!=a.bsSelected&&(null==this.bsVdw&&(this.bsVdw=new JU.BS),this.bsVdw.or(a.bsSelected));this.atomDataServer.fillAtomData(a,
b)},"J.atomdata.AtomData,~N");e(c$,"getSpanningVectors",function(){return null==this.surfaceReader.volumeData?null:this.surfaceReader.volumeData.spanningVectors})});F("J.jvxl.readers");L(null,"J.jvxl.readers.Parameters","java.lang.Float java.util.Hashtable JU.A4 $.Lst $.M3 $.P3 $.P4 $.V3 JU.Escape $.Logger".split(" "),function(){c$=M(function(){this.testFlags=this.state=0;this.isSilent=this.logCube=this.logCompression=this.logMessages=!1;this.assocCutoff=0.3;this.surfaceType=this.dataType=0;this.calculationType=
"";this.atomRadiusData=null;this.addHydrogens=!1;this.solventExtendedAtomRadius=this.solventRadius=0;this.propertySmoothing=!1;this.propertySmoothingPower=4;this.cavityRadius=this.envelopeRadius=0;this.isCavity=!1;this.pocket=null;this.minSet=0;this.slabInfo=null;this.slabPlaneOffset=NaN;this.theProperty=null;this.solvent_ptsPerAngstrom=4;this.solvent_gridMax=60;this.plane_ptsPerAngstrom=4;this.plane_gridMax=81;this.colorBySets=this.colorByPhase=this.colorBySign=!1;this.colorPhase=this.colorNegLCAO=
this.colorPosLCAO=this.colorPos=this.colorNeg=this.colorRgb=0;this.iAddGridPoints=this.colorDensity=!1;this.atomIndex=0;this.isAngstroms=!1;this.scale3d=this.scale=0;this.anisotropy=null;this.isAnisotropic=!1;this.eccentricityMatrixInverse=this.eccentricityMatrix=null;this.isEccentric=!1;this.eccentricityRatio=this.eccentricityScale=0;this.functionInfo=this.lcaoType=this.anisoB=this.aniosU=null;this.psi_n=2;this.psi_Znuc=this.psi_m=this.psi_l=1;this.psi_ptsPerAngstrom=5;this.psi_monteCarloCount=0;
this.mep_gridMax=40;this.mep_ptsPerAngstrom=3;this.mep_marginAngstroms=1;this.mep_calcType=-1;this.qmOrbitalCount=this.qmOrbitalType=0;this.moData=null;this.qm_gridMax=80;this.qm_ptsPerAngstrom=10;this.qm_marginAngstroms=1;this.qm_nAtoms=0;this.qm_moNumber=2147483647;this.point=this.center=this.qm_moLinearCombination=null;this.distance=0;this.allowVolumeRender=!1;this.title=this.func=this.bsSolvent=this.bsIgnore=this.bsSelected=this.script=null;this.readAllData=this.blockCubeData=!1;this.fileIndex=
-1;this.fileName=null;this.modelIndex=-1;this.modelInvRotation=null;this.dataXYReversed=this.insideOut=this.isXLowToHigh=!1;this.sigma=this.cutoff=3.4028235E38;this.cutoffAutomatic=!0;this.rangeDefined=this.rangeSelected=this.rangeAll=this.isPositiveOnly=this.isCutoffAbsolute=!1;this.mappedDataMax=this.mappedDataMin=this.valueMappedToBlue=this.valueMappedToRed=0;this.isSquaredLinear=this.isSquared=this.isBicolorMap=this.isColorReversed=!1;this.thePlane=null;this.isContoured=!1;this.thisContour=this.nContours=
0;this.contourFromZero=!1;this.parameters=null;this.maxSet=this.downsampleFactor=this.resolution=0;this.bsExcluded=this.boundingBox=this.contourIncrements=this.contourColixes=this.contoursDiscrete=null;this.contourType=0;this.colorSchemeTranslucent=!1;this.colorEncoder=null;this.usePropertyForColorRange=!0;this.doFullMolecular=this.isPeriodic=!1;this.propertyDistanceMax=2147483647;this.randomSeed=0;this.fullyLit=!1;this.mapLattice=this.contactPair=this.volumeData=this.points=this.steps=this.origin=
this.intersection=this.vertexSource=null;this.extendGrid=0;this.showTiming=this.isMapped=!1;this.pointSize=0;this.isModelConnected=!1;this.surfaceAtoms=null;N(this,arguments)},J.jvxl.readers,"Parameters");Z(c$,function(){this.anisotropy=x(3,0)});e(c$,"initialize",function(){this.addHydrogens=!1;this.allowVolumeRender=!0;this.atomRadiusData=null;this.atomIndex=-1;this.blockCubeData=!1;this.boundingBox=null;this.bsExcluded=Array(4);this.bsSolvent=this.bsSelected=this.bsIgnore=null;this.calculationType=
"";this.center=new JU.P3;this.resetForMapping(!0);this.colorBySign=this.colorByPhase=this.colorBySets=!1;this.colorEncoder=null;this.colorNeg=-65536;this.colorNegLCAO=-8388480;this.colorPos=-16776961;this.colorPosLCAO=-23296;this.colorRgb=-2147483648;this.colorSchemeTranslucent=!1;this.contourColixes=this.contoursDiscrete=this.contourIncrements=this.contactPair=null;this.contourFromZero=!0;this.cutoff=3.4028235E38;this.cutoffAutomatic=!0;this.dataXYReversed=!1;this.distance=3.4028235E38;this.doFullMolecular=
!1;this.envelopeRadius=10;this.extendGrid=0;this.fileIndex=1;this.readAllData=!0;this.fileName="";this.fullyLit=!1;this.functionInfo=null;this.logCube=this.logCompression=this.isSilent=this.isPeriodic=this.isMapped=this.isEccentric=this.isContoured=this.isSquaredLinear=this.isSquared=this.isModelConnected=this.isColorReversed=this.isCavity=this.isBicolorMap=this.isCutoffAbsolute=this.isPositiveOnly=this.isAngstroms=this.insideOut=this.iAddGridPoints=!1;this.logMessages=JU.Logger.debugging;this.mapLattice=
null;this.mep_calcType=-1;this.minSet=0;this.modelIndex=-1;this.modelInvRotation=null;this.nContours=0;this.pocket=null;this.pointSize=NaN;this.propertyDistanceMax=2147483647;this.propertySmoothing=!1;this.propertySmoothingPower=4;this.rangeSelected=this.rangeAll=this.rangeDefined=!1;this.resolution=3.4028235E38;this.scale=NaN;this.scale3d=0;this.sigma=NaN;this.slabInfo=null;this.solventExtendedAtomRadius=0;this.state=1;this.testFlags=0;this.theProperty=this.thePlane=null;this.thisContour=-1;this.title=
null;this.usePropertyForColorRange=!0;this.vertexSource=null});e(c$,"resetForMapping",function(a){a||(this.state=2);this.center.x=NaN;this.colorDensity=!1;this.intersection=this.func=null;this.isAnisotropic=!1;this.isMapped=!0;this.mappedDataMin=3.4028235E38;this.points=this.parameters=this.origin=null;this.qmOrbitalType=0;this.volumeData=this.steps=null},"~B");e(c$,"setAnisotropy",function(a){this.anisotropy[0]=a.x;this.anisotropy[1]=a.y;this.anisotropy[2]=a.z;this.isAnisotropic=!0;Float.isNaN(this.center.x)&&
this.center.set(0,0,0)},"JU.P3");e(c$,"setEccentricity",function(a){var b=JU.V3.new3(a.x,a.y,a.z),c=0<this.scale?this.scale:0>a.w?1:b.length();a=Math.abs(a.w);b.normalize();var d=JU.V3.new3(0,0,1);b.add(d);b.normalize();Float.isNaN(b.x)&&b.set(1,0,0);this.eccentricityMatrixInverse=new JU.M3;this.eccentricityMatrixInverse.invertM(this.eccentricityMatrix=(new JU.M3).setAA(JU.A4.newVA(b,3.141592653589793)));this.isEccentric=this.isAnisotropic=!0;this.eccentricityScale=c;this.eccentricityRatio=a;1<a&&
(this.eccentricityScale*=a);this.anisotropy[0]=a*c;this.anisotropy[1]=a*c;this.anisotropy[2]=c;Float.isNaN(this.center.x)&&this.center.set(0,0,0)},"JU.P4");e(c$,"setPlane",function(a){this.thePlane=a;0==this.thePlane.x&&(0==this.thePlane.y&&0==this.thePlane.z)&&(this.thePlane.z=1);this.isContoured=!0},"JU.P4");e(c$,"setSphere",function(a,b){this.dataType=b?74:65;this.distance=a;this.setEccentricity(JU.P4.new4(0,0,1,1));this.cutoff=1.4E-45;this.isCutoffAbsolute=!1;this.isSilent=!this.logMessages;this.script=
this.getScriptParams()+" SPHERE "+a+";"},"~N,~B");e(c$,"setEllipsoidP4",function(a){this.dataType=66;this.distance=1;this.setEccentricity(a);this.cutoff=1.4E-45;this.isCutoffAbsolute=!1;this.isSilent=!this.logMessages},"JU.P4");e(c$,"setEllipsoidAF",function(a){this.anisoB=a;this.dataType=67;this.distance=0.3*(Float.isNaN(this.scale)?1:this.scale);this.cutoff=1.4E-45;this.isCutoffAbsolute=!1;this.isSilent=!this.logMessages;Float.isNaN(this.center.x)&&this.center.set(0,0,0);3.4028235E38==this.resolution&&
(this.resolution=6)},"~A");e(c$,"setLobe",function(a){this.dataType=68;this.setEccentricity(a);3.4028235E38==this.cutoff&&(this.cutoff=0.14,this.isSquared&&(this.cutoff*=this.cutoff));this.isSilent=!this.logMessages;this.script=this.getScriptParams()+" LOBE {"+a.x+" "+a.y+" "+a.z+" "+a.w+"};"},"JU.P4");e(c$,"getScriptParams",function(){return" center "+JU.Escape.eP(this.center)+(Float.isNaN(this.scale)?"":" scale "+this.scale)});e(c$,"setLp",function(a){this.dataType=70;this.setEccentricity(a);3.4028235E38==
this.cutoff&&(this.cutoff=0.14,this.isSquared&&(this.cutoff*=this.cutoff));this.isSilent=!this.logMessages;this.script=" center "+JU.Escape.eP(this.center)+(Float.isNaN(this.scale)?"":" scale "+this.scale)+" LP {"+a.x+" "+a.y+" "+a.z+" "+a.w+"};"},"JU.P4");e(c$,"setRadical",function(a){this.dataType=71;this.setEccentricity(a);3.4028235E38==this.cutoff&&(this.cutoff=0.14,this.isSquared&&(this.cutoff*=this.cutoff));this.isSilent=!this.logMessages;this.script=" center "+JU.Escape.eP(this.center)+(Float.isNaN(this.scale)?
"":" scale "+this.scale)+" RAD {"+a.x+" "+a.y+" "+a.z+" "+a.w+"};"},"JU.P4");e(c$,"setLcao",function(a,b){this.lcaoType=a;1==b&&(this.colorPosLCAO=this.colorNegLCAO);this.isSilent=!this.logMessages},"~S,~N");e(c$,"setSolvent",function(a,b){this.isEccentric=this.isAnisotropic=!1;this.solventRadius=Math.abs(b);this.dataType=null!=this.intersection?1333:"nomap"===a?1205:"molecular"===a?1203:"sasurface"===a||0==this.solventRadius?1196:1195;if(2>this.state&&(this.cutoffAutomatic||!this.colorDensity)&&
(null==this.intersection||3.4028235E38==this.cutoff))this.cutoff=0;switch(this.dataType){case 1333:this.calculationType="VDW intersection";break;case 1205:this.calculationType="unmapped plane";break;case 1203:this.calculationType="molecular surface with radius "+this.solventRadius;break;case 1195:this.calculationType="solvent-excluded surface with radius "+this.solventRadius;break;case 1196:this.calculationType="solvent-accessible surface with radius "+this.solventRadius}switch(this.dataType){case 1205:this.solventExtendedAtomRadius=
this.solventRadius;this.solventRadius=0;this.isContoured=!1;break;case 1203:this.solventExtendedAtomRadius=0;break;case 1195:this.solventExtendedAtomRadius=0;null==this.bsIgnore?this.bsIgnore=this.bsSolvent:null!=this.bsSolvent&&this.bsIgnore.or(this.bsSolvent);break;case 1196:this.solventExtendedAtomRadius=this.solventRadius,this.solventRadius=0,null==this.bsIgnore?this.bsIgnore=this.bsSolvent:null!=this.bsSolvent&&this.bsIgnore.or(this.bsSolvent)}},"~S,~N");e(c$,"setFunctionXY",function(a){this.dataType=
8;this.functionInfo=a;this.cutoff=1.4E-45;this.isEccentric=this.isAnisotropic=!1},"JU.Lst");e(c$,"setFunctionXYZ",function(a){this.dataType=9;this.functionInfo=a;3.4028235E38==this.cutoff&&(this.cutoff=1.4E-45);this.isEccentric=this.isAnisotropic=!1},"JU.Lst");e(c$,"setAtomicOrbital",function(a){this.dataType=1294;this.setEccentricity(JU.P4.new4(0,0,1,1));this.psi_n=z(a[0]);this.psi_l=z(a[1]);this.psi_m=z(a[2]);this.psi_Znuc=a[3];this.psi_monteCarloCount=z(a[4]);this.distance=a[5];if(0!=this.distance||
null!=this.thePlane)this.allowVolumeRender=!1;this.randomSeed=z(a[6]);this.psi_ptsPerAngstrom=10;if(3.4028235E38==this.cutoff||0.14==this.cutoff)this.cutoff=0<this.psi_monteCarloCount?0:0.04,this.isSquared&&(this.cutoff*=this.cutoff);this.isCutoffAbsolute=!0;2>this.state&&(null==this.thePlane&&this.colorBySign)&&(this.isBicolorMap=!0);return 0<this.psi_Znuc&&Math.abs(this.psi_m)<=this.psi_l&&this.psi_l<this.psi_n},"~A");e(c$,"setMep",function(a,b){this.dataType=b?1329:1328;this.theProperty=a;this.isEccentric=
this.isAnisotropic=this.usePropertyForColorRange=!1;3.4028235E38==this.cutoff&&(this.cutoff=0.1,this.isSquared&&(this.cutoff*=this.cutoff));this.isCutoffAbsolute=0<this.cutoff&&!this.isPositiveOnly;this.contourFromZero=!1;2<=this.state||null!=this.thePlane?!this.rangeDefined&&!this.rangeAll&&(this.valueMappedToRed=-0.1,this.valueMappedToBlue=0.1,this.rangeDefined=!0):this.isBicolorMap=this.colorBySign=!0},"~A,~B");e(c$,"setNci",function(a){this.fullyLit=!0;this.qm_gridMax=200;a&&(this.dataType=1844);
this.qm_marginAngstroms=2;this.qmOrbitalType=a?3:4;if(a&&(null==this.parameters||2>this.parameters.length))this.parameters=x(-1,[this.cutoff,2]);if(3.4028235E38==this.cutoff||0==this.cutoff)this.cutoff=0.3;this.isSquared&&(this.cutoff*=this.cutoff);null==this.title&&(this.title=[]);this.moData=new java.util.Hashtable},"~B");e(c$,"setMO",function(a,b){this.isModelConnected=!0;this.qm_moLinearCombination=b;this.qm_moNumber=null==b?Math.abs(a):z(b[1]);this.qmOrbitalType=this.moData.containsKey("haveVolumeData")?
5:this.moData.containsKey("gaussians")?1:this.moData.containsKey("slaters")?2:0;var c=0>=a&&null==b;0==this.qmOrbitalType?(JU.Logger.error("MO ERROR: No basis functions found in file for MO calculation. (GAUSSIAN 'gfprint' keyword may be missing?)"),this.title=D(-1,["no basis functions found in file"])):(this.qmOrbitalCount=this.moData.get("mos").size(),this.calculationType=this.moData.get("calculationType"),this.calculationType="Molecular orbital #"+this.qm_moNumber+"/"+this.qmOrbitalCount+" "+(null==
this.calculationType?"":this.calculationType),!c&&null==this.title&&(this.title=Array(5),this.title[0]="%F",this.title[1]="Model %M  MO %I/%N %T",this.title[2]="?Energy = %E %U",this.title[3]="?Symmetry = %S",this.title[4]="?Occupancy = %O"));this.dataType=1837;3.4028235E38==this.cutoff&&(this.cutoff=c?0.01:0.05);if(this.isSquared||this.isSquaredLinear)this.cutoff*=this.cutoff;this.isEccentric=this.isAnisotropic=!1;this.isCutoffAbsolute=0<this.cutoff&&!this.isPositiveOnly;2<=this.state||null!=this.thePlane||
(this.colorBySign=!0,this.colorByPhase&&0==this.colorPhase&&(this.colorByPhase=!1),this.isBicolorMap=!0)},"~N,~A");e(c$,"setMapRanges",function(a,b){if(!this.colorDensity&&(this.colorByPhase||this.colorBySign||(null!=this.thePlane||this.isBicolorMap)&&!this.isContoured))this.mappedDataMin=-1,this.mappedDataMax=1;if(3.4028235E38==this.mappedDataMin||this.mappedDataMin==this.mappedDataMax){var c=a.getMinMaxMappedValues(b);System.out.println("parameters - setmapranges "+c[0]+" "+c[1]);this.mappedDataMin=
c[0];this.mappedDataMax=c[1]}0==this.mappedDataMin&&0==this.mappedDataMax&&(this.mappedDataMin=-1,this.mappedDataMax=1);this.rangeDefined||(this.valueMappedToRed=this.mappedDataMin,this.valueMappedToBlue=this.mappedDataMax)},"J.jvxl.readers.SurfaceReader,~B");e(c$,"addSlabInfo",function(a){null==this.slabInfo&&(this.slabInfo=new JU.Lst);this.slabInfo.addLast(a)},"~A");e(c$,"isInsideOut",function(){return this.insideOut!=this.dataXYReversed});e(c$,"isFullyLit",function(){return null!=this.thePlane||
this.fullyLit});$(c$,"STATE_UNINITIALIZED",0,"STATE_INITIALIZED",1,"STATE_DATA_READ",2,"STATE_DATA_COLORED",3,"NO_ANISOTROPY",32,"IS_SILENT",64,"IS_SOLVENTTYPE",128,"HAS_MAXGRID",256,"IS_POINTMAPPABLE",512,"IS_SLABBABLE",1024,"SURFACE_NONE",0,"SURFACE_SPHERE",65,"SURFACE_ELLIPSOID2",66,"SURFACE_ELLIPSOID3",67,"SURFACE_LOBE",68,"SURFACE_LCAOCARTOON",69,"SURFACE_LONEPAIR",70,"SURFACE_RADICAL",71,"SURFACE_FUNCTIONXY",8,"SURFACE_FUNCTIONXYZ",9,"SURFACE_GEODESIC",74,"SURFACE_SOLVENT",1195,"SURFACE_SASURFACE",
1196,"SURFACE_MOLECULARORBITAL",1837,"SURFACE_ATOMICORBITAL",1294,"SURFACE_MEP",1328,"SURFACE_MLP",1329,"SURFACE_MOLECULAR",1203,"SURFACE_NCI",1844,"SURFACE_INTERSECT",1333,"SURFACE_NOMAP",1205,"SURFACE_PROPERTY",1206,"ANGSTROMS_PER_BOHR",0.5291772,"defaultEdgeFractionBase",35,"defaultEdgeFractionRange",90,"defaultColorFractionBase",35,"defaultColorFractionRange",90,"defaultMappedDataMin",0,"defaultMappedDataMax",1,"defaultCutoff",0.02,"defaultOrbitalCutoff",0.04,"defaultLobeCutoff",0.14,"defaultOrbitalCutoffOld",
0.14,"defaultQMOrbitalCutoff",0.05,"defaultQMElectronDensityCutoff",0.01,"defaultContourCount",11,"nContourMax",100,"defaultColorNegative",4294901760,"defaultColorPositive",4278190335,"defaultColorNegativeLCAO",4286578816,"defaultColorPositiveLCAO",4294944E3,"defaultSolventRadius",1.2,"defaultMepCutoff",0.1,"defaultMepMin",-0.1,"defaultMepMax",0.1,"MEP_MAX_GRID",40,"QM_TYPE_UNKNOWN",0,"QM_TYPE_GAUSSIAN",1,"QM_TYPE_SLATER",2,"QM_TYPE_NCI_PRO",3,"QM_TYPE_NCI_SCF",4,"QM_TYPE_VOLUME_DATA",5,"MO_MAX_GRID",
80)});F("J.jvxl.readers");L(["J.jvxl.api.VertexDataServer","JU.P3"],"J.jvxl.readers.SurfaceReader","java.lang.Float JU.AU $.BS J.jvxl.calc.MarchingCubes $.MarchingSquares J.jvxl.data.JvxlCoder $.MeshData JU.BoxInfo $.C $.ColorEncoder $.Escape $.Logger".split(" "),function(){c$=M(function(){this.edgeData=this.volumeData=this.jvxlData=this.meshData=this.params=this.meshDataServer=this.sg=null;this.isXLowToHigh=this.isProgressive=this.allowSigma=this.haveSurfaceAtoms=!1;this.assocCutoff=0.3;this.hasColorData=
this.vertexDataOnly=this.isPeriodic=this.isQuiet=!1;this.dataMin=3.4028235E38;this.dataMax=-3.4028235E38;this.dataMean=0;this.anisotropy=this.center=this.xyzMax=this.xyzMin=null;this.isAnisotropic=!1;this.eccentricityMatrixInverse=this.eccentricityMatrix=null;this.isEccentric=!1;this.edgeCount=this.eccentricityRatio=this.eccentricityScale=0;this.voxelData=this.voxelCounts=this.volumetricVectors=this.volumetricOrigin=null;this.nPointsZ=this.nPointsY=this.nPointsX=this.nDataPoints=this.nBytes=0;this.isJvxl=
!1;this.colorFractionRange=this.colorFractionBase=this.edgeFractionRange=this.edgeFractionBase=0;this.fractionData=this.jvxlFileHeaderBuffer=null;this.jvxlColorDataRead=this.jvxlEdgeDataRead="";this.jvxlVoxelBitSet=null;this.jvxlDataIsColorDensity=this.jvxlDataIs2dContour=this.jvxlDataIsPrecisionColor=this.jvxlDataIsColorMapped=!1;this.jvxlNSurfaceInts=this.jvxlCutoff=0;this.cJvxlEdgeNaN="\x00";this.contourVertexCount=0;this.yzPlanes=this.marchingCubes=this.marchingSquares=null;this.yzCount=0;this.minMax=
this.ptTemp=this.qpc=null;this.haveSetAnisotropy=!1;N(this,arguments)},J.jvxl.readers,"SurfaceReader",null,J.jvxl.api.VertexDataServer);Z(c$,function(){this.ptTemp=new JU.P3});R(c$,function(){});e(c$,"initSR",function(a){this.sg=a;this.params=a.params;this.assocCutoff=this.params.assocCutoff;this.isXLowToHigh=this.params.isXLowToHigh;this.center=this.params.center;this.anisotropy=this.params.anisotropy;this.isAnisotropic=this.params.isAnisotropic;this.eccentricityMatrix=this.params.eccentricityMatrix;
this.eccentricityMatrixInverse=this.params.eccentricityMatrixInverse;this.isEccentric=this.params.isEccentric;this.eccentricityScale=this.params.eccentricityScale;this.eccentricityRatio=this.params.eccentricityRatio;this.marchingSquares=a.marchingSquares;this.meshData=a.meshData;this.jvxlData=a.jvxlData;this.setVolumeDataV(a.volumeDataTemp);this.meshDataServer=a.meshDataServer;this.cJvxlEdgeNaN=String.fromCharCode(125)},"J.jvxl.readers.SurfaceGenerator");e(c$,"setOutputChannel",function(){},"JU.OC");
e(c$,"newVoxelDataCube",function(){this.volumeData.setVoxelDataAsArray(this.voxelData=x(this.nPointsX,this.nPointsY,this.nPointsZ,0))});e(c$,"setVolumeDataV",function(a){this.nBytes=0;this.volumetricOrigin=a.volumetricOrigin;this.volumetricVectors=a.volumetricVectors;this.voxelCounts=a.voxelCounts;this.voxelData=a.getVoxelData();this.volumeData=a},"J.jvxl.data.VolumeData");e(c$,"jvxlUpdateInfo",function(){this.jvxlData.jvxlUpdateInfo(this.params.title,this.nBytes)});e(c$,"readAndSetVolumeParameters",
function(a){return!this.readVolumeParameters(a)?!1:this.vertexDataOnly?!0:this.volumeData.setUnitVectors()},"~B");e(c$,"createIsosurface",function(a){this.resetIsosurface();this.params.showTiming&&JU.Logger.startTimer("isosurface creation");this.jvxlData.cutoff=NaN;if(!this.readAndSetVolumeParameters(a))return!1;!a&&(!Float.isNaN(this.params.sigma)&&!this.allowSigma)&&(0<this.params.sigma&&JU.Logger.error("Reader does not support SIGMA option -- using cutoff 1.6"),this.params.cutoff=1.6);0>this.params.sigma&&
(this.params.sigma=-this.params.sigma);this.nPointsX=this.voxelCounts[0];this.nPointsY=this.voxelCounts[1];this.nPointsZ=this.voxelCounts[2];this.jvxlData.isSlabbable=0!=(this.params.dataType&1024);this.jvxlData.insideOut=this.params.isInsideOut();this.jvxlData.isBicolorMap=this.params.isBicolorMap;this.jvxlData.nPointsX=this.nPointsX;this.jvxlData.nPointsY=this.nPointsY;this.jvxlData.nPointsZ=this.nPointsZ;this.jvxlData.jvxlVolumeDataXml=this.volumeData.xmlData;this.jvxlData.voxelVolume=this.volumeData.voxelVolume;
if(a)this.volumeData.setMappingPlane(this.params.thePlane),null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,1,null),this.params.setMapRanges(this,!1),this.generateSurfaceData(),this.volumeData.setMappingPlane(null);else{if(!this.readVolumeData(!1))return!1;this.generateSurfaceData()}if(null!=this.jvxlFileHeaderBuffer){a=this.jvxlFileHeaderBuffer.toString();var b=a.indexOf("\n",a.indexOf("\n",a.indexOf("\n")+1)+1)+1;this.jvxlData.jvxlFileTitle=a.substring(0,b)}null==this.params.contactPair&&
this.setBBoxAll();this.jvxlData.isValid=3.4028235E38!=this.xyzMin.x;this.params.isSilent||(this.jvxlData.isValid?JU.Logger.info("boundbox corners "+JU.Escape.eP(this.xyzMin)+" "+JU.Escape.eP(this.xyzMax)):JU.Logger.error("no isosurface points were found!"));this.jvxlData.boundingBox=D(-1,[this.xyzMin,this.xyzMax]);this.jvxlData.dataMin=this.dataMin;this.jvxlData.dataMax=this.dataMax;this.jvxlData.cutoff=this.isJvxl?this.jvxlCutoff:this.params.cutoff;this.jvxlData.isCutoffAbsolute=this.params.isCutoffAbsolute;
this.jvxlData.isModelConnected=this.params.isModelConnected;this.jvxlData.pointsPerAngstrom=1/this.volumeData.volumetricVectorLengths[0];this.jvxlData.jvxlColorData="";this.jvxlData.jvxlPlane=this.params.thePlane;this.jvxlData.jvxlEdgeData=this.edgeData;this.jvxlData.isBicolorMap=this.params.isBicolorMap;this.jvxlData.isContoured=this.params.isContoured;this.jvxlData.colorDensity=this.params.colorDensity;this.jvxlData.pointSize=this.params.pointSize;null!=this.jvxlData.vContours&&(this.params.nContours=
this.jvxlData.vContours.length);this.jvxlData.nContours=this.params.contourFromZero?this.params.nContours:-1-this.params.nContours;this.jvxlData.thisContour=this.params.thisContour;this.jvxlData.nEdges=this.edgeCount;this.jvxlData.edgeFractionBase=this.edgeFractionBase;this.jvxlData.edgeFractionRange=this.edgeFractionRange;this.jvxlData.colorFractionBase=this.colorFractionBase;this.jvxlData.colorFractionRange=this.colorFractionRange;this.jvxlData.jvxlDataIs2dContour=this.jvxlDataIs2dContour;this.jvxlData.jvxlDataIsColorMapped=
this.jvxlDataIsColorMapped;this.jvxlData.jvxlDataIsColorDensity=this.jvxlDataIsColorDensity;this.jvxlData.isXLowToHigh=this.isXLowToHigh;this.jvxlData.vertexDataOnly=this.vertexDataOnly;this.jvxlData.saveVertexCount=0;if(this.jvxlDataIsColorMapped||0<this.jvxlData.nVertexColors)null!=this.meshDataServer&&(this.meshDataServer.fillMeshData(this.meshData,1,null),this.meshDataServer.fillMeshData(this.meshData,2,null)),this.jvxlData.jvxlColorData=this.readColorData(),this.updateSurfaceData(),null!=this.meshDataServer&&
this.meshDataServer.notifySurfaceMappingCompleted();this.params.showTiming&&JU.Logger.checkTimer("isosurface creation",!1);return!0},"~B");e(c$,"resetIsosurface",function(){this.meshData=new J.jvxl.data.MeshData;this.xyzMin=this.xyzMax=null;this.jvxlData.isBicolorMap=this.params.isBicolorMap;null!=this.meshDataServer&&this.meshDataServer.fillMeshData(null,0,null);this.contourVertexCount=0;3.4028235E38==this.params.cutoff&&(this.params.cutoff=0.02);this.jvxlData.jvxlSurfaceData="";this.jvxlData.jvxlEdgeData=
"";this.jvxlData.jvxlColorData="";this.edgeCount=0;this.edgeFractionBase=35;this.edgeFractionRange=90;this.colorFractionBase=35;this.colorFractionRange=90;this.params.mappedDataMin=3.4028235E38});e(c$,"discardTempData",function(a){this.discardTempDataSR(a)},"~B");e(c$,"discardTempDataSR",function(a){a&&(this.voxelData=null,this.marchingCubes=this.sg.marchingSquares=this.marchingSquares=null)},"~B");e(c$,"initializeVolumetricData",function(){this.nPointsX=this.voxelCounts[0];this.nPointsY=this.voxelCounts[1];
this.nPointsZ=this.voxelCounts[2];this.setVolumeDataV(this.volumeData)});e(c$,"gotoAndReadVoxelData",function(a){this.initializeVolumetricData();if(0<this.nPointsX&&0<this.nPointsY&&0<this.nPointsZ)try{this.gotoData(this.params.fileIndex-1,this.nPointsX*this.nPointsY*this.nPointsZ),this.readSurfaceData(a)}catch(b){if(S(b,Exception))return JU.Logger.error(b.toString()),!1;throw b;}return!0},"~B");e(c$,"gotoData",function(){},"~N,~N");e(c$,"readColorData",function(){if(null==this.jvxlData.vertexColors)return"";
var a=this.jvxlData.vertexCount,b=this.meshData.vcs,c=this.meshData.vvs;if(null==b||b.length<a)this.meshData.vcs=b=V(a,0);if(null==c||c.length<a)this.meshData.vvs=x(a,0);for(c=0;c<a;c++)b[c]=JU.C.getColix(this.jvxlData.vertexColors[c]);return"-"});n(c$,"getPlane",function(a){return this.getPlaneSR(a)},"~N");e(c$,"getPlaneSR",function(a){0==this.yzCount&&this.initPlanes();null!=this.qpc&&this.qpc.getPlane(a,this.yzPlanes[a%2]);return this.yzPlanes[a%2]},"~N");e(c$,"initPlanes",function(){this.yzCount=
this.nPointsY*this.nPointsZ;this.isQuiet||JU.Logger.info("reading data progressively -- yzCount = "+this.yzCount);this.yzPlanes=JU.AU.newFloat2(2);this.yzPlanes[0]=x(this.yzCount,0);this.yzPlanes[1]=x(this.yzCount,0)});n(c$,"getValue",function(a,b,c,d){return this.getValue2(a,b,c,d)},"~N,~N,~N,~N");e(c$,"getValue2",function(a,b,c,d){return null==this.yzPlanes?this.voxelData[a][b][c]:this.yzPlanes[a%2][d]},"~N,~N,~N,~N");e(c$,"generateSurfaceData",function(){this.edgeData="";if(this.vertexDataOnly)try{this.readSurfaceData(!1)}catch(a){if(S(a,
Exception))System.out.println(a.toString()),JU.Logger.error("Exception in SurfaceReader::readSurfaceData: "+a.toString());else throw a;}else{this.contourVertexCount=0;var b=-1;this.marchingSquares=null;if(null!=this.params.thePlane||this.params.isContoured)this.marchingSquares=new J.jvxl.calc.MarchingSquares(this,this.volumeData,this.params.thePlane,this.params.contoursDiscrete,this.params.nContours,this.params.thisContour,this.params.contourFromZero),b=this.marchingSquares.contourType,this.marchingSquares.setMinMax(this.params.valueMappedToRed,
this.params.valueMappedToBlue);this.params.contourType=b;this.params.isXLowToHigh=this.isXLowToHigh;this.marchingCubes=new J.jvxl.calc.MarchingCubes(this,this.volumeData,this.params,this.jvxlVoxelBitSet);b=this.marchingCubes.getEdgeData();null==this.params.thePlane&&(this.edgeData=b);this.jvxlData.setSurfaceInfoFromBitSetPts(this.marchingCubes.bsVoxels,this.params.thePlane,this.params.mapLattice);this.jvxlData.jvxlExcluded=this.params.bsExcluded;this.isJvxl&&(this.edgeData=this.jvxlEdgeDataRead);
this.postProcessVertices()}});e(c$,"postProcessVertices",function(){});n(c$,"getSurfacePointIndexAndFraction",function(a,b,c,d,e,m,g,f,k,p,l,q,v,s){b=this.getSurfacePointAndFraction(a,b,k,p,l,q,c,d,e,g,f,s,this.ptTemp);if(null!=this.marchingSquares&&this.params.isContoured)return this.marchingSquares.addContourVertex(this.ptTemp,a);a=0<this.assocCutoff?s[0]<this.assocCutoff?g:s[0]>1-this.assocCutoff?f:-1:-1;0<=a&&(a=this.marchingCubes.getLinearOffset(c,d,e,a));a=this.addVertexCopy(this.ptTemp,b,a,
!0);0<=a&&this.params.iAddGridPoints&&(this.marchingCubes.calcVertexPoint(c,d,e,f,this.ptTemp),this.addVertexCopy(k<p?l:this.ptTemp,Math.min(k,p),-3,!0),this.addVertexCopy(k<p?this.ptTemp:l,Math.max(k,p),-3,!0));return a},"~N,~B,~N,~N,~N,JU.P3i,~N,~N,~N,~N,JU.T3,JU.V3,~B,~A");e(c$,"getSurfacePointAndFraction",function(a,b,c,d,e,m,g,f,k,p,l,q,v){return this.getSPF(a,b,c,d,e,m,g,f,k,p,l,q,v)},"~N,~B,~N,~N,JU.T3,JU.V3,~N,~N,~N,~N,~N,~A,JU.T3");e(c$,"getSPF",function(a,b,c,d,e,m,g,f,k,p,l,q,v){d-=c;g=
(a-c)/d;if(b&&(0>g||1<g))g=(-a-c)/d;if(0>g||1<g)g=NaN;q[0]=g;v.scaleAdd2(g,m,e);return c+g*d},"~N,~B,~N,~N,JU.T3,JU.V3,~N,~N,~N,~N,~N,~A,JU.T3");e(c$,"addVertexCopy",function(a,b,c,d){return this.addVC(a,b,c,d)},"JU.T3,~N,~N,~B");e(c$,"addVC",function(a,b,c,d){return Float.isNaN(b)&&-3!=c?-1:null==this.meshDataServer?this.meshData.addVertexCopy(a,b,c,d):this.meshDataServer.addVertexCopy(a,b,c,d)},"JU.T3,~N,~N,~B");e(c$,"addTriangleCheck",function(a,b,c,d,e,m,g){if(null!=this.marchingSquares&&this.params.isContoured){if(0==
g)return this.marchingSquares.addTriangle(a,b,c,d,e);g=0}return null!=this.meshDataServer?this.meshDataServer.addTriangleCheck(a,b,c,d,e,m,g):m&&!J.jvxl.data.MeshData.checkCutoff(a,b,c,this.meshData.vvs)?-1:this.meshData.addTriangleCheck(a,b,c,d,e,g)},"~N,~N,~N,~N,~N,~B,~N");e(c$,"colorIsosurface",function(){this.params.isSquared&&null!=this.volumeData&&this.volumeData.filterData(!0,NaN);null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,1,null);this.jvxlData.saveVertexCount=
0;this.params.isContoured&&null!=this.marchingSquares&&(this.initializeMapping(),this.params.setMapRanges(this,!1),this.marchingSquares.setMinMax(this.params.valueMappedToRed,this.params.valueMappedToBlue),this.jvxlData.saveVertexCount=this.marchingSquares.contourVertexCount,this.contourVertexCount=this.marchingSquares.generateContourData(this.jvxlDataIs2dContour,this.params.isSquared?1E-8:1E-4),this.jvxlData.contourValuesUsed=this.marchingSquares.contourValuesUsed,this.minMax=this.marchingSquares.getMinMax(),
null!=this.meshDataServer&&this.meshDataServer.notifySurfaceGenerationCompleted(),this.finalizeMapping());this.applyColorScale();this.jvxlData.nContours=this.params.contourFromZero?this.params.nContours:-1-this.params.nContours;this.jvxlData.thisContour=this.params.thisContour;this.jvxlData.jvxlFileMessage="mapped: min = "+this.params.valueMappedToRed+"; max = "+this.params.valueMappedToBlue});e(c$,"applyColorScale",function(){this.colorFractionBase=this.jvxlData.colorFractionBase=35;this.colorFractionRange=
this.jvxlData.colorFractionRange=90;0==this.params.colorPhase&&(this.params.colorPhase=1);null==this.meshDataServer?this.meshData.vcs=V(this.meshData.vc,0):(this.meshDataServer.fillMeshData(this.meshData,1,null),null==this.params.contactPair&&this.meshDataServer.fillMeshData(this.meshData,2,null));var a=this.params.colorDensity||this.params.isBicolorMap||this.params.colorBySign||!this.params.colorByPhase;null!=this.params.contactPair&&(a=!1);this.jvxlData.isJvxlPrecisionColor=!0;this.jvxlData.vertexCount=
0<this.contourVertexCount?this.contourVertexCount:this.meshData.vc;this.jvxlData.minColorIndex=-1;this.jvxlData.maxColorIndex=0;this.jvxlData.contourValues=this.params.contoursDiscrete;this.jvxlData.isColorReversed=this.params.isColorReversed;if(!this.params.colorDensity&&(this.params.isBicolorMap&&!this.params.isContoured||this.params.colorBySign))this.jvxlData.minColorIndex=JU.C.getColixTranslucent3(JU.C.getColix(this.params.isColorReversed?this.params.colorPos:this.params.colorNeg),0!=this.jvxlData.translucency,
this.jvxlData.translucency),this.jvxlData.maxColorIndex=JU.C.getColixTranslucent3(JU.C.getColix(this.params.isColorReversed?this.params.colorNeg:this.params.colorPos),0!=this.jvxlData.translucency,this.jvxlData.translucency);this.jvxlData.isTruncated=0<=this.jvxlData.minColorIndex&&!this.params.isContoured;if(!this.jvxlDataIs2dContour&&!this.hasColorData&&!this.vertexDataOnly&&!(this.params.colorDensity||this.params.isBicolorMap&&!this.params.isContoured)){this.haveSurfaceAtoms&&null==this.meshData.vertexSource&&
(this.meshData.vertexSource=u(this.meshData.vc,0));var b=3.4028235E38,c=-3.4028235E38,d;this.initializeMapping();for(var e=this.meshData.vc;--e>=this.meshData.mergeVertexCount0;){if(this.params.colorBySets)d=this.meshData.vertexSets[e];else if(this.params.colorByPhase)d=this.getPhase(this.meshData.vs[e]);else{var m=this.haveSurfaceAtoms;d=this.volumeData.lookupInterpolatedVoxelValue(this.meshData.vs[e],m);m&&(this.meshData.vertexSource[e]=this.getSurfaceAtomIndex())}d<b&&(b=d);d>c&&3.4028235E38!=
d&&(c=d);this.meshData.vvs[e]=d}this.params.rangeSelected&&null==this.minMax&&(this.minMax=x(-1,[b,c]));this.finalizeMapping()}this.params.setMapRanges(this,!0);this.jvxlData.mappedDataMin=this.params.mappedDataMin;this.jvxlData.mappedDataMax=this.params.mappedDataMax;this.jvxlData.valueMappedToRed=this.params.valueMappedToRed;this.jvxlData.valueMappedToBlue=this.params.valueMappedToBlue;null==this.params.contactPair&&null==this.jvxlData.vertexColors&&this.colorData();J.jvxl.data.JvxlCoder.jvxlCreateColorData(this.jvxlData,
a?this.meshData.vvs:null);this.haveSurfaceAtoms&&null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,4,null);null!=this.meshDataServer&&this.params.colorBySets&&this.meshDataServer.fillMeshData(this.meshData,3,null)});e(c$,"colorData",function(){var a=this.meshData.vvs,b=this.meshData.vcs;this.meshData.pcs=null;var c=this.jvxlData.valueMappedToBlue,d=this.jvxlData.valueMappedToRed,e=this.jvxlData.minColorIndex,m=this.jvxlData.maxColorIndex;null==this.params.colorEncoder&&(this.params.colorEncoder=
new JU.ColorEncoder(null,null));this.params.colorEncoder.setRange(this.params.valueMappedToRed,this.params.valueMappedToBlue,this.params.isColorReversed);for(var g=this.meshData.vc;0<=--g;){var f=a[g];0<=e?0>=f?b[g]=e:0<f&&(b[g]=m):(f<=d&&(f=d),f>=c&&(f=c),b[g]=this.params.colorEncoder.getColorIndex(f))}if((0<this.params.nContours||null!=this.jvxlData.contourValues)&&null==this.jvxlData.contourColixes){a=null==this.jvxlData.contourValues?this.params.nContours:this.jvxlData.contourValues.length;b=
this.jvxlData.contourColixes=V(a,0);e=this.jvxlData.contourValues;null==e&&(e=this.jvxlData.contourValuesUsed);null==this.jvxlData.contourValuesUsed&&(this.jvxlData.contourValuesUsed=null==e?x(a,0):e);c=(c-d)/(a+1);this.params.colorEncoder.setRange(this.params.valueMappedToRed,this.params.valueMappedToBlue,this.params.isColorReversed);for(g=0;g<a;g++)m=null==e?d+(g+1)*c:e[g],this.jvxlData.contourValuesUsed[g]=m,b[g]=JU.C.getColixTranslucent(this.params.colorEncoder.getArgb(m));this.jvxlData.contourColors=
JU.C.getHexCodes(b)}});c$.getColorPhaseIndex=e(c$,"getColorPhaseIndex",function(a){for(var b=-1,c=0;c<J.jvxl.readers.SurfaceReader.colorPhases.length;c++)if(a.equalsIgnoreCase(J.jvxl.readers.SurfaceReader.colorPhases[c])){b=c;break}return b},"~S");e(c$,"getPhase",function(a){switch(this.params.colorPhase){case 0:case -1:case 1:return 0<a.x?1:-1;case 2:return 0<a.y?1:-1;case 3:return 0<a.z?1:-1;case 4:return 0<a.x*a.y?1:-1;case 5:return 0<a.y*a.z?1:-1;case 6:return 0<a.x*a.z?1:-1;case 7:return 0<a.x*
a.x-a.y*a.y?1:-1;case 8:return 0<2*a.z*a.z-a.x*a.x-a.y*a.y?1:-1}return 1},"JU.T3");e(c$,"getMinMaxMappedValues",function(a){if(null!=this.minMax&&3.4028235E38!=this.minMax[0])return this.minMax;if(this.params.colorBySets)return this.minMax=x(-1,[0,Math.max(this.meshData.nSets-1,0)]);var b=3.4028235E38,c=-3.4028235E38;if(this.params.usePropertyForColorRange&&null!=this.params.theProperty){for(a=this.params.theProperty.length;0<=--a;)if(!this.params.rangeSelected||this.params.bsSelected.get(a)){var d=
this.params.theProperty[a];Float.isNaN(d)||(d<b&&(b=d),d>c&&(c=d))}return this.minMax=x(-1,[b,c])}var d=0<this.contourVertexCount?this.contourVertexCount:this.meshData.vc,e=this.meshData.vs,f=a||this.jvxlDataIs2dContour||this.vertexDataOnly||this.params.colorDensity;for(a=this.meshData.mergeVertexCount0;a<d;a++){var g;g=f?this.meshData.vvs[a]:this.volumeData.lookupInterpolatedVoxelValue(e[a],!1);g<b&&(b=g);g>c&&3.4028235E38!=g&&(c=g)}return this.minMax=x(-1,[b,c])},"~B");e(c$,"updateTriangles",function(){null==
this.meshDataServer?this.meshData.invalidatePolygons():this.meshDataServer.invalidateTriangles()});e(c$,"updateSurfaceData",function(){this.meshData.setVertexSets(!0);this.updateTriangles();null==this.params.bsExcluded[1]&&(this.params.bsExcluded[1]=new JU.BS);this.meshData.updateInvalidatedVertices(this.params.bsExcluded[1])});e(c$,"selectPocket",function(){},"~B");e(c$,"excludeMinimumSet",function(){null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,1,null);this.meshData.getSurfaceSet();
for(var a,b=this.meshData.nSets;0<=--b;)null!=(a=this.meshData.surfaceSet[b])&&a.cardinality()<this.params.minSet&&this.meshData.invalidateSurfaceSet(b);this.updateSurfaceData();null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,3,null)});e(c$,"excludeMaximumSet",function(){null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,1,null);this.meshData.getSurfaceSet();for(var a,b=this.meshData.nSets;0<=--b;)null!=(a=this.meshData.surfaceSet[b])&&a.cardinality()>
this.params.maxSet&&this.meshData.invalidateSurfaceSet(b);this.updateSurfaceData();null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,3,null)});e(c$,"slabIsosurface",function(a){null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,1,null);this.meshData.slabPolygonsList(a,!0);null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,4,null)},"JU.Lst");e(c$,"setVertexAnisotropy",function(a){a.x*=this.anisotropy[0];a.y*=this.anisotropy[1];a.z*=
this.anisotropy[2];a.add(this.center)},"JU.T3");e(c$,"setVectorAnisotropy",function(a){this.haveSetAnisotropy=!0;a.x*=this.anisotropy[0];a.y*=this.anisotropy[1];a.z*=this.anisotropy[2]},"JU.T3");e(c$,"setVolumetricAnisotropy",function(){this.haveSetAnisotropy||(this.setVolumetricOriginAnisotropy(),this.setVectorAnisotropy(this.volumetricVectors[0]),this.setVectorAnisotropy(this.volumetricVectors[1]),this.setVectorAnisotropy(this.volumetricVectors[2]))});e(c$,"setVolumetricOriginAnisotropy",function(){this.volumetricOrigin.setT(this.center)});
e(c$,"setBBoxAll",function(){null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,1,null);this.xyzMin=new JU.P3;this.xyzMax=new JU.P3;this.meshData.setBox(this.xyzMin,this.xyzMax)});e(c$,"setBBox",function(a,b){null==this.xyzMin&&(this.xyzMin=JU.P3.new3(3.4028235E38,3.4028235E38,3.4028235E38),this.xyzMax=JU.P3.new3(-3.4028235E38,-3.4028235E38,-3.4028235E38));JU.BoxInfo.addPoint(a,this.xyzMin,this.xyzMax,b)},"JU.T3,~N");e(c$,"getValueAtPoint",function(){return 0},"JU.T3,~B");e(c$,
"initializeMapping",function(){});e(c$,"finalizeMapping",function(){});e(c$,"getSurfaceAtomIndex",function(){return-1});$(c$,"ANGSTROMS_PER_BOHR",0.5291772,"defaultMappedDataMin",0,"defaultMappedDataMax",1,"defaultCutoff",0.02,"colorPhases",D(-1,"_orb x y z xy yz xz x2-y2 z2".split(" ")))});F("J.jvxl.calc");L(["JU.TriangleData","JU.BS","$.P3","$.SB","$.V3"],"J.jvxl.calc.MarchingCubes",["java.lang.Float","J.jvxl.data.JvxlCoder"],function(){c$=M(function(){this.volumeData=this.surfaceReader=null;this.contourType=
0;this.isContoured=!1;this.cutoff=0;this.isXLowToHigh=this.isSquared=this.isCutoffAbsolute=!1;this.yzCount=this.nZ=this.nY=this.cubeCountZ=this.cubeCountY=this.cubeCountX=0;this.colorDensity=!1;this.integrateSquared=!0;this.edgeData=this.bsExcludedPlanes=this.bsExcludedTriangles=this.bsExcludedVertices=this.bsVoxels=null;this.excludePartialCubes=!0;this.mode=0;this.vertexValues=null;this.edgeCount=0;this.mappingPlane=this.yzPlanes=this.isoPointIndexPlanes=this.edgePointIndexes=this.edgeVectors=this.voxelVertexVectors=
null;this.$isInside=this.allInside=!1;this.voxelData=this.offset=null;this.nTriangles=0;this.linearOffsets=this.fReturn=this.edgeVertexPlanes=this.edgeVertexPointers=this.pointA=this.pt0=this.bsValues=null;N(this,arguments)},J.jvxl.calc,"MarchingCubes",JU.TriangleData);Z(c$,function(){this.edgeData=new JU.SB;this.vertexValues=x(8,0);this.voxelVertexVectors=Array(8);this.edgeVectors=Array(12);for(var a=12;0<=--a;)this.edgeVectors[a]=new JU.V3;this.edgePointIndexes=u(12,0);this.bsValues=new JU.BS;this.pt0=
new JU.P3;this.pointA=new JU.P3;this.fReturn=x(1,0);this.linearOffsets=u(8,0)});R(c$,function(){aa(this,J.jvxl.calc.MarchingCubes,[])});R(c$,function(a,b,c,d){aa(this,J.jvxl.calc.MarchingCubes,[]);this.excludePartialCubes=!0;this.surfaceReader=a;this.bsVoxels=d;a=c.bsExcluded;this.bsExcludedVertices=null==a[0]?a[0]=new JU.BS:a[0];this.bsExcludedPlanes=null==a[2]?a[2]=new JU.BS:a[2];this.bsExcludedTriangles=null==a[3]?a[3]=new JU.BS:a[3];this.mode=null!=b.getVoxelData()||null!=b.mappingPlane?1:null!=
d?2:3;this.setParameters(b,c)},"J.jvxl.api.VertexDataServer,J.jvxl.data.VolumeData,J.jvxl.readers.Parameters,JU.BS");e(c$,"setParameters",function(a,b){this.volumeData=a;this.colorDensity=b.colorDensity;this.isContoured=null==b.thePlane&&b.isContoured&&!this.colorDensity;this.cutoff=b.cutoff;this.isCutoffAbsolute=b.isCutoffAbsolute;this.contourType=b.contourType;this.isSquared=b.isSquared;this.isXLowToHigh=b.isXLowToHigh;this.cubeCountX=a.voxelCounts[0]-1;this.cubeCountY=a.voxelCounts[1]-1;this.cubeCountZ=
a.voxelCounts[2]-1;a.getYzCount();null!=b.mapLattice&&(this.cubeCountX*=Math.abs(b.mapLattice.x),this.cubeCountY*=Math.abs(b.mapLattice.y),this.cubeCountZ*=Math.abs(b.mapLattice.z));this.nY=this.cubeCountY+1;this.nZ=this.cubeCountZ+1;this.yzCount=this.nY*this.nZ;null==this.bsVoxels&&(this.bsVoxels=new JU.BS);this.edgeVertexPointers=this.isXLowToHigh?J.jvxl.calc.MarchingCubes.edgeVertexPointersLowToHigh:J.jvxl.calc.MarchingCubes.edgeVertexPointersHighToLow;this.edgeVertexPlanes=this.isXLowToHigh?J.jvxl.calc.MarchingCubes.edgeVertexPlanesLowToHigh:
J.jvxl.calc.MarchingCubes.edgeVertexPlanesHighToLow;this.isoPointIndexPlanes=u(2,this.yzCount,3,0);this.yzPlanes=3==this.mode?x(2,this.yzCount,0):null;this.setLinearOffsets();this.calcVoxelVertexVectors()},"J.jvxl.data.VolumeData,J.jvxl.readers.Parameters");e(c$,"calcVoxelVertexVectors",function(){for(var a=8;0<=--a;)this.volumeData.transform(J.jvxl.calc.MarchingCubes.cubeVertexVectors[a],this.voxelVertexVectors[a]=new JU.V3);for(a=12;0<=--a;)this.edgeVectors[a].sub2(this.voxelVertexVectors[JU.TriangleData.edgeVertexes[a+
a+1]],this.voxelVertexVectors[JU.TriangleData.edgeVertexes[a+a]])});e(c$,"resetIndexPlane",function(a){for(var b=0;b<this.yzCount;b++)for(var c=0;3>c;c++)a[b][c]=-2147483648;return a},"~A");e(c$,"getEdgeData",function(){if(0>this.cubeCountX||0>this.cubeCountY||0>this.cubeCountZ)return"";this.mappingPlane=this.volumeData.mappingPlane;this.edgeCount=0;var a,b,c,d,e,f;this.isXLowToHigh?(a=0,this.colorDensity?(b=this.cubeCountX+1,f=this.yzCount-1):(b=this.cubeCountX,f=this.yzCount-1-this.nZ-1),c=1,d=
this.yzCount):(this.colorDensity?(a=this.cubeCountX,f=(this.cubeCountX+1)*this.yzCount-1):(a=this.cubeCountX-1,f=this.cubeCountX*this.yzCount-1-this.nZ-1),c=b=-1,d=-this.yzCount);e=f;this.resetIndexPlane(this.isoPointIndexPlanes[1]);this.voxelData=null;var g=this.cubeCountY+(this.colorDensity?1:0),A=this.cubeCountZ+(this.colorDensity?1:0);switch(this.mode){case 3:this.getPlane(a,!1);break;case 1:this.voxelData=this.volumeData.getVoxelData()}this.allInside=this.colorDensity&&(0==this.cutoff||2==this.mode&&
0>this.bsVoxels.nextSetBit(0));for(var k=this.colorDensity&&0==this.cutoff,p=0;a!=b;a+=c,f+=d,e=f)if(3==this.mode&&a+c<=b&&this.getPlane(a+c,!0),!this.bsExcludedPlanes.get(a)||!this.bsExcludedPlanes.get(a+c))if(this.colorDensity)for(var l=g;0<=--l;)for(var q=A;0<=--q;e--)p=this.getValue(a,l,q,e,0),(k||this.$isInside)&&this.addVertex(a,l,q,e,p);else{l=this.isoPointIndexPlanes[0];this.isoPointIndexPlanes[0]=this.isoPointIndexPlanes[1];this.isoPointIndexPlanes[1]=this.resetIndexPlane(l);for(var v=!0,
l=g;0<=--l;e--)for(q=A;0<=--q;e--){for(var s=0,n=8;0<=--n;)p=this.getValue(a,l,q,e,n),this.$isInside&&(s|=JU.TriangleData.Pwr2[n]);v&&!Float.isNaN(p)&&(v=!1);0!=s&&255!=s&&this.processOneCubical(s,a,l,q,e)&&(!this.isContoured&&!this.colorDensity)&&this.processTriangles(s)}v&&this.bsExcludedPlanes.set(a)}return this.edgeData.toString()});e(c$,"getValue",function(a,b,c,d,e){this.offset=JU.TriangleData.cubeVertexOffsets[e];d+=this.linearOffsets[e];switch(this.mode){case 3:a=this.vertexValues[e]=this.getValueArray(a+
this.offset.x,b+this.offset.y,c+this.offset.z,d,this.yzPlanes[J.jvxl.calc.MarchingCubes.yzPlanePts[e]]);this.$isInside=this.allInside||this.bsVoxels.get(d);break;case 2:this.$isInside=this.allInside||this.bsVoxels.get(d);a=this.vertexValues[e]=this.bsExcludedVertices.get(d)?NaN:this.$isInside?1:0;break;default:case 1:null==this.mappingPlane?a=this.vertexValues[e]=this.voxelData[a+this.offset.x][b+this.offset.y][c+this.offset.z]:(this.volumeData.voxelPtToXYZ(a+this.offset.x,b+this.offset.y,c+this.offset.z,
this.pt0),a=this.vertexValues[e]=this.volumeData.distanceToMappingPlane(this.pt0)),this.isSquared&&(this.vertexValues[e]*=this.vertexValues[e]),(this.$isInside=this.allInside?!0:J.jvxl.calc.MarchingCubes.isInside(this.vertexValues[e],this.cutoff,this.isCutoffAbsolute))&&this.bsVoxels.set(d)}return a},"~N,~N,~N,~N,~N");e(c$,"getPlane",function(a,b){if(!(0>a||a>this.cubeCountX))if(this.surfaceReader.getPlane(a),b){var c=this.yzPlanes[0];this.yzPlanes[0]=this.yzPlanes[1];this.yzPlanes[1]=c}},"~N,~B");
e(c$,"processTriangles",function(a){a=JU.TriangleData.triangleTable2[a];for(var b=a.length;0<=(b-=4);)this.addTriangle(a[b],a[b+1],a[b+2],a[b+3])},"~N");e(c$,"addVertex",function(a,b,c,d,e){this.volumeData.voxelPtToXYZ(a,b,c,this.pt0);0>this.surfaceReader.addVertexCopy(this.pt0,e,-4,!0)&&this.bsExcludedVertices.set(d)},"~N,~N,~N,~N,~N");e(c$,"addTriangle",function(a,b,c,d){!this.bsExcludedTriangles.get(this.nTriangles)&&0>this.surfaceReader.addTriangleCheck(this.edgePointIndexes[a],this.edgePointIndexes[b],
this.edgePointIndexes[c],d,0,this.isCutoffAbsolute,0)&&this.bsExcludedTriangles.set(this.nTriangles);this.nTriangles++},"~N,~N,~N,~N");e(c$,"getValueArray",function(a,b,c,d,e){var f=d%this.yzCount;this.bsValues.set(d);a=this.surfaceReader.getValue(a,b,c,f);this.isSquared&&(a*=a);e[f]=a;J.jvxl.calc.MarchingCubes.isInside(a,this.cutoff,this.isCutoffAbsolute)&&this.bsVoxels.set(d);return a},"~N,~N,~N,~N,~A");c$.isInside=e(c$,"isInside",function(a,b,c){return 0<b&&(c?Math.abs(a):a)>=b||0>=b&&a<=b},"~N,~N,~B");
e(c$,"processOneCubical",function(a,b,c,d,e){a=J.jvxl.calc.MarchingCubes.insideMaskTable[a];for(var f=!1,g=12;0<=--g;)if(0!=(a&JU.TriangleData.Pwr2[g])){var A=this.edgeVertexPlanes[g],k=(e+this.linearOffsets[this.edgeVertexPointers[g]])%this.yzCount,p=J.jvxl.calc.MarchingCubes.edgeTypeTable[g],l=this.edgePointIndexes[g]=this.isoPointIndexPlanes[A][k][p];if(-2147483648!=l)-1==l&&(f=this.excludePartialCubes);else{var l=JU.TriangleData.edgeVertexes[g<<1],q=JU.TriangleData.edgeVertexes[(g<<1)+1],v=this.vertexValues[l],
s=this.vertexValues[q];this.calcVertexPoint(b,c,d,l,this.pointA);this.edgeCount++;A=this.edgePointIndexes[g]=this.isoPointIndexPlanes[A][k][p]=this.surfaceReader.getSurfacePointIndexAndFraction(this.cutoff,this.isCutoffAbsolute,b,c,d,JU.TriangleData.cubeVertexOffsets[l],l,q,v,s,this.pointA,this.edgeVectors[g],p==this.contourType,this.fReturn);this.addEdgeData(0>A?NaN:this.fReturn[0]);if(Float.isNaN(this.fReturn[0])||0>A)f=this.excludePartialCubes}}return!f},"~N,~N,~N,~N,~N");e(c$,"addEdgeData",function(a){a=
J.jvxl.data.JvxlCoder.jvxlFractionAsCharacter(a);this.edgeData.appendC(a)},"~N");e(c$,"calcVertexPoint",function(a,b,c,d,e){this.volumeData.voxelPtToXYZ(a,b,c,this.pt0);e.add2(this.pt0,this.voxelVertexVectors[d])},"~N,~N,~N,~N,JU.P3");e(c$,"setLinearOffsets",function(){this.linearOffsets[0]=0;this.linearOffsets[1]=this.yzCount;this.linearOffsets[2]=this.yzCount+1;this.linearOffsets[3]=1;this.linearOffsets[4]=this.nZ;this.linearOffsets[5]=this.yzCount+this.nZ;this.linearOffsets[6]=this.yzCount+this.nZ+
1;this.linearOffsets[7]=this.nZ+1});e(c$,"getLinearOffset",function(a,b,c,d){return a*this.yzCount+b*this.nZ+c+this.linearOffsets[d]},"~N,~N,~N,~N");$(c$,"MODE_CUBE",1,"MODE_JVXL",2,"MODE_PLANES",3);$(c$,"yzPlanePts",u(-1,[0,1,1,0,0,1,1,0]),"edgeVertexPointersLowToHigh",u(-1,[1,1,2,0,5,5,6,4,0,1,2,3]),"edgeVertexPointersHighToLow",u(-1,[0,1,3,0,4,5,7,4,0,1,2,3]),"edgeVertexPlanesLowToHigh",u(-1,[1,1,1,0,1,1,1,0,0,1,1,0]),"edgeVertexPlanesHighToLow",u(-1,[1,0,1,1,1,0,1,1,1,0,0,1]));c$.cubeVertexVectors=
c$.prototype.cubeVertexVectors=D(-1,[JU.V3.new3(0,0,0),JU.V3.new3(1,0,0),JU.V3.new3(1,0,1),JU.V3.new3(0,0,1),JU.V3.new3(0,1,0),JU.V3.new3(1,1,0),JU.V3.new3(1,1,1),JU.V3.new3(0,1,1)]);$(c$,"edgeTypeTable",u(-1,[0,2,0,2,0,2,0,2,1,1,1,1]),"insideMaskTable",V(-1,[0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,
1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,
1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,419,681,928,3376,3129,3891,3642,2358,2111,2869,2620,1340,1077,1855,1590,314,51,825,560,3728,3993,3219,3482,2710,2975,2197,2460,1692,1941,1183,1430,666,915,153,400,3840,3593,3331,3082,2822,2575,2309,2060,1804,1541,1295,1030,778,515,265,0]))});F("J.jvxl.calc");L(["JU.P3","java.util.Hashtable"],
"J.jvxl.calc.MarchingSquares",["java.lang.Float","JU.AU","JU.Logger"],function(){c$=M(function(){this.volumeData=this.surfaceReader=null;this.valueMax=this.valueMin=this.thisContour=this.contourType=this.nContourSegments=0;this.pointB=this.pointA=null;this.contourFromZero=!0;this.contoursDiscrete=null;this.contourVertexCount=0;this.contourVertexes=null;pa("J.jvxl.calc.MarchingSquares.ContourVertex")||J.jvxl.calc.MarchingSquares.$MarchingSquares$ContourVertex$();this.contourPlaneMaximumValue=this.contourPlaneMinimumValue=
0;this.ptTemp=this.contourValuesUsed=null;this.triangleCount=0;this.htPts=this.triangles=null;pa("J.jvxl.calc.MarchingSquares.Triangle")||J.jvxl.calc.MarchingSquares.$MarchingSquares$Triangle$();N(this,arguments)},J.jvxl.calc,"MarchingSquares");Z(c$,function(){this.pointA=new JU.P3;this.pointB=new JU.P3;this.contourVertexes=Array(1E3);this.ptTemp=new JU.P3;this.triangles=Array(1E3);this.htPts=new java.util.Hashtable});R(c$,function(a,b,c,d,e,f,g){this.surfaceReader=a;this.volumeData=b;this.thisContour=
f;this.contoursDiscrete=d;this.contourFromZero=g;null==d?(this.nContourSegments=(0==e?9:e)+0,100<this.nContourSegments&&(this.nContourSegments=100)):(this.nContourSegments=e=d.length,this.contourFromZero=!1)},"J.jvxl.api.VertexDataServer,J.jvxl.data.VolumeData,JU.P4,~A,~N,~N,~B");e(c$,"setMinMax",function(a,b){this.valueMin=a;this.valueMax=b},"~N,~N");e(c$,"addContourVertex",function(a,b){this.contourVertexCount==this.contourVertexes.length&&(this.contourVertexes=JU.AU.doubleLength(this.contourVertexes));
var c=this.surfaceReader.addVertexCopy(a,b,-2,!0);this.contourVertexes[this.contourVertexCount++]=ja(J.jvxl.calc.MarchingSquares.ContourVertex,this,null,a);return c},"JU.P3,~N");e(c$,"setContourData",function(a,b){this.contourVertexes[a].setValue(b)},"~N,~N");e(c$,"calcContourPoint",function(a,b,c,d){return this.volumeData.calculateFractionalPoint(a,this.pointA,this.pointB,b,c,d)},"~N,~N,~N,JU.P3");e(c$,"addTriangle",function(a,b,c,d,e){this.triangleCount==this.triangles.length&&(this.triangles=JU.AU.doubleLength(this.triangles));
this.triangles[this.triangleCount++]=ja(J.jvxl.calc.MarchingSquares.Triangle,this,null,a,b,c,d,e);return 0},"~N,~N,~N,~N,~N");e(c$,"generateContourData",function(a,b){JU.Logger.info("generateContours: "+this.nContourSegments+" segments");this.getVertexValues(a);this.createContours(this.valueMin,this.valueMax,b);this.addAllTriangles();return this.contourVertexCount},"~B,~N");e(c$,"getVertexValues",function(a){this.contourPlaneMinimumValue=3.4028235E38;this.contourPlaneMaximumValue=-3.4028235E38;for(var b=
0;b<this.contourVertexCount;b++){var c=this.contourVertexes[b],d;a?d=c.value:(d=this.volumeData.lookupInterpolatedVoxelValue(c,!1),c.setValue(d));d<this.contourPlaneMinimumValue&&(this.contourPlaneMinimumValue=d);d>this.contourPlaneMaximumValue&&(this.contourPlaneMaximumValue=d)}},"~B");e(c$,"createContours",function(a,b,c){b-=a;this.contourValuesUsed=x(this.nContourSegments,0);for(var d=this.triangleCount;0<=--d;)this.triangles[d].check=0;for(var e=-3.4028235E38,d=0;d<this.nContourSegments;d++){e=
null!=this.contoursDiscrete?this.contoursDiscrete[d]:this.contourFromZero?a+1*d/this.nContourSegments*b:0==d?-3.4028235E38:d==this.nContourSegments-1?3.4028235E38:a+1*(d-1)/(this.nContourSegments-1)*b;null==this.contoursDiscrete&&Math.abs(e)<c&&(e=0>e?-c:c);this.contourValuesUsed[d]=e;JU.Logger.info("#contour "+(d+1)+" "+e+" "+this.triangleCount);this.htPts.clear();for(var f=this.triangleCount;0<=--f;)this.triangles[f].isValid&&this.checkContour(this.triangles[f],d,e)}this.valueMin=this.contourValuesUsed[0];
this.valueMax=0==this.contourValuesUsed.length?this.valueMin:this.contourValuesUsed[this.contourValuesUsed.length-1];return!0},"~N,~N,~N");e(c$,"intercept",function(a,b,c){var d=a.pts[b];a=a.pts[(b+1)%3];if(2147483647==d||2147483647==a)return-1;b=d<a?d+"_"+a:a+"_"+d;if(this.htPts.containsKey(b))return this.htPts.get(b).intValue();var e=this.contourVertexes[d].value,f=this.contourVertexes[a].value,g=-1;if(e!=f){var A=(c-e)/(f-e);if(0<=A&&1>=A&&(this.pointA.setT(this.contourVertexes[d]),this.pointB.setT(this.contourVertexes[a]),
c=this.calcContourPoint(c,e,f,this.ptTemp),!Float.isNaN(c))){g=this.addContourVertex(this.ptTemp,c);if(0>g)return-1;this.contourVertexes[g].setValue(c)}}this.htPts.put(b,Integer.$valueOf(g));return g},"J.jvxl.calc.MarchingSquares.Triangle,~N,~N");e(c$,"checkContour",function(a,b,c){if(!(0<this.thisContour&&b+1!=this.thisContour)){var d=this.intercept(a,0,c),e=this.intercept(a,1,c);c=this.intercept(a,2,c);var f=a.pts,g=0;0<=d&&(g+=1);0<=e&&(g+=2);0<=c&&(g+=4);switch(g){case 3:this.addTriangle(f[0],
d,e,2|a.check&1,b);this.addTriangle(d,f[1],e,4|a.check&3,b);this.addTriangle(f[0],e,f[2],a.check&6,b);break;case 5:this.addTriangle(f[0],d,c,2|a.check&5,b);this.addTriangle(d,f[1],c,4|a.check&1,b);this.addTriangle(c,f[1],f[2],a.check&6,b);break;case 6:this.addTriangle(f[0],f[1],c,a.check&5,b);this.addTriangle(c,f[1],e,4|a.check&2,b);this.addTriangle(c,e,f[2],1|a.check&6,b);break;default:return}a.isValid=!1}},"J.jvxl.calc.MarchingSquares.Triangle,~N,~N");e(c$,"getMinMax",function(){return x(-1,[this.valueMin,
this.valueMax])});e(c$,"addAllTriangles",function(){for(var a=0;a<this.triangleCount;a++)if(this.triangles[a].isValid){var b=this.triangles[a];this.surfaceReader.addTriangleCheck(b.pts[0],b.pts[1],b.pts[2],b.check,b.contourIndex,!1,-1)}});c$.$MarchingSquares$ContourVertex$=function(){ia(self.c$);c$=M(function(){ra(this,arguments);this.value=0;N(this,arguments)},J.jvxl.calc.MarchingSquares,"ContourVertex",JU.P3);R(c$,function(a){aa(this,J.jvxl.calc.MarchingSquares.ContourVertex,[]);this.setT(a)},"JU.P3");
e(c$,"setValue",function(a){this.value=a},"~N");n(c$,"toString",function(){return this.value+" "+this.x+" "+this.y+" "+this.z});c$=qa()};c$.$MarchingSquares$Triangle$=function(){ia(self.c$);c$=M(function(){ra(this,arguments);this.pts=null;this.check=0;this.isValid=!0;this.contourIndex=0;N(this,arguments)},J.jvxl.calc.MarchingSquares,"Triangle");R(c$,function(a,b,c,d,e){this.pts=u(-1,[a,b,c]);this.check=d;this.contourIndex=e},"~N,~N,~N,~N,~N");c$=qa()};$(c$,"CONTOUR_POINT",-1,"VERTEX_POINT",-2,"EDGE_POINT",
-3,"nContourMax",100,"defaultContourCount",9)});F("J.shapesurface");L(["J.shape.Mesh"],"J.shapesurface.IsosurfaceMesh","java.lang.Float java.util.Hashtable JU.AU $.BS $.CU $.Lst $.M4 $.P3 $.P3i $.PT $.SB $.V3 J.api.Interface J.jvxl.data.JvxlCoder $.JvxlData JS.T JU.C $.ColorEncoder $.Logger JV.Viewer".split(" "),function(){c$=M(function(){this.jvxlData=null;this.vertexIncrement=1;this.firstRealVertex=-1;this.dataType=0;this.hasGridPoints=!1;this.assocGridPointNormals=this.assocGridPointMap=this.info=
this.calculatedVolume=this.calculatedArea=null;this.mergeAssociatedNormalCount=0;this.bsVdw=this.colorEncoder=this.contourColixes=this.contourValues=this.centers=null;this.colorPhased=!1;N(this,arguments)},J.shapesurface,"IsosurfaceMesh",J.shape.Mesh);n(c$,"getResolution",function(){return 1/this.jvxlData.pointsPerAngstrom});R(c$,function(a,b,c,d){this.mesh1(a,b,c,d);this.jvxlData=new J.jvxl.data.JvxlData;this.checkByteCount=2;this.jvxlData.version=JV.Viewer.getJmolVersion()},"JV.Viewer,~S,~N,~N");
e(c$,"clearType",function(a,b){this.clear(a);this.jvxlData.clear();this.colorEncoder=this.centers=this.calculatedArea=this.calculatedVolume=this.bsVdw=this.assocGridPointNormals=this.assocGridPointMap=null;this.colorsExplicit=this.colorPhased=!1;this.firstRealVertex=-1;this.hasGridPoints=b;this.isColorSolid=!0;this.nSets=this.mergeAssociatedNormalCount=0;this.pcs=null;this.showPoints=b;this.vertexColorMap=this.vcs=this.surfaceSet=null;this.vertexIncrement=1;this.vvs=this.vertexSets=null},"~S,~B");
e(c$,"allocVertexColixes",function(){if(null==this.vcs){this.vcs=V(this.vc,0);for(var a=this.vc;0<=--a;)this.vcs[a]=this.colix}this.isColorSolid=!1});e(c$,"addVertexCopy",function(a,b,c,d,e){a=this.addVCVal(a,b,e);switch(c){case -1:0>this.firstRealVertex&&(this.firstRealVertex=a);break;case -2:this.hasGridPoints=!0;break;case -3:this.vertexIncrement=3;break;default:0>this.firstRealVertex&&(this.firstRealVertex=a),d&&(null==this.assocGridPointMap&&(this.assocGridPointMap=new java.util.Hashtable),this.assocGridPointMap.put(Integer.$valueOf(a),
Integer.$valueOf(c+this.mergeAssociatedNormalCount)))}return a},"JU.T3,~N,~N,~B,~B");n(c$,"setTranslucent",function(a,b){this.colix=JU.C.getColixTranslucent3(this.colix,a,b);if(null!=this.vcs)for(var c=this.vc;0<=--c;)this.vcs[c]=JU.C.getColixTranslucent3(this.vcs[c],a,b)},"~B,~N");e(c$,"setMerged",function(a){this.mergePolygonCount0=(this.isMerged=a)?this.pc:0;this.mergeVertexCount0=a?this.vc:0;a&&(this.mergeAssociatedNormalCount+=this.jvxlData.nPointsX*this.jvxlData.nPointsY*this.jvxlData.nPointsZ,
this.assocGridPointNormals=null)},"~B");n(c$,"sumVertexNormals",function(a,b){J.shape.Mesh.sumVertexNormals2(this,a,b);if(null!=this.assocGridPointMap&&0<b.length&&!this.isMerged){null==this.assocGridPointNormals&&(this.assocGridPointNormals=new java.util.Hashtable);for(var c,d=this.assocGridPointMap.entrySet().iterator();d.hasNext()&&((c=d.next())||1);){var e=c.getValue();this.assocGridPointNormals.containsKey(e)||this.assocGridPointNormals.put(e,JU.V3.new3(0,0,0));this.assocGridPointNormals.get(e).add(b[c.getKey().intValue()])}for(d=
this.assocGridPointMap.entrySet().iterator();d.hasNext()&&((c=d.next())||1);)b[c.getKey().intValue()]=this.assocGridPointNormals.get(c.getValue())}},"~A,~A");e(c$,"getCenters",function(){if(null!=this.centers)return this.centers;this.centers=Array(this.pc);for(var a=0;a<this.pc;a++){var b=this.pis[a];if(null!=b){var c=this.centers[a]=JU.P3.newP(this.vs[b[0]]);c.add(this.vs[b[1]]);c.add(this.vs[b[2]]);c.scale(0.33333334)}}return this.centers});e(c$,"getContours",function(){var a=this.jvxlData.nContours;
if(0==a||null==this.pis||(this.havePlanarContours=null!=this.jvxlData.jvxlPlane))return null;0>a&&(a=-1-a);var b=this.jvxlData.vContours;if(null!=b){for(var c=0;c<a&&!(6<b[c].size());c++)J.jvxl.data.JvxlCoder.set3dContourVector(b[c],this.pis,this.vs);return this.jvxlData.vContours}b=Array(a);for(c=0;c<a;c++)b[c]=new JU.Lst;if(null==this.jvxlData.contourValuesUsed){for(var d=(this.jvxlData.valueMappedToBlue-this.jvxlData.valueMappedToRed)/(a+1),c=0;c<a;c++){var e=this.jvxlData.valueMappedToRed+(c+
1)*d;J.shapesurface.IsosurfaceMesh.get3dContour(this,b[c],e,this.jvxlData.contourColixes[c])}JU.Logger.info(a+" contour lines; separation = "+d)}else for(c=0;c<a;c++)e=this.jvxlData.contourValuesUsed[c],J.shapesurface.IsosurfaceMesh.get3dContour(this,b[c],e,this.jvxlData.contourColixes[c]);this.jvxlData.contourColixes=V(a,0);this.jvxlData.contourValues=x(a,0);for(c=0;c<a;c++)this.jvxlData.contourValues[c]=b[c].get(2).floatValue(),this.jvxlData.contourColixes[c]=b[c].get(3)[0];return this.jvxlData.vContours=
b});c$.get3dContour=e(c$,"get3dContour",function(a,b,c,d){var e=JU.BS.newN(a.pc),f=new JU.SB,g=JU.C.getArgb(d);J.shapesurface.IsosurfaceMesh.setContourVector(b,a.pc,e,c,d,g,f);for(d=0;d<a.pc;d++)null!=a.setABC(d)&&J.shapesurface.IsosurfaceMesh.addContourPoints(b,e,d,f,a.vs,a.vvs,a.iA,a.iB,a.iC,c)},"J.shapesurface.IsosurfaceMesh,JU.Lst,~N,~N");c$.setContourVector=e(c$,"setContourVector",function(a,b,c,d,e,f,g){a.add(0,Integer.$valueOf(b));a.add(1,c);a.add(2,Float.$valueOf(d));a.add(3,V(-1,[e]));a.add(4,
u(-1,[f]));a.add(5,g)},"JU.Lst,~N,JU.BS,~N,~N,~N,JU.SB");c$.addContourPoints=e(c$,"addContourPoints",function(a,b,c,d,e,f,g,A,k,p){var l=null,q=null,v=0,s=J.shapesurface.IsosurfaceMesh.checkPt(f,g,A,p);Float.isNaN(s)||(l=J.shapesurface.IsosurfaceMesh.getContourPoint(e,g,A,s),v|=1);var n=1==s?NaN:J.shapesurface.IsosurfaceMesh.checkPt(f,A,k,p);Float.isNaN(n)||(q=J.shapesurface.IsosurfaceMesh.getContourPoint(e,A,k,n),0==v&&(l=q,s=n),v|=2);switch(v){case 0:return;case 1:if(0==s)return;case 2:n=1==n?NaN:
J.shapesurface.IsosurfaceMesh.checkPt(f,k,g,p),Float.isNaN(n)||(q=J.shapesurface.IsosurfaceMesh.getContourPoint(e,k,g,n),v|=4)}switch(v){case 3:case 5:case 6:break;default:return}b.set(c);J.jvxl.data.JvxlCoder.appendContourTriangleIntersection(v,s,n,d);a.addLast(l);a.addLast(q)},"JU.Lst,JU.BS,~N,JU.SB,~A,~A,~N,~N,~N,~N");c$.checkPt=e(c$,"checkPt",function(a,b,c,d){var e,f;return d==(e=a[b])?0:d==(f=a[c])?1:e<d==d<f?(d-e)/(f-e):NaN},"~A,~N,~N,~N");c$.getContourPoint=e(c$,"getContourPoint",function(a,
b,c,d){var e=new JU.P3;e.sub2(a[c],a[b]);e.scaleAdd2(d,e,a[b]);return e},"~A,~N,~N,~N");e(c$,"setDiscreteColixes",function(a,b){null!=a&&(this.jvxlData.contourValues=a);if(null==a||0==a.length)a=this.jvxlData.contourValues=this.jvxlData.contourValuesUsed;null==b&&null!=this.jvxlData.contourColixes?b=this.jvxlData.contourColixes:(this.jvxlData.contourColixes=b,this.jvxlData.contourColors=JU.C.getHexCodes(b));if(!(null==this.vs||null==this.vvs||null==a)){var c=a.length,d=a[c-1];this.colorCommand=null;
var e=null!=b&&0<b.length;this.isColorSolid=e&&null!=this.jvxlData.jvxlPlane;if(null!=this.jvxlData.vContours){if(e)for(var f=0;f<this.jvxlData.vContours.length;f++)c=b[f%b.length],this.jvxlData.vContours[f].get(3)[0]=c,this.jvxlData.vContours[f].get(4)[0]=JU.C.getArgb(c)}else{this.pcs=V(this.pc,0);this.colorsExplicit=!1;for(f=0;f<this.pc;f++){var g=this.pis[f];if(null!=g){this.pcs[f]=0;for(var g=(this.vvs[g[0]]+this.vvs[g[1]]+this.vvs[g[2]])/3,A=c;0<=--A;)if(g>=a[A]&&g<d){this.pcs[f]=e?b[A%b.length]:
0;break}}}}}},"~A,~A");e(c$,"getContourList",function(){var a=new java.util.Hashtable;a.put("values",null==this.jvxlData.contourValuesUsed?this.jvxlData.contourValues:this.jvxlData.contourValuesUsed);var b=new JU.Lst;if(null!=this.jvxlData.contourColixes){for(var c=0;c<this.jvxlData.contourColixes.length;c++)b.addLast(JU.CU.colorPtFromInt(JU.C.getArgb(this.jvxlData.contourColixes[c]),null));a.put("colors",b)}return a},"JV.Viewer");e(c$,"deleteContours",function(){this.jvxlData.contourValuesUsed=null;
this.jvxlData.contourValues=null;this.jvxlData.contourColixes=null;this.jvxlData.vContours=null});e(c$,"setVertexColorMap",function(){this.vertexColorMap=new java.util.Hashtable;for(var a=-999,b=null,c=this.vc;0<=--c;){var d=this.vcs[c];d!=a&&(d=JU.C.getHexCode(a=d),b=this.vertexColorMap.get(d),null==b&&this.vertexColorMap.put(d,b=new JU.BS));b.set(c)}});e(c$,"setVertexColixesForAtoms",function(a,b,c,d){this.jvxlData.vertexDataOnly=!0;this.jvxlData.vertexColors=u(this.vc,0);this.jvxlData.nVertexColors=
this.vc;var e=a.ms.at;a=a.gdata;for(var f=this.mergeVertexCount0;f<this.vc;f++){var g=this.vertexSource[f];if(!(0>g)&&d.get(g)){this.jvxlData.vertexColors[f]=a.getColorArgbOrGray(this.vcs[f]=JU.C.copyColixTranslucency(this.colix,e[g].colixAtom));var A=null==b?0:b[c[g]];0==A&&(A=e[g].colixAtom);this.vcs[f]=JU.C.copyColixTranslucency(this.colix,A)}}},"JV.Viewer,~A,~A,JU.BS");e(c$,"colorVertices",function(a,b,c){if(null!=this.vertexSource){a=JU.C.copyColixTranslucency(this.colix,a);var d=c?new JU.BS:
b;this.checkAllocColixes();if(c)for(var e=0;e<this.vc;e++){var f=this.vertexSource[e];0<=f&&b.get(f)&&(this.vcs[e]=a,null!=d&&d.set(e))}else for(e=0;e<this.vc;e++)d.get(e)&&(this.vcs[e]=a);c&&(a=JU.C.getHexCode(a),null==this.vertexColorMap&&(this.vertexColorMap=new java.util.Hashtable),J.shapesurface.IsosurfaceMesh.addColorToMap(this.vertexColorMap,a,b))}},"~N,JU.BS,~B");e(c$,"checkAllocColixes",function(){(null==this.vcs||null==this.vertexColorMap&&this.isColorSolid)&&this.allocVertexColixes();this.isColorSolid=
!1});c$.addColorToMap=e(c$,"addColorToMap",function(a,b,c){for(var d=null,e,f=a.entrySet().iterator();f.hasNext()&&((e=f.next())||1);)e.getKey()===b?(d=e.getValue(),d.or(c)):e.getValue().andNot(c);null==d&&a.put(b,c)},"java.util.Map,~S,JU.BS");e(c$,"setJvxlColorMap",function(a){this.jvxlData.diameter=this.diameter;this.jvxlData.color=JU.C.getHexCode(this.colix);this.jvxlData.meshColor=0==this.meshColix?null:JU.C.getHexCode(this.meshColix);this.jvxlData.translucency=30720==(this.colix&30720)?-1:JU.C.getColixTranslucencyFractional(this.colix);
this.jvxlData.rendering=this.getRendering().substring(1);this.jvxlData.colorScheme=null==this.colorEncoder?null:this.colorEncoder.getColorScheme();null==this.jvxlData.vertexColors&&(this.jvxlData.nVertexColors=null==this.vertexColorMap?0:this.vertexColorMap.size());if(!(null==this.vertexColorMap||null==this.vertexSource||!a)){null==this.jvxlData.vertexColorMap&&(this.jvxlData.vertexColorMap=new java.util.Hashtable);var b;for(a=this.vertexColorMap.entrySet().iterator();a.hasNext()&&((b=a.next())||
1);){var c=b.getValue();if(!c.isEmpty()){for(var d=b.getKey(),e=new JU.BS,f=0;f<this.vc;f++)c.get(this.vertexSource[f])&&e.set(f);J.shapesurface.IsosurfaceMesh.addColorToMap(this.jvxlData.vertexColorMap,d,e)}}this.jvxlData.nVertexColors=this.jvxlData.vertexColorMap.size();0==this.jvxlData.vertexColorMap.size()&&(this.jvxlData.vertexColorMap=null)}},"~B");e(c$,"setColorCommand",function(){if(!(null==this.colorEncoder||null==(this.colorCommand=this.colorEncoder.getColorScheme())))this.colorCommand=
this.colorCommand.equals("inherit")?"#inherit;":"color $"+JU.PT.esc(this.thisID)+JU.PT.esc(this.colorCommand)+" range "+(this.jvxlData.isColorReversed?this.jvxlData.valueMappedToBlue+" "+this.jvxlData.valueMappedToRed:this.jvxlData.valueMappedToRed+" "+this.jvxlData.valueMappedToBlue)});e(c$,"setColorsFromJvxlData",function(a){this.diameter=this.jvxlData.diameter;-1!=a&&(-2147483648!=a&&2147483647!=a?this.colix=JU.C.getColix(a):null!=this.jvxlData.color&&(this.colix=JU.C.getColixS(this.jvxlData.color)));
0==this.colix&&(this.colix=5);this.colix=JU.C.getColixTranslucent3(this.colix,0!=this.jvxlData.translucency,this.jvxlData.translucency);a=0==this.jvxlData.translucency?NaN:this.jvxlData.translucency;null!=this.jvxlData.meshColor&&(this.meshColix=JU.C.getColixS(this.jvxlData.meshColor));this.setJvxlDataRendering();this.isColorSolid=!this.jvxlData.isBicolorMap&&null==this.jvxlData.vertexColors&&null==this.jvxlData.vertexColorMap;if(null==this.colorEncoder)return!1;if(null==this.jvxlData.vertexColorMap){if(null!=
this.jvxlData.colorScheme){var b=this.jvxlData.colorScheme,c=b.startsWith("translucent ");c&&(b=b.substring(12),a=NaN);this.colorEncoder.setColorScheme(b,c);this.remapColors(null,null,a)}}else{if(null!=this.jvxlData.baseColor)for(a=this.vc;0<=--a;)this.vcs[a]=this.colix;for(c=this.jvxlData.vertexColorMap.entrySet().iterator();c.hasNext()&&((b=c.next())||1);){var d=b.getValue(),e=JU.C.copyColixTranslucency(this.colix,JU.C.getColixS(b.getKey()));for(a=d.nextSetBit(0);0<=a;a=d.nextSetBit(a+1))this.vcs[a]=
e}}return!0},"~N");e(c$,"setJvxlDataRendering",function(){if(null!=this.jvxlData.rendering)for(var a=JU.PT.getTokens(this.jvxlData.rendering),b=0;b<a.length;b++)this.setTokenProperty(JS.T.getTokFromName(a[b]),!0)});e(c$,"remapColors",function(a,b,c){null==b&&(b=this.colorEncoder);null==b&&(b=this.colorEncoder=new JU.ColorEncoder(null,a));this.colorEncoder=b;this.setColorCommand();Float.isNaN(c)?c=JU.C.getColixTranslucencyLevel(this.colix):this.colix=JU.C.getColixTranslucent3(this.colix,!0,c);var d=
b.lo,e=b.hi,f=null!=this.vertexSource&&15==b.currentPalette;this.pcs=this.vertexColorMap=null;this.colorsExplicit=!1;this.jvxlData.baseColor=null;this.jvxlData.vertexCount=this.vc;if(!(null==this.vvs||0==this.jvxlData.vertexCount))if((null==this.vcs||this.vcs.length!=this.vc)&&this.allocVertexColixes(),f){this.jvxlData.vertexDataOnly=!0;this.jvxlData.vertexColors=u(this.vc,0);this.jvxlData.nVertexColors=this.vc;b=a.ms.at;c=a.gdata;for(a=this.mergeVertexCount0;a<this.vc;a++)d=this.vertexSource[a],
0<=d&&d<b.length&&(this.jvxlData.vertexColors[a]=c.getColorArgbOrGray(this.vcs[a]=JU.C.copyColixTranslucency(this.colix,b[d].colixAtom)))}else if(this.jvxlData.vertexColors=null,this.jvxlData.vertexColorMap=null,this.jvxlData.isBicolorMap)for(a=this.mergeVertexCount0;a<this.vc;a++)this.vcs[a]=JU.C.copyColixTranslucency(this.colix,0>this.vvs[a]?this.jvxlData.minColorIndex:this.jvxlData.maxColorIndex);else{this.jvxlData.isColorReversed=b.isReversed;3.4028235E38!=e&&(this.jvxlData.valueMappedToRed=d,
this.jvxlData.valueMappedToBlue=e);b.setRange(this.jvxlData.valueMappedToRed,this.jvxlData.valueMappedToBlue,this.jvxlData.isColorReversed);d=JU.C.isColixTranslucent(this.colix);b.isTranslucent&&(d||(this.colix=JU.C.getColixTranslucent3(this.colix,!0,0.5)),d=!1);this.vcs=JU.AU.ensureLengthShort(this.vcs,this.vc);for(a=this.vc;--a>=this.mergeVertexCount0;)this.vcs[a]=b.getColorIndex(this.vvs[a]);this.setTranslucent(d,c);this.colorEncoder=b;c=this.getContours();if(null!=c)for(a=c.length;0<=--a;)d=c[a].get(2).floatValue(),
e=c[a].get(3),e[0]=b.getColorIndex(d),c[a].get(4)[0]=JU.C.getArgb(e[0]);if(null!=this.contourValues){this.contourColixes=V(this.contourValues.length,0);for(a=0;a<this.contourValues.length;a++)this.contourColixes[a]=b.getColorIndex(this.contourValues[a]);this.setDiscreteColixes(null,null)}this.jvxlData.isJvxlPrecisionColor=!0;J.jvxl.data.JvxlCoder.jvxlCreateColorData(this.jvxlData,this.vvs);this.setColorCommand();this.isColorSolid=!1}},"JV.Viewer,JU.ColorEncoder,~N");e(c$,"reinitializeLightingAndColor",
function(a){this.initialize(this.lighting,null,null);if(null!=this.colorEncoder||this.jvxlData.isBicolorMap)this.vcs=null,this.remapColors(a,null,NaN)},"JV.Viewer");n(c$,"getBoundingBox",function(){return this.jvxlData.boundingBox});n(c$,"setBoundingBox",function(a){this.jvxlData.boundingBox=a},"~A");e(c$,"merge",function(a){var b=this.vc+(null==a?0:a.vc);null==this.pis&&(this.pis=u(0,0,0));null!=a&&null==a.pis&&(a.pis=u(0,0,0));var c=(null==this.bsSlabDisplay||0==this.pc?this.pc:this.bsSlabDisplay.cardinality())+
(null==a||0==a.pc?0:null==a.bsSlabDisplay?a.pc:a.bsSlabDisplay.cardinality());null==this.vs&&(this.vs=[]);this.vs=JU.AU.ensureLength(this.vs,b);this.vvs=JU.AU.ensureLengthA(this.vvs,b);var d=null!=this.vertexSource&&(null==a||null!=a.vertexSource);this.vertexSource=JU.AU.ensureLengthI(this.vertexSource,b);var e=JU.AU.newInt2(c),f=J.shapesurface.IsosurfaceMesh.mergePolygons(this,0,0,e);if(null!=a){J.shapesurface.IsosurfaceMesh.mergePolygons(a,f,this.vc,e);for(f=0;f<a.vc;f++,this.vc++)this.vs[this.vc]=
a.vs[f],this.vvs[this.vc]=a.vvs[f],d&&(this.vertexSource[this.vc]=a.vertexSource[f])}this.pc=this.polygonCount0=c;this.vc=this.vertexCount0=b;0<c&&this.resetSlab();this.pis=e},"J.jvxl.data.MeshData");c$.mergePolygons=e(c$,"mergePolygons",function(a,b,c,d){for(var e,f=0;f<a.pc;f++)if(!(null==(e=a.pis[f])||null!=a.bsSlabDisplay&&!a.bsSlabDisplay.get(f)))if(d[b++]=a.pis[f],0<c)for(var g=0;3>g;g++)e[g]+=c;return b},"JU.MeshSurface,~N,~N,~A");n(c$,"getUnitCell",function(){return null!=this.unitCell||null!=
(this.unitCell=this.vwr.ms.am[this.modelIndex].biosymmetry)||null!=(this.unitCell=this.vwr.ms.getUnitCell(this.modelIndex))||null!=this.spanningVectors&&null!=(this.unitCell=J.api.Interface.getSymmetry(this.vwr,"symmetry").getUnitCell(this.spanningVectors,!0,null))?this.unitCell:null});e(c$,"fixLattice",function(){if(null!=this.getUnitCell()){var a=new JU.P3i,b=JU.P3i.new3(z(this.lattice.x),z(this.lattice.y),z(this.lattice.z));this.jvxlData.fixedLattice=this.lattice;this.lattice=null;this.unitCell.setMinMaxLatticeParameters(a,
b);var c=(b.x-a.x)*(b.y-a.y)*(b.z-a.z),d=new JU.P3,e=this.vc,f=c*this.vc;this.vs=JU.AU.arrayCopyPt(this.vs,f);this.vvs=null==this.vvs?null:JU.AU.ensureLengthA(this.vvs,f);var g=this.pc;this.pis=JU.AU.arrayCopyII(this.pis,c*this.pc);c=0;this.normixes=JU.AU.arrayCopyShort(this.normixes,f);for(f=a.x;f<b.x;f++)for(var A=a.y;A<b.y;A++)for(var k=a.z;k<b.z;k++)if(!(0==f&&0==A&&0==k)){d.set(f,A,k);this.unitCell.toCartesian(d,!1);for(var p=0;p<e;p++){this.normixes[this.vc]=this.normixes[p];var l=JU.P3.newP(this.vs[p]);
l.add(d);this.addVCVal(l,this.vvs[p],!1)}c+=e;for(p=0;p<g;p++)l=JU.AU.arrayCopyI(this.pis[p],-1),l[0]+=c,l[1]+=c,l[2]+=c,this.addPolygon(l,null)}a=new JU.P3;b=new JU.P3;this.setBox(a,b);this.jvxlData.boundingBox=D(-1,[a,b])}});n(c$,"getMinDistance2ForVertexGrouping",function(){return null!=this.jvxlData.boundingBox&&null!=this.jvxlData.boundingBox[0]&&5>this.jvxlData.boundingBox[1].distanceSquared(this.jvxlData.boundingBox[0])?1E-10:1E-8});n(c$,"getVisibleVertexBitSet",function(){var a=this.getVisibleVBS();
if(0<=this.jvxlData.thisSet)for(var b=0;b<this.vc;b++)this.vertexSets[b]!=this.jvxlData.thisSet&&a.clear(b);return a});e(c$,"updateCoordinates",function(a,b){var c=null==b||this.isModelConnected;if(!c)for(var d=0;d<this.connectedAtoms.length;d++)if(0<=this.connectedAtoms[d]&&b.get(this.connectedAtoms[d])){c=!0;break}c&&(this.isModelConnected?this.mat4=this.vwr.ms.am[this.modelIndex].mat4:(null==this.mat4&&(this.mat4=JU.M4.newM4(null)),this.mat4.mul2(a,this.mat4)),this.recalcAltVertices=!0)},"JU.M4,JU.BS");
e(c$,"getDataRange",function(){return null!=this.jvxlData.jvxlPlane&&null==this.colorEncoder?null:x(-1,[this.jvxlData.mappedDataMin,this.jvxlData.mappedDataMax,this.jvxlData.isColorReversed?this.jvxlData.valueMappedToBlue:this.jvxlData.valueMappedToRed,this.jvxlData.isColorReversed?this.jvxlData.valueMappedToRed:this.jvxlData.valueMappedToBlue])})});F("J.jvxl.readers");L(["J.jvxl.readers.SurfaceReader"],"J.jvxl.readers.VolumeDataReader",["java.lang.Float","JU.AU","$.SB","J.jvxl.data.JvxlCoder","JU.Logger"],
function(){c$=M(function(){this.dataType=0;this.allowMapData=this.precalculateVoxelData=!1;this.point=null;this.maxGrid=this.ptsPerAngstrom=0;this.useOriginStepsPoints=!1;N(this,arguments)},J.jvxl.readers,"VolumeDataReader",J.jvxl.readers.SurfaceReader);R(c$,function(){aa(this,J.jvxl.readers.VolumeDataReader,[])});n(c$,"init",function(a){this.initVDR(a)},"J.jvxl.readers.SurfaceGenerator");e(c$,"initVDR",function(a){this.initSR(a);this.useOriginStepsPoints=null!=this.params.origin&&null!=this.params.points&&
null!=this.params.steps;this.dataType=this.params.dataType;this.allowMapData=this.precalculateVoxelData=!0},"J.jvxl.readers.SurfaceGenerator");e(c$,"setup",function(){this.jvxlFileHeaderBuffer=(new JU.SB).append("volume data read from file\n\n");J.jvxl.data.JvxlCoder.jvxlCreateHeaderWithoutTitleOrAtoms(this.volumeData,this.jvxlFileHeaderBuffer)},"~B");n(c$,"readVolumeParameters",function(a){this.setup(a);this.initializeVolumetricData();return!0},"~B");n(c$,"readVolumeData",function(a){try{this.readSurfaceData(a)}catch(b){if(S(b,
Exception))return System.out.println(b.toString()),!1;throw b;}return!0},"~B");e(c$,"readVoxelDataIndividually",function(a){if(!a||this.allowMapData)if(!a||null!=this.volumeData.sr)this.volumeData.setVoxelDataAsArray(this.voxelData=null);else{this.newVoxelDataCube();for(a=0;a<this.nPointsX;++a){var b=JU.AU.newFloat2(this.nPointsY);this.voxelData[a]=b;for(var c=0,d=0;d<this.nPointsY;++d)for(var e=b[d]=x(this.nPointsZ,0),f=0;f<this.nPointsZ;++f,++c)e[f]=this.getValue(a,d,f,c)}}},"~B");e(c$,"setVolumeData",
function(){});e(c$,"setVolumeDataParams",function(){if(null!=this.params.volumeData)return this.setVolumeDataV(this.params.volumeData),!0;if(!this.useOriginStepsPoints)return!1;this.volumetricOrigin.setT(this.params.origin);this.volumetricVectors[0].set(this.params.steps.x,0,0);this.volumetricVectors[1].set(0,this.params.steps.y,0);this.volumetricVectors[2].set(0,0,this.params.steps.z);this.voxelCounts[0]=z(this.params.points.x);this.voxelCounts[1]=z(this.params.points.y);this.voxelCounts[2]=z(this.params.points.z);
if(1>this.voxelCounts[0]||1>this.voxelCounts[1]||1>this.voxelCounts[2])return!1;this.showGridInfo();return!0});e(c$,"showGridInfo",function(){JU.Logger.info("grid origin  = "+this.params.origin);JU.Logger.info("grid steps   = "+this.params.steps);JU.Logger.info("grid points  = "+this.params.points);this.ptTemp.x=this.params.steps.x*this.params.points.x;this.ptTemp.y=this.params.steps.y*this.params.points.y;this.ptTemp.z=this.params.steps.z*this.params.points.z;JU.Logger.info("grid lengths = "+this.ptTemp);
this.ptTemp.add(this.params.origin);JU.Logger.info("grid max xyz = "+this.ptTemp)});e(c$,"setVoxelRange",function(a,b,c,d,e,f){b>=c&&(b=-10,c=10);var g=c-b,A=this.params.resolution;3.4028235E38!=A&&(d=A);c=G(Math.floor(g*d))+1;c>e&&(0<(this.dataType&256)?3.4028235E38==A?(this.isQuiet||JU.Logger.info("Maximum number of voxels for index="+a+" exceeded ("+c+") -- set to "+e),c=e):this.isQuiet||JU.Logger.info("Warning -- high number of grid points: "+c):3.4028235E38==A&&(c=e));1==c&&(c=2);d=(c-1)/g;d<
f&&(c=G(Math.floor(f*g+1)),d=(c-1)/g);e=this.volumeData.volumetricVectorLengths[a]=1/d;this.voxelCounts[a]=c;this.isQuiet||JU.Logger.info("isosurface resolution for axis "+(a+1)+" set to "+d+" points/Angstrom; "+this.voxelCounts[a]+" voxels");switch(a){case 0:this.volumetricVectors[0].set(e,0,0);this.volumetricOrigin.x=b;break;case 1:this.volumetricVectors[1].set(0,e,0);this.volumetricOrigin.y=b;break;case 2:this.volumetricVectors[2].set(0,0,e),this.volumetricOrigin.z=b,this.isEccentric&&this.eccentricityMatrix.rotate(this.volumetricOrigin),
null!=this.center&&!Float.isNaN(this.center.x)&&this.volumetricOrigin.add(this.center)}this.isEccentric&&this.eccentricityMatrix.rotate(this.volumetricVectors[a]);return this.voxelCounts[a]},"~N,~N,~N,~N,~N,~N");n(c$,"readSurfaceData",function(a){this.readSurfaceDataVDR(a)},"~B");e(c$,"readSurfaceDataVDR",function(a){this.isProgressive&&!a?(this.nDataPoints=this.volumeData.setVoxelCounts(this.nPointsX,this.nPointsY,this.nPointsZ),this.voxelData=null):this.precalculateVoxelData?this.generateCube():
this.readVoxelDataIndividually(a)},"~B");e(c$,"generateCube",function(){JU.Logger.info("data type: user volumeData");JU.Logger.info("voxel grid origin:"+this.volumetricOrigin);for(var a=0;3>a;++a)JU.Logger.info("voxel grid vector:"+this.volumetricVectors[a]);JU.Logger.info("Read "+this.nPointsX+" x "+this.nPointsY+" x "+this.nPointsZ+" data points")});n(c$,"closeReader",function(){})});F("J.jvxl.readers");L(["J.jvxl.readers.VolumeDataReader","JU.BS","$.P3","$.P3i","J.atomdata.AtomData"],"J.jvxl.readers.AtomDataReader",
"java.lang.Float java.util.Date JU.AU $.SB $.V3 J.atomdata.RadiusData J.c.VDW J.jvxl.data.JvxlCoder JU.BSUtil $.Logger".split(" "),function(){c$=M(function(){this.maxDistance=0;this.fileDotModel=this.fileName=this.contactPair=null;this.modelIndex=0;this.myIndex=this.atomIndex=this.atomNo=this.atomProp=this.atomRadius=this.atomXyzTruncated=this.atomData=null;this.firstNearbyAtom=this.nearbyAtomCount=this.myAtomCount=this.ac=0;this.bsNearby=this.bsMyIgnored=this.bsMySelected=null;this.doUseIterator=
this.havePlane=this.doAddHydrogens=!1;this.theProperty=0;this.haveOneProperty=!1;this.sr=this.minPtsPerAng=0;this.rs2=this.rs=null;this.maxRS=0;this.thisAtomSet=this.thisPlane=null;this.vl2=this.vl1=this.vl0=this.margin=this.thisX=0;this.ptV=this.pt1=this.pt0=this.ptZ0=this.ptY0=this.voxelSource=this.noFaceSpheres=this.validSpheres=this.bsSurfaceVoxels=null;N(this,arguments)},J.jvxl.readers,"AtomDataReader",J.jvxl.readers.VolumeDataReader);Z(c$,function(){this.atomData=new J.atomdata.AtomData;this.bsMySelected=
new JU.BS;this.bsMyIgnored=new JU.BS;this.ptY0=new JU.P3;this.ptZ0=new JU.P3;this.pt0=new JU.P3i;this.pt1=new JU.P3i;this.ptV=new JU.P3});R(c$,function(){aa(this,J.jvxl.readers.AtomDataReader,[])});e(c$,"initADR",function(a){this.initVDR(a);this.precalculateVoxelData=!0},"J.jvxl.readers.SurfaceGenerator");n(c$,"setup",function(){this.setup2()},"~B");e(c$,"setup2",function(){this.contactPair=this.params.contactPair;this.doAddHydrogens=null!=this.sg.atomDataServer&&this.params.addHydrogens;this.modelIndex=
this.params.modelIndex;null!=this.params.bsIgnore&&(this.bsMyIgnored=this.params.bsIgnore);if(null!=this.params.volumeData){this.setVolumeDataV(this.params.volumeData);this.setBBox(this.volumeData.volumetricOrigin,0);this.ptV.setT(this.volumeData.volumetricOrigin);for(var a=0;3>a;a++)this.ptV.scaleAdd2(this.volumeData.voxelCounts[a]-1,this.volumeData.volumetricVectors[a],this.ptV);this.setBBox(this.ptV,0)}(this.havePlane=null!=this.params.thePlane)&&this.volumeData.setPlaneParameters(this.params.thePlane)});
e(c$,"markPlaneVoxels",function(a,b){for(var c=0,d=this.thisX*this.yzCount,e=d+this.yzCount;d<e;d++,c++)this.volumeData.getPoint(d,this.ptV),this.thisPlane[c]=this.ptV.distance(a)-b},"JU.P3,~N");e(c$,"setVolumeForPlane",function(){this.useOriginStepsPoints?(this.xyzMin=JU.P3.newP(this.params.origin),this.xyzMax=JU.P3.newP(this.params.origin),this.xyzMax.add3((this.params.points.x-1)*this.params.steps.x,(this.params.points.y-1)*this.params.steps.y,(this.params.points.z-1)*this.params.steps.z)):null==
this.params.boundingBox?(this.getAtoms(this.params.bsSelected,!1,!0,!1,!1,!1,!1,this.params.mep_marginAngstroms,this.params.modelInvRotation),null==this.xyzMin&&(this.xyzMin=JU.P3.new3(-10,-10,-10),this.xyzMax=JU.P3.new3(10,10,10))):(this.xyzMin=JU.P3.newP(this.params.boundingBox[0]),this.xyzMax=JU.P3.newP(this.params.boundingBox[1]));this.setRanges(this.params.plane_ptsPerAngstrom,this.params.plane_gridMax,0)});e(c$,"getAtoms",function(a,b,c,d,e,f,g,A,k){f&&(c=!0);c&&(null==this.params.atomRadiusData&&
(this.params.atomRadiusData=new J.atomdata.RadiusData(null,1,J.atomdata.RadiusData.EnumType.FACTOR,J.c.VDW.AUTO)),this.atomData.radiusData=this.params.atomRadiusData,this.atomData.radiusData.valueExtended=this.params.solventExtendedAtomRadius,b&&(this.atomData.radiusData.vdwType=J.c.VDW.NOJMOL));this.atomData.modelIndex=this.modelIndex;this.atomData.bsSelected=a;this.atomData.bsIgnored=this.bsMyIgnored;this.sg.fillAtomData(this.atomData,1|(e?16:0)|(d?4:0)|(c?2:0));this.doUseIterator&&(this.atomData.bsSelected=
null);this.ac=this.atomData.ac;this.modelIndex=this.atomData.firstModelIndex;e=!1;for(d=0;d<this.ac;d++){if((null==a||a.get(d))&&!this.bsMyIgnored.get(d)){if(this.havePlane&&Math.abs(this.volumeData.distancePointToPlane(this.atomData.xyz[d]))>2*(this.atomData.atomRadius[d]=this.getWorkingRadius(d,A)))continue;this.bsMySelected.set(d);e=!this.havePlane}if(c&&(f||e))this.atomData.atomRadius[d]=this.getWorkingRadius(d,A)}g=c&&b?this.getWorkingRadius(-1,A):0;this.myAtomCount=JU.BSUtil.cardinalityOf(this.bsMySelected);
e=JU.BSUtil.copy(this.bsMySelected);var p=0;this.atomProp=null;this.theProperty=3.4028235E38;this.haveOneProperty=!1;A=this.params.theProperty;if(0<this.myAtomCount){var l=null;if(b){this.atomData.bsSelected=e;this.sg.atomDataServer.fillAtomData(this.atomData,8);l=Array(p=this.atomData.hydrogenAtomCount);for(d=0;d<this.atomData.hAtoms.length;d++)if(null!=this.atomData.hAtoms[d])for(b=this.atomData.hAtoms[d].length;0<=--b;)l[--p]=this.atomData.hAtoms[d][b];p=l.length;JU.Logger.info(p+" attached hydrogens added")}b=
p+this.myAtomCount;c&&(this.atomRadius=x(b,0));this.atomXyzTruncated=Array(b);null!=this.params.theProperty&&(this.atomProp=x(b,0));this.atomNo=u(b,0);this.atomIndex=u(b,0);this.myIndex=u(this.ac,0);for(d=0;d<p;d++)c&&(this.atomRadius[d]=g),this.atomXyzTruncated[d]=l[d],this.atomNo[d]=-1,null!=this.atomProp&&this.addAtomProp(d,NaN);this.myAtomCount=p;for(d=e.nextSetBit(0);0<=d;d=e.nextSetBit(d+1))null!=this.atomProp&&this.addAtomProp(this.myAtomCount,null!=A&&d<A.length?A[d]:NaN),this.atomXyzTruncated[this.myAtomCount]=
this.atomData.xyz[d],this.atomNo[this.myAtomCount]=this.atomData.atomicNumber[d],this.atomIndex[this.myAtomCount]=d,this.myIndex[d]=this.myAtomCount,c&&(this.atomRadius[this.myAtomCount]=this.atomData.atomRadius[d]),this.myAtomCount++}this.firstNearbyAtom=this.myAtomCount;this.isQuiet||JU.Logger.info(this.myAtomCount+" atoms will be used in the surface calculation");null!=k&&this.atomData.transformXYZ(k,a);0==this.myAtomCount&&(this.setBBox(JU.P3.new3(10,10,10),0),this.setBBox(JU.P3.new3(-10,-10,
-10),0));for(d=0;d<this.myAtomCount;d++)this.setBBox(this.atomXyzTruncated[d],c?this.atomRadius[d]+0.5:0);Float.isNaN(this.params.scale)||(a=JU.V3.newVsub(this.xyzMax,this.xyzMin),a.scale(0.5),this.xyzMin.add(a),a.scale(this.params.scale),this.xyzMax.add2(this.xyzMin,a),this.xyzMin.sub(a));if(f&&0!=this.myAtomCount){f=new JU.P3;this.bsNearby=new JU.BS;for(d=0;d<this.ac;d++)!e.get(d)&&!this.bsMyIgnored.get(d)&&(a=this.atomData.atomRadius[d],null!=this.params.thePlane&&Math.abs(this.volumeData.distancePointToPlane(this.atomData.xyz[d]))>
2*a||(null!=this.params.theProperty&&(a+=this.maxDistance),f=this.atomData.xyz[d],f.x+a>this.xyzMin.x&&(f.x-a<this.xyzMax.x&&f.y+a>this.xyzMin.y&&f.y-a<this.xyzMax.y&&f.z+a>this.xyzMin.z&&f.z-a<this.xyzMax.z)&&(this.bsNearby.set(d),this.nearbyAtomCount++)));f=this.myAtomCount;if(0!=this.nearbyAtomCount){f+=this.nearbyAtomCount;this.atomRadius=JU.AU.arrayCopyF(this.atomRadius,f);this.atomXyzTruncated=JU.AU.arrayCopyObject(this.atomXyzTruncated,f);null!=this.atomIndex&&(this.atomIndex=JU.AU.arrayCopyI(this.atomIndex,
f));null!=A&&(this.atomProp=JU.AU.arrayCopyF(this.atomProp,f));for(d=this.bsNearby.nextSetBit(0);0<=d;d=this.bsNearby.nextSetBit(d+1))null!=A&&this.addAtomProp(this.myAtomCount,A[d]),this.myIndex[d]=this.myAtomCount,this.atomIndex[this.myAtomCount]=d,this.atomXyzTruncated[this.myAtomCount]=this.atomData.xyz[d],this.atomRadius[this.myAtomCount++]=this.atomData.atomRadius[d]}c&&this.setRadii();this.haveOneProperty=!Float.isNaN(this.theProperty)}},"JU.BS,~B,~B,~B,~B,~B,~B,~N,JU.M4");e(c$,"setRadii",
function(){if(null==this.rs){this.maxRS=0;this.rs=x(this.myAtomCount,0);this.rs2=x(this.myAtomCount,0);for(var a=0;a<this.myAtomCount;a++){var b=this.rs[a]=this.atomRadius[a]+this.sr;b>this.maxRS&&(this.maxRS=b);this.rs2[a]=this.rs[a]*this.rs[a]}}});e(c$,"addAtomProp",function(a,b){this.atomProp[a]=b;!Float.isNaN(this.theProperty)&&b!=this.theProperty&&(this.theProperty=3.4028235E38==this.theProperty?b:NaN)},"~N,~N");e(c$,"getWorkingRadius",function(a,b){var c=0>a?this.atomData.hAtomRadius:this.atomData.atomRadius[a];
return Float.isNaN(b)?Math.max(c,0.1):c+b},"~N,~N");e(c$,"setHeader",function(a,b){this.jvxlFileHeaderBuffer=new JU.SB;null!=this.atomData.programInfo&&this.jvxlFileHeaderBuffer.append("#created by ").append(this.atomData.programInfo).append(" on ").append(""+new java.util.Date).append("\n");this.jvxlFileHeaderBuffer.append(a).append("\n").append(b).append("\n")},"~S,~S");e(c$,"setRanges",function(a,b,c){null!=this.xyzMin&&(this.ptsPerAngstrom=a,this.maxGrid=b,this.minPtsPerAng=c,this.setVolumeData(),
J.jvxl.data.JvxlCoder.jvxlCreateHeader(this.volumeData,this.jvxlFileHeaderBuffer))},"~N,~N,~N");n(c$,"setVolumeData",function(){this.setVolumeDataADR()});e(c$,"setVolumeDataADR",function(){this.setVolumeDataParams()||(this.setVoxelRange(0,this.xyzMin.x,this.xyzMax.x,this.ptsPerAngstrom,this.maxGrid,this.minPtsPerAng),this.setVoxelRange(1,this.xyzMin.y,this.xyzMax.y,this.ptsPerAngstrom,this.maxGrid,this.minPtsPerAng),this.setVoxelRange(2,this.xyzMin.z,this.xyzMax.z,this.ptsPerAngstrom,this.maxGrid,
this.minPtsPerAng))});e(c$,"setVertexSource",function(){null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,1,null);if(null!=this.params.vertexSource){this.params.vertexSource=JU.AU.arrayCopyI(this.params.vertexSource,this.meshData.vc);for(var a=0;a<this.meshData.vc;a++)this.params.vertexSource[a]=Math.abs(this.params.vertexSource[a])-1}});e(c$,"resetPlane",function(a){for(var b=0;b<this.yzCount;b++)this.thisPlane[b]=a},"~N");e(c$,"resetVoxelData",function(a){for(var b=0;b<this.nPointsX;++b)for(var c=
0;c<this.nPointsY;++c)for(var d=0;d<this.nPointsZ;++d)this.voxelData[b][c][d]=a},"~N");e(c$,"getVoxel",function(a,b,c,d){return this.isProgressive?this.thisPlane[d%this.yzCount]:this.voxelData[a][b][c]},"~N,~N,~N,~N");e(c$,"unsetVoxelData",function(){this.unsetVoxelData2()});e(c$,"unsetVoxelData2",function(){if(this.isProgressive)for(var a=0;a<this.yzCount;a++)3.4028235E38==this.thisPlane[a]&&(this.thisPlane[a]=NaN);else for(a=0;a<this.nPointsX;++a)for(var b=0;b<this.nPointsY;++b)for(var c=0;c<this.nPointsZ;++c)3.4028235E38==
this.voxelData[a][b][c]&&(this.voxelData[a][b][c]=NaN)});e(c$,"setGridLimitsForAtom",function(a,b,c,d){b+=this.margin;this.volumeData.xyzToVoxelPt(a.x,a.y,a.z,c);a=G(Math.floor(b/this.volumeData.volumetricVectorLengths[0]));var e=G(Math.floor(b/this.volumeData.volumetricVectorLengths[1]));b=G(Math.floor(b/this.volumeData.volumetricVectorLengths[2]));d.set(c.x+a,c.y+e,c.z+b);c.set(c.x-a,c.y-e,c.z-b);c.x=Math.max(c.x-1,0);c.y=Math.max(c.y-1,0);c.z=Math.max(c.z-1,0);d.x=Math.min(d.x+1,this.nPointsX);
d.y=Math.min(d.y+1,this.nPointsY);d.z=Math.min(d.z+1,this.nPointsZ)},"JU.P3,~N,JU.P3i,JU.P3i");e(c$,"getAtomMinMax",function(a,b){for(var c=0;c<this.nPointsX;c++)b[c]=new JU.BS;for(var d=this.myAtomCount;0<=--d;)if(null==a||a.get(d)){this.setGridLimitsForAtom(this.atomXyzTruncated[d],this.atomRadius[d],this.pt0,this.pt1);for(c=this.pt0.x;c<this.pt1.x;c++)b[c].set(d)}},"JU.BS,~A");e(c$,"markSphereVoxels",function(a,b){for(var c=3.4028235E38!=b&&null!=this.point,d=this.volumetricVectors[0],e=this.volumetricVectors[1],
f=this.volumetricVectors[2],g=this.thisAtomSet.nextSetBit(0);0<=g;g=this.thisAtomSet.nextSetBit(g+1))if(this.havePlane||null==this.validSpheres||this.validSpheres.get(g)){var A=null!=this.noFaceSpheres&&this.noFaceSpheres.get(g),k=g>=this.firstNearbyAtom,p=this.atomXyzTruncated[g],l=this.atomRadius[g];if(!(c&&p.distance(this.point)>b+l+0.5)){var q=l+a;this.setGridLimitsForAtom(p,q,this.pt0,this.pt1);this.isProgressive&&(this.pt0.x=this.thisX,this.pt1.x=this.thisX+1);this.volumeData.voxelPtToXYZ(this.pt0.x,
this.pt0.y,this.pt0.z,this.ptV);for(var n=this.pt0.x;n<this.pt1.x;n++,this.ptV.add2(d,this.ptY0)){this.ptY0.setT(this.ptV);for(var s=this.pt0.y;s<this.pt1.y;s++,this.ptV.add2(e,this.ptZ0)){this.ptZ0.setT(this.ptV);for(var C=this.pt0.z;C<this.pt1.z;C++,this.ptV.add(f)){var u=this.ptV.distance(p)-l,x=this.volumeData.getPointIndex(n,s,C);if((0==a||u<=q)&&u<this.getVoxel(n,s,C,x)){if(k||c&&this.ptV.distance(this.point)>b)u=NaN;this.setVoxel(n,s,C,x,u);Float.isNaN(u)||(null!=this.voxelSource&&(this.voxelSource[x]=
g+1),0>u&&A&&this.bsSurfaceVoxels.set(x))}}}}}}},"~N,~N");e(c$,"setVoxel",function(a,b,c,d,e){this.isProgressive?this.thisPlane[d%this.yzCount]=e:this.voxelData[a][b][c]=e},"~N,~N,~N,~N,~N")});F("J.jvxl.readers");L(["JU.P3","J.jvxl.readers.AtomDataReader","JU.P4","$.V3"],"J.jvxl.readers.IsoSolventReader","java.lang.Float java.util.Hashtable JU.BS $.Lst $.Measure J.jvxl.data.MeshData JU.BSUtil $.Logger $.MeshSurface $.TempArray".split(" "),function(){c$=M(function(){this.envelopeRadius=this.cavityRadius=
0;this.dots=null;this.isPocket=this.isCavity=this.doCalculateTroughs=!1;this.bsAtomMinMax=this.p=this.vTemp2=this.ptTemp2=this.plane=this.vTemp=this.ptS2=this.ptS1=this.vFaces=this.vEdges=this.htEdges=this.bsLocale=this.bsSurfaceDone=this.bsSurfacePoints=this.iter=null;this.isSurfacePoint=!1;this.nTest=this.iAtomSurface=0;pa("J.jvxl.readers.IsoSolventReader.Edge")||J.jvxl.readers.IsoSolventReader.$IsoSolventReader$Edge$();pa("J.jvxl.readers.IsoSolventReader.Face")||J.jvxl.readers.IsoSolventReader.$IsoSolventReader$Face$();
this.ecosASB2=this.dAB2=this.dAB=this.rBS2=this.rAS2=this.rBS=this.rAS=0;N(this,arguments)},J.jvxl.readers,"IsoSolventReader",J.jvxl.readers.AtomDataReader);Z(c$,function(){this.ptS1=new JU.P3;this.ptS2=new JU.P3;this.vTemp=new JU.V3;this.plane=new JU.P4;this.ptTemp2=new JU.P3;this.vTemp2=new JU.V3;this.p=new JU.P3});R(c$,function(){aa(this,J.jvxl.readers.IsoSolventReader,[])});n(c$,"init",function(a){this.initADR(a)},"J.jvxl.readers.SurfaceGenerator");n(c$,"readVolumeParameters",function(a){this.setup(a);
this.initializeVolumetricData();this.volumeData.setUnitVectors();this.vl0=this.volumeData.volumetricVectorLengths[0];this.vl1=this.volumeData.volumetricVectorLengths[1];this.vl2=this.volumeData.volumetricVectorLengths[2];this.isProgressive&&(this.volumeData.getYzCount(),this.bsAtomMinMax=Array(this.nPointsX),this.getAtomMinMax(null,this.bsAtomMinMax),this.voxelSource=u(this.volumeData.nPoints,0));return!0},"~B");n(c$,"setup",function(a){this.setup2();if(null==this.contactPair){this.cavityRadius=this.params.cavityRadius;
this.envelopeRadius=this.params.envelopeRadius;this.sr=this.params.solventRadius;this.point=this.params.point;this.isCavity=this.params.isCavity&&null!=this.meshDataServer;this.isPocket=null!=this.params.pocket&&null!=this.meshDataServer;this.doUseIterator=this.doCalculateTroughs=!a&&null!=this.sg.atomDataServer&&!this.isCavity&&0<this.sr&&(1195==this.dataType||1203==this.dataType);this.getAtoms(this.params.bsSelected,this.doAddHydrogens,!0,!1,!1,!0,!1,NaN,null);if(this.isCavity||this.isPocket)this.dots=
this.meshDataServer.calculateGeodesicSurface(this.bsMySelected,this.envelopeRadius);this.setHeader("solvent/molecular surface",this.params.calculationType);if(this.havePlane||!a)this.setRanges(this.params.solvent_ptsPerAngstrom,this.params.solvent_gridMax,0),this.volumeData.getYzCount(),this.margin=2*this.volumeData.maxGrid;null!=this.bsNearby&&this.bsMySelected.or(this.bsNearby)}else a||this.setVolumeData();this.doCalculateTroughs||(a?(this.precalculateVoxelData=!1,this.volumeData.sr=this):this.isCavity||
(this.isProgressive=this.isXLowToHigh=!0));null==this.thisAtomSet&&(this.thisAtomSet=JU.BSUtil.setAll(this.myAtomCount))},"~B");n(c$,"generateCube",function(){if(!(this.isCavity&&null!=this.params.theProperty)){this.isCavity&&1205!=this.dataType&&1206!=this.dataType?(this.params.vertexSource=null,this.newVoxelDataCube(),this.resetVoxelData(3.4028235E38),this.markSphereVoxels(this.cavityRadius,this.params.distance),this.generateSolventCavity(),this.resetVoxelData(3.4028235E38),this.markSphereVoxels(0,
NaN)):(this.voxelSource=u(this.volumeData.nPoints,0),this.generateSolventCube());this.unsetVoxelData();var a=this.params.slabInfo;if(null!=a)for(var b=0;b<a.size();b++)a.get(b)[2].booleanValue()&&U(a.get(b)[0],JU.P4)&&(this.volumeData.capData(a.get(b)[0],this.params.cutoff),a.removeItemAt(b--))}});n(c$,"getSurfacePointAndFraction",function(a,b,c,d,e,f,g,A,k,p,l,q,n){p=this.marchingCubes.getLinearOffset(g,A,k,p);l=this.marchingCubes.getLinearOffset(g,A,k,l);this.isSurfacePoint=null!=this.bsSurfaceVoxels&&
(this.bsSurfaceVoxels.get(p)||this.bsSurfaceVoxels.get(l));if(null!=this.voxelSource){var s=Math.abs(Float.isNaN(d)||c<d?this.voxelSource[p]:this.voxelSource[l]);0<s&&(this.iAtomSurface=this.atomIndex[s-1])}if(J.jvxl.readers.IsoSolventReader.testLinear||null==this.voxelSource||0==this.voxelSource[p]||this.voxelSource[p]!=this.voxelSource[l])return this.getSPF(a,b,c,d,e,f,g,A,k,p,l,q,n);a=q[0]=JU.MeshSurface.getSphericalInterpolationFraction(0>this.voxelSource[p]?this.sr:this.atomRadius[this.voxelSource[p]-
1],c,d,f.length());n.scaleAdd2(a,f,e);return c+a*(d-c)},"~N,~B,~N,~N,JU.T3,JU.V3,~N,~N,~N,~N,~N,~A,JU.T3");n(c$,"addVertexCopy",function(a,b,c,d){a=this.addVC(a,b,c,d);if(0>a)return a;this.isSurfacePoint&&this.bsSurfacePoints.set(a);null!=this.params.vertexSource&&(this.params.vertexSource[a]=this.iAtomSurface);return a},"JU.T3,~N,~N,~B");n(c$,"selectPocket",function(a){null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,1,null);for(var b=this.meshData.vs,c=this.meshData.vc,
d=this.meshData.vvs,e=this.dots.length,f=0;f<c;f++)for(var g=0;g<e;g++)this.dots[g].distance(b[f])<this.envelopeRadius&&(d[f]=NaN);this.meshData.getSurfaceSet();b=this.meshData.nSets;c=JU.BS.newN(b);for(f=0;f<b;f++)if(null!=(d=this.meshData.surfaceSet[f]))for(g=d.nextSetBit(0);0<=g;g=d.nextSetBit(g+1))if(Float.isNaN(this.meshData.vvs[g])){c.set(f);break}for(f=0;f<b;f++)null!=this.meshData.surfaceSet[f]&&c.get(f)==a&&this.meshData.invalidateSurfaceSet(f);this.updateSurfaceData();a||(this.meshData.surfaceSet=
null);null!=this.meshDataServer&&(this.meshDataServer.fillMeshData(this.meshData,3,null),this.meshData=new J.jvxl.data.MeshData)},"~B");n(c$,"postProcessVertices",function(){this.setVertexSource();if(this.doCalculateTroughs&&null!=this.bsSurfacePoints){var a=new JU.BS,b=this.meshData.getSurfaceSet(),c=null,d=this.isPocket?null:J.jvxl.data.MeshData.calculateVolumeOrArea(this.meshData,-2147483648,!1,!1),e=this.isCavity?4.71238898038469*Math.pow(this.sr,3):0,f=0,g=!1;if(null!=d&&!this.isCavity)for(var A=
0;A<this.meshData.nSets;A++){var k=d[A];Math.abs(k)>f&&(f=Math.abs(k),g=0>k)}f=g?-1:1;for(A=0;A<this.meshData.nSets;A++)if(g=b[A],g.intersects(this.bsSurfacePoints)&&(null==d||d[A]*f>e)&&null!=this.params.vertexSource){k=new JU.BS;null==c&&(c=Array(b.length));for(var p=g.nextSetBit(0);0<=p;p=g.nextSetBit(p+1)){var l=this.params.vertexSource[p];if(!(0>l)){if(a.get(l)){this.meshData.invalidateSurfaceSet(A);break}k.set(l)}}a.or(k)}else this.meshData.invalidateSurfaceSet(A);this.updateSurfaceData();null!=
this.meshDataServer&&(this.meshDataServer.fillMeshData(this.meshData,3,null),this.meshData=new J.jvxl.data.MeshData)}null!=this.params.thePlane&&null==this.params.slabInfo&&this.params.addSlabInfo(JU.TempArray.getSlabWithinRange(-100,0))});e(c$,"generateSolventCavity",function(){for(var a=JU.BS.newN(this.nPointsX*this.nPointsY*this.nPointsZ),b=0,c=this.dots.length,d=0,e,f=this.envelopeRadius,g=0;g<this.nPointsX;++g)for(var A=0;A<this.nPointsY;++A){var k=0;a:for(;k<this.nPointsZ;++k,++b)if(3.4028235E38>
(e=this.voxelData[g][A][k])&&e>=this.cavityRadius){this.volumeData.voxelPtToXYZ(g,A,k,this.ptV);for(var p=0;p<c;p++)if(this.dots[p].distance(this.ptV)<f)continue a;a.set(b);d++}}JU.Logger.info("cavities include "+d+" voxel points");this.atomRadius=x(d,0);this.atomXyzTruncated=Array(d);for(c=b=g=0;g<this.nPointsX;++g)for(A=0;A<this.nPointsY;++A)for(k=0;k<this.nPointsZ;++k)a.get(b++)&&(this.volumeData.voxelPtToXYZ(g,A,k,this.atomXyzTruncated[c]=new JU.P3),this.atomRadius[c++]=this.voxelData[g][A][k]);
this.myAtomCount=this.firstNearbyAtom=d;this.thisAtomSet=JU.BSUtil.setAll(this.myAtomCount);this.rs=null;this.setRadii()});e(c$,"generateSolventCube",function(){1205!=this.dataType&&(this.params.vertexSource=u(this.volumeData.nPoints,0),this.bsSurfaceDone=new JU.BS,this.bsSurfaceVoxels=new JU.BS,this.bsSurfacePoints=new JU.BS,this.doCalculateTroughs?(this.iter=this.sg.atomDataServer.getSelectedAtomIterator(this.bsMySelected,!0,!1,!1),this.vEdges=new JU.Lst,this.bsLocale=Array(this.myAtomCount),this.htEdges=
new java.util.Hashtable,this.getEdges(),JU.Logger.info(this.vEdges.size()+" edges"),this.vFaces=new JU.Lst,this.getFaces(),JU.Logger.info(this.vFaces.size()+" faces"),this.htEdges=this.bsLocale=null,this.iter.release(),this.iter=null,this.newVoxelDataCube(),this.resetVoxelData(3.4028235E38),this.markFaceVoxels(!0),this.markToroidVoxels(),this.validSpheres.or(this.noFaceSpheres),this.vEdges=null,this.markFaceVoxels(!1),this.vFaces=null):(this.newVoxelDataCube(),this.resetVoxelData(3.4028235E38)),this.markSphereVoxels(0,
this.doCalculateTroughs?3.4028235E38:this.params.distance),this.validSpheres=this.noFaceSpheres=null)});e(c$,"getEdges",function(){for(var a=0;a<this.myAtomCount;a++)this.bsLocale[a]=new JU.BS;for(a=0;a<this.myAtomCount;a++){var b=this.atomXyzTruncated[a],c=this.rs[a];for(this.sg.atomDataServer.setIteratorForAtom(this.iter,this.atomIndex[a],c+this.maxRS);this.iter.hasNext();){var d=this.iter.next(),d=this.myIndex[d];if(!(a>=this.firstNearbyAtom&&d>=this.firstNearbyAtom)){var e=this.rs[d],f=b.distance(this.atomXyzTruncated[d]);
f>=c+e||(e=ja(J.jvxl.readers.IsoSolventReader.Edge,this,null,this,a,d,f),this.vEdges.addLast(e),this.bsLocale[a].set(d),this.bsLocale[d].set(a),this.htEdges.put(e.toString(),e))}}}});e(c$,"findEdge",function(a,b){return this.htEdges.get(a<b?a+"_"+b:b+"_"+a)},"~N,~N");e(c$,"getFaces",function(){var a=new JU.BS;this.params.surfaceAtoms=this.validSpheres=new JU.BS;this.noFaceSpheres=JU.BSUtil.setAll(this.myAtomCount);for(var b=this.vEdges.size();0<=--b;){var c=this.vEdges.get(b),d=c.ia,e=c.ib;a.clearAll();
a.or(this.bsLocale[d]);a.and(this.bsLocale[e]);for(var f=a.nextSetBit(e+1);0<=f;f=a.nextSetBit(f+1))if(this.getSolventPoints(c,d,e,f)){var g,A=!1;if(null!=(g=this.validateFace(d,e,f,c,this.ptS1)))this.vFaces.addLast(g),A=!0;if(null!=(g=this.validateFace(d,e,f,c,this.ptS2)))this.vFaces.addLast(g),A=!0;A&&(this.noFaceSpheres.clear(d),this.noFaceSpheres.clear(e),this.noFaceSpheres.clear(f))}}});e(c$,"validateFace",function(a,b,c,d,e){this.sg.atomDataServer.setIteratorForPoint(this.iter,this.modelIndex,
e,this.maxRS);for(var f=!0;this.iter.hasNext();){var g=this.iter.next(),A=this.myIndex[g];if(!(A==a||A==b||A==c)&&this.atomData.atoms[g].distance(e)<this.atomData.atomRadius[g]+this.sr){f=!1;break}}g=this.findEdge(b,c);A=this.findEdge(a,c);e=f?ja(J.jvxl.readers.IsoSolventReader.Face,this,null,a,b,c,e):null;d.addFace(e);g.addFace(e);A.addFace(e);if(!f)return null;this.validSpheres.set(a);this.validSpheres.set(b);this.validSpheres.set(c);return e},"~N,~N,~N,J.jvxl.readers.IsoSolventReader.Edge,JU.P3");
e(c$,"markFaceVoxels",function(a){for(var b=new JU.BS,c=this.volumetricVectors[0],d=this.volumetricVectors[1],e=this.volumetricVectors[2],f=this.vFaces.size();0<=--f;){var g=this.vFaces.get(f),A=this.atomXyzTruncated[g.ia],k=this.atomXyzTruncated[g.ib],p=this.atomXyzTruncated[g.ic],l=g.pS;this.setGridLimitsForAtom(l,this.sr,this.pt0,this.pt1);this.volumeData.voxelPtToXYZ(this.pt0.x,this.pt0.y,this.pt0.z,this.ptV);for(var q=this.pt0.x;q<this.pt1.x;q++,this.ptV.add2(c,this.ptY0)){this.ptY0.setT(this.ptV);
for(var n=this.pt0.y;n<this.pt1.y;n++,this.ptV.add2(d,this.ptZ0)){this.ptZ0.setT(this.ptV);for(var s=this.pt0.z;s<this.pt1.z;s++,this.ptV.add(e)){var u=this.sr-this.ptV.distance(l),x=this.voxelData[q][n][s],z=this.volumeData.getPointIndex(q,n,s);a&&0<u&&this.bsSurfaceDone.set(z);if(JU.Measure.isInTetrahedron(this.ptV,A,k,p,l,this.plane,this.vTemp,this.vTemp2,!1)&&(!a?!this.bsSurfaceDone.get(z)&&0>u&&u>1.8*-this.volumeData.maxGrid&&u>x==b.get(z):0<u&&(0>x||3.4028235E38==x||u>x==b.get(z))))b.set(z),
this.setVoxel(q,n,s,z,u),null!=this.voxelSource&&(this.voxelSource[z]=-1-g.ia),0<u&&this.bsSurfaceVoxels.set(z)}}}}},"~B");e(c$,"markToroidVoxels",function(){for(var a=this.volumetricVectors[0],b=this.volumetricVectors[1],c=this.volumetricVectors[2],d=this.vEdges.size();0<=--d;){var e=this.vEdges.get(d);if(e.isValid()){var f=e.ia,g=e.ib,n=this.atomXyzTruncated[f],k=this.atomXyzTruncated[g];this.rAS=this.rs[f];this.rBS=this.rs[g];this.rAS2=this.rs2[f];this.rBS2=this.rs2[g];this.dAB=e.d;this.dAB2=e.d2;
this.ecosASB2=e.cosASB2;this.setGridLimitsForAtom(e,e.maxr,this.pt0,this.pt1);this.volumeData.voxelPtToXYZ(this.pt0.x,this.pt0.y,this.pt0.z,this.ptV);for(e=this.pt0.x;e<this.pt1.x;e++,this.ptV.add2(a,this.ptY0)){this.ptY0.setT(this.ptV);for(g=this.pt0.y;g<this.pt1.y;g++,this.ptV.add2(b,this.ptZ0)){this.ptZ0.setT(this.ptV);for(var p=this.pt0.z;p<this.pt1.z;p++,this.ptV.add(c)){var l=this.checkSpecialVoxel(n,k,this.ptV);if(!Float.isNaN(l)&&(l=this.sr-l,l<this.voxelData[e][g][p])){var q=this.volumeData.getPointIndex(e,
g,p);this.setVoxel(e,g,p,q,l);null!=this.voxelSource&&(this.voxelSource[q]=-1-f)}}}}}}});n(c$,"unsetVoxelData",function(){if(this.havePlane)if(this.isProgressive)for(var a=0;a<this.yzCount;a++)0.001>this.thisPlane[a]||(this.thisPlane[a]=0.001);else for(a=0;a<this.nPointsX;++a)for(var b=0;b<this.nPointsY;++b)for(var c=0;c<this.nPointsZ;++c)0.001>this.voxelData[a][b][c]||(this.voxelData[a][b][c]=0.001);else this.unsetVoxelData2()});e(c$,"getSolventPoints",function(a,b,c,d){var e=this.rs[b],f=a.v;a=
(a.d2+this.rs2[b]-this.rs2[c])/(2*a.d*e);c=Math.acos(a);this.p.scaleAdd2(a*e,f,this.atomXyzTruncated[b]);JU.Measure.getPlaneThroughPoint(this.p,f,this.plane);b=Math.sin(c)*e;a=this.atomXyzTruncated[d];c=this.rs[d];e=JU.Measure.distanceToPlane(this.plane,a);if(Math.abs(e)>=0.9*c)return!1;this.ptTemp.scaleAdd2(-e,f,a);a=this.p.distance(this.ptTemp);d=(b*b+a*a-(this.rs2[d]-e*e))/(2*b*a);if(0.99<=Math.abs(d))return!1;e=this.vTemp2;e.sub2(this.ptTemp,this.p);e.normalize();this.ptTemp.scaleAdd2(b*d,e,this.p);
e.cross(f,e);e.normalize();e.scale(Math.sqrt(1-d*d)*b);this.ptS1.add2(this.ptTemp,e);this.ptS2.sub2(this.ptTemp,e);return!0},"J.jvxl.readers.IsoSolventReader.Edge,~N,~N,~N");e(c$,"checkSpecialVoxel",function(a,b,c){var d=a.distance(c),e=a.distanceSquared(c),f=this.rAS/d;if(1<f)return this.p.set(a.x+(c.x-a.x)*f,a.y+(c.y-a.y)*f,a.z+(c.z-a.z)*f),b.distanceSquared(this.p)>=this.rBS2?NaN:this.solventDistance(this.rAS,this.rAS2,this.rBS2,d,e,b.distanceSquared(c));d=b.distance(c);return 1<(f=this.rBS/d)?
(this.p.set(b.x+(c.x-b.x)*f,b.y+(c.y-b.y)*f,b.z+(c.z-b.z)*f),a.distanceSquared(this.p)>=this.rAS2?NaN:this.solventDistance(this.rBS,this.rBS2,this.rAS2,d,d*d,e)):NaN},"JU.P3,JU.P3,JU.P3");e(c$,"solventDistance",function(a,b,c,d,e,f){f=Math.acos((e+this.dAB2-f)/(2*d*this.dAB));c=Math.acos((b+this.dAB2-c)/(2*a*this.dAB));e=b+e-2*a*d*Math.cos(c-f);c=Math.sqrt(e);return this.ecosASB2<(b+e-d*d)/(c*a)?c:NaN},"~N,~N,~N,~N,~N,~N");e(c$,"dumpLine",function(a,b,c,d){this.sg.log('draw ID "x'+c+this.nTest++ +
'" '+JU.P3.newP(a)+" "+JU.P3.newP(b)+" color "+d)},"JU.P3,JU.T3,~S,~S");e(c$,"dumpLine2",function(a,b,c,d,e,f){var g=new JU.V3;g.setT(b);g.sub(a);g.normalize();g.scale(d);g.add(a);this.sg.log('draw ID "'+c+this.nTest++ +'" '+JU.P3.newP(a)+" "+JU.P3.newP(g)+" color "+e);this.sg.log('draw ID "'+c+this.nTest++ +'"'+JU.P3.newP(g)+" "+JU.P3.newP(b)+" color "+f+'"'+c+'"')},"JU.P3,JU.P3,~S,~N,~S,~S");e(c$,"dumpPoint",function(a,b,c){this.sg.log('draw ID "'+b+this.nTest++ +'"'+JU.P3.newP(a)+" color "+c)},
"JU.P3,~S,~S");n(c$,"getValueAtPoint",function(a){if(null!=this.contactPair)return a.distance(this.contactPair.myAtoms[1])-this.contactPair.radii[1];for(var b=3.4028235E38,c=0;c<this.firstNearbyAtom;c++){var d=a.distance(this.atomXyzTruncated[c])-this.rs[c];d<b&&(b=d)}return 3.4028235E38==b?NaN:b},"JU.T3,~B");n(c$,"discardTempData",function(a){this.rs2=this.rs=null;this.discardTempDataSR(a)},"~B");n(c$,"getPlane",function(a){0==this.yzCount&&this.initPlanes();this.thisX=a;this.thisPlane=this.yzPlanes[a%
2];null==this.contactPair?(this.resetPlane(3.4028235E38),this.thisAtomSet=this.bsAtomMinMax[a],this.markSphereVoxels(0,this.params.distance),this.unsetVoxelData()):this.markPlaneVoxels(this.contactPair.myAtoms[0],this.contactPair.radii[0]);return this.thisPlane},"~N");c$.$IsoSolventReader$Edge$=function(){ia(self.c$);c$=M(function(){ra(this,arguments);this.cosASB2=this.maxr=this.d2=this.d=this.nInvalid=this.nFaces=this.ib=this.ia=0;this.v=null;N(this,arguments)},J.jvxl.readers.IsoSolventReader,"Edge",
JU.P3);eb(c$,function(a,b,c,d){this.ia=Math.min(b,c);this.ib=Math.max(b,c);this.d=d;this.d2=d*d;this.maxr=Math.sqrt(this.d2/4+Math.max(a.rs2[b],a.rs2[c]));this.ave(a.atomXyzTruncated[b],a.atomXyzTruncated[c]);this.cosASB2=(a.rs2[b]+a.rs2[c]-this.d2)/(a.rs[c]*a.rs[b]);this.v=JU.V3.newVsub(a.atomXyzTruncated[c],a.atomXyzTruncated[b]);this.v.normalize()},"J.jvxl.readers.IsoSolventReader,~N,~N,~N");e(c$,"addFace",function(a){this.nFaces++;null==a&&this.nInvalid++},"J.jvxl.readers.IsoSolventReader.Face");
e(c$,"isValid",function(){return 0==this.nFaces||this.nInvalid!=this.nFaces});n(c$,"toString",function(){return this.ia+"_"+this.ib});c$=qa()};c$.$IsoSolventReader$Face$=function(){ia(self.c$);c$=M(function(){ra(this,arguments);this.ic=this.ib=this.ia=0;this.pS=null;N(this,arguments)},J.jvxl.readers.IsoSolventReader,"Face");R(c$,function(a,b,c,d){this.ia=a;this.ib=b;this.ic=c;this.pS=JU.P3.newP(d)},"~N,~N,~N,JU.P3");n(c$,"toString",function(){return this.ia+"_"+this.ib+"_"+this.ic+"_"+this.pS});c$=
qa()};$(c$,"testLinear",!1)});F("J.jvxl.readers");L(["J.jvxl.readers.SurfaceReader"],"J.jvxl.readers.SurfaceFileReader",["JU.PT","J.api.Interface"],function(){c$=M(function(){this.next=this.line=this.out=this.binarydoc=this.br=null;N(this,arguments)},J.jvxl.readers,"SurfaceFileReader",J.jvxl.readers.SurfaceReader);Z(c$,function(){this.next=u(1,0)});R(c$,function(){aa(this,J.jvxl.readers.SurfaceFileReader,[])});e(c$,"setStream",function(a,b){this.binarydoc.setStream(null==a?null:this.sg.atomDataServer.getBufferedInputStream(a),
b)},"~S,~B");n(c$,"init",function(a){this.initSR(a)},"J.jvxl.readers.SurfaceGenerator");e(c$,"init2",function(a,b){this.init2SFR(a,b)},"J.jvxl.readers.SurfaceGenerator,java.io.BufferedReader");e(c$,"init2SFR",function(a,b){this.init(a);this.br=b},"J.jvxl.readers.SurfaceGenerator,java.io.BufferedReader");e(c$,"newBinaryDocument",function(){return J.api.Interface.getInterface("JU.BinaryDocument",this.sg.atomDataServer,"file")});n(c$,"setOutputChannel",function(a){null==this.binarydoc?this.out=a:this.sg.setOutputChannel(this.binarydoc,
a)},"JU.OC");n(c$,"closeReader",function(){this.closeReaderSFR()});e(c$,"closeReaderSFR",function(){if(null!=this.br)try{this.br.close()}catch(a){if(!S(a,java.io.IOException))throw a;}null!=this.out&&this.out.closeChannel();null!=this.binarydoc&&this.binarydoc.close()});n(c$,"discardTempData",function(a){this.closeReader();this.discardTempDataSR(a)},"~B");e(c$,"getTokens",function(){return JU.PT.getTokensAt(this.line,0)});e(c$,"parseFloat",function(){return JU.PT.parseFloatNext(this.line,this.next)});
e(c$,"parseFloatStr",function(a){this.next[0]=0;return JU.PT.parseFloatNext(a,this.next)},"~S");e(c$,"parseFloatRange",function(a,b,c){this.next[0]=b;return JU.PT.parseFloatRange(a,c,this.next)},"~S,~N,~N");e(c$,"parseInt",function(){return JU.PT.parseIntNext(this.line,this.next)});e(c$,"parseIntStr",function(a){this.next[0]=0;return JU.PT.parseIntNext(a,this.next)},"~S");e(c$,"parseIntNext",function(a){return JU.PT.parseIntNext(a,this.next)},"~S");e(c$,"parseFloatArrayStr",function(a){this.next[0]=
0;return JU.PT.parseFloatArrayNext(a,this.next,null,null,null)},"~S");e(c$,"parseFloatArray",function(a,b,c){return JU.PT.parseFloatArrayNext(this.line,this.next,a,b,c)},"~A,~S,~S");e(c$,"getQuotedStringNext",function(){return JU.PT.getQuotedStringNext(this.line,this.next)});e(c$,"skipTo",function(a,b){if(null!=a)for(;0>this.rd().indexOf(a););null!=b&&(this.next[0]=this.line.indexOf(b)+b.length+2)},"~S,~S");e(c$,"rd",function(){this.line=this.br.readLine();if(null!=this.line&&(this.nBytes+=this.line.length,
null!=this.out)){var a=this.line.getBytes();this.out.write(a,0,a.length);this.out.writeByteAsInt(10)}return this.line})});F("J.jvxl.readers");L(["J.jvxl.readers.SurfaceFileReader"],"J.jvxl.readers.VolumeFileReader","java.lang.Float JU.AU $.PT $.SB J.api.Interface J.atomdata.AtomData JU.Logger".split(" "),function(){c$=M(function(){this.negativeAtomCount=this.endOfData=!1;this.nSurfaces=this.ac=0;this.canDownsample=this.isAngstroms=!1;this.downsampleRemainders=null;this.getNCIPlanes=!1;this.nData=
0;this.readerClosed=!1;this.nSkipZ=this.nSkipY=this.nSkipX=this.downsampleFactor=0;this.yzPlanesRaw=null;this.iPlaneNCI=0;this.boundingBox=null;this.isScaledAlready=!1;N(this,arguments)},J.jvxl.readers,"VolumeFileReader",J.jvxl.readers.SurfaceFileReader);R(c$,function(){aa(this,J.jvxl.readers.VolumeFileReader,[])});n(c$,"init2",function(a,b){this.init2VFR(a,b)},"J.jvxl.readers.SurfaceGenerator,java.io.BufferedReader");e(c$,"init2VFR",function(a,b){this.init2SFR(a,b);this.canDownsample=this.isProgressive=
this.isXLowToHigh=!0;this.jvxlData.wasCubic=!0;this.boundingBox=this.params.boundingBox;4==this.params.qmOrbitalType&&(this.hasColorData=null==this.params.parameters||0<=this.params.parameters[1],this.getNCIPlanes=!0,this.params.insideOut=!this.params.insideOut)},"J.jvxl.readers.SurfaceGenerator,java.io.BufferedReader");e(c$,"recordData",function(a){if(Float.isNaN(a))return a;a<this.dataMin&&(this.dataMin=a);a>this.dataMax&&(this.dataMax=a);this.dataMean+=a;this.nData++;return a},"~N");n(c$,"closeReader",
function(){this.readerClosed||(this.readerClosed=!0,this.closeReaderSFR(),0==this.nData||-3.4028235E38==this.dataMax||(this.dataMean/=this.nData,JU.Logger.info("VolumeFileReader closing file: "+this.nData+" points read \ndata min/max/mean = "+this.dataMin+"/"+this.dataMax+"/"+this.dataMean)))});n(c$,"readVolumeParameters",function(){this.endOfData=!1;this.nSurfaces=this.readVolumetricHeader();if(0==this.nSurfaces)return!1;this.nSurfaces<this.params.fileIndex&&(JU.Logger.warn("not enough surfaces in file -- resetting params.fileIndex to "+
this.nSurfaces),this.params.fileIndex=this.nSurfaces);return!0},"~B");n(c$,"readVolumeData",function(a){return this.readVolumeDataVFR(a)},"~B");e(c$,"readVolumeDataVFR",function(a){if(!this.gotoAndReadVoxelData(a))return!1;this.vertexDataOnly||JU.Logger.info("JVXL read: "+this.nPointsX+" x "+this.nPointsY+" x "+this.nPointsZ+" data points");return!0},"~B");e(c$,"readVolumetricHeader",function(){try{this.readParameters();if(-2147483648==this.ac)return 0;this.vertexDataOnly||JU.Logger.info("voxel grid origin:"+
this.volumetricOrigin);var a=this.params.downsampleFactor,b=this.canDownsample&&1<a;1<a&&!this.canDownsample&&(this.jvxlData.msg+="\ncannot downsample this file type");if(b){this.downsampleRemainders=u(3,0);JU.Logger.info("downsample factor = "+a);for(var c=0;3>c;++c){var d=this.voxelCounts[c];this.downsampleRemainders[c]=d%a;this.voxelCounts[c]/=a;this.isPeriodic&&(this.voxelCounts[c]++,this.downsampleRemainders[c]--);this.volumetricVectors[c].scale(a);JU.Logger.info("downsampling axis "+(c+1)+" from "+
d+" to "+this.voxelCounts[c])}}if(!this.vertexDataOnly)for(c=0;3>c;++c)this.isAngstroms||this.volumetricVectors[c].scale(0.5291772),this.line=this.voxelCounts[c]+" "+this.volumetricVectors[c].x+" "+this.volumetricVectors[c].y+" "+this.volumetricVectors[c].z,this.jvxlFileHeaderBuffer.append(this.line).appendC("\n"),JU.Logger.info("voxel grid count/vector:"+this.line);this.scaleIsosurface(this.params.scale);this.volumeData.setVolumetricXml();return this.nSurfaces}catch(e){if(S(e,Exception))return JU.Logger.error(e.toString()),
0;throw e;}});e(c$,"skipComments",function(a){for(var b=new JU.SB;null!=this.rd()&&(a&&0==this.line.length||0==this.line.indexOf("#"));)b.append(this.line).appendC("\n");return b.toString()},"~B");e(c$,"readVoxelVector",function(a){this.rd();var b=this.volumetricVectors[a];if(-2147483648==(this.voxelCounts[a]=this.parseIntStr(this.line)))this.next[0]=this.line.indexOf(" ");b.set(this.parseFloat(),this.parseFloat(),this.parseFloat());this.isAnisotropic&&this.setVectorAnisotropy(b)},"~N");e(c$,"initializeSurfaceData",
function(){this.downsampleFactor=this.params.downsampleFactor;this.nSkipZ=this.nSkipY=this.nSkipX=0;this.canDownsample&&0<this.downsampleFactor&&(this.nSkipX=this.downsampleFactor-1,this.nSkipY=this.downsampleRemainders[2]+(this.downsampleFactor-1)*(this.nSkipZ=(this.nPointsZ-(this.isPeriodic?1:0))*this.downsampleFactor+this.downsampleRemainders[2]),this.nSkipZ=this.downsampleRemainders[1]*this.nSkipZ+(this.downsampleFactor-1)*this.nSkipZ*((this.nPointsY-(this.isPeriodic?1:0))*this.downsampleFactor+
this.downsampleRemainders[1]));null!=this.params.thePlane?this.params.cutoff=0:this.isJvxl&&(this.params.cutoff=this.params.isBicolorMap||this.params.colorBySign?0.01:0.5);this.nDataPoints=0;this.next[0]=0;this.line="";this.jvxlNSurfaceInts=0});n(c$,"readSurfaceData",function(a){this.readSurfaceDataVFR(a)},"~B");e(c$,"readSurfaceDataVFR",function(a){this.initializeSurfaceData();if(this.isProgressive&&!a||this.isJvxl)this.nDataPoints=this.volumeData.setVoxelCounts(this.nPointsX,this.nPointsY,this.nPointsZ),
this.voxelData=null,this.isJvxl&&(this.jvxlVoxelBitSet=this.getVoxelBitSet(this.nDataPoints));else if(a&&this.volumeData.hasPlane()){this.volumeData.setVoxelMap();var b=this.volumeData.getToPlaneParameter();for(a=0;a<this.nPointsX;++a){for(var c=0;c<this.nPointsY;++c){for(var d=0;d<this.nPointsZ;++d){var e=this.recordData(this.getNextVoxelValue());this.volumeData.isNearPlane(a,c,d,b)&&this.volumeData.setVoxelMapValue(a,c,d,e);0!=this.nSkipX&&this.skipVoxels(this.nSkipX)}0!=this.nSkipY&&this.skipVoxels(this.nSkipY)}0!=
this.nSkipZ&&this.skipVoxels(this.nSkipZ)}}else{this.voxelData=JU.AU.newFloat3(this.nPointsX,-1);for(a=0;a<this.nPointsX;++a){b=JU.AU.newFloat2(this.nPointsY);this.voxelData[a]=b;for(c=0;c<this.nPointsY;++c){e=x(this.nPointsZ,0);b[c]=e;for(d=0;d<this.nPointsZ;++d)e[d]=this.recordData(this.getNextVoxelValue()),0!=this.nSkipX&&this.skipVoxels(this.nSkipX);0!=this.nSkipY&&this.skipVoxels(this.nSkipY)}0!=this.nSkipZ&&this.skipVoxels(this.nSkipZ)}}this.volumeData.setVoxelDataAsArray(this.voxelData)},"~B");
n(c$,"getPlane",function(a){0==a&&this.initPlanes();if(this.getNCIPlanes)return this.getPlaneNCI(a);a=this.getPlaneSR(a);null==this.qpc&&this.getPlaneVFR(a,!0);return a},"~N");e(c$,"getPlaneNCI",function(a){var b;if(0==this.iPlaneNCI){this.qpc=J.api.Interface.getOption("quantum.NciCalculation",this.sg.atomDataServer,null);b=new J.atomdata.AtomData;b.modelIndex=-1;b.bsSelected=this.params.bsSelected;this.sg.fillAtomData(b,1);this.qpc.setupCalculation(this.volumeData,this.sg.params.bsSelected,null,
null,b.atoms,-1,!0,null,this.params.parameters,this.params.testFlags);this.iPlaneNCI=1;this.qpc.setPlanes(this.yzPlanesRaw=x(4,this.yzCount,0));if(this.hasColorData){this.getPlaneVFR(this.yzPlanesRaw[0],!1);this.getPlaneVFR(this.yzPlanesRaw[1],!1);b=this.yzPlanes[0];for(a=0;a<this.yzCount;a++)b[a]=NaN;return b}this.iPlaneNCI=-1}var c=this.qpc.getNoValue(),d=this.nPointsX-1;switch(this.iPlaneNCI){case -1:b=this.yzPlanes[a%2];d++;break;case 3:b=this.yzPlanesRaw[0];this.yzPlanesRaw[0]=this.yzPlanesRaw[1];
this.yzPlanesRaw[1]=this.yzPlanesRaw[2];this.yzPlanesRaw[2]=this.yzPlanesRaw[3];this.yzPlanesRaw[3]=b;b=this.yzPlanesRaw[this.iPlaneNCI];break;default:this.iPlaneNCI++,b=this.yzPlanesRaw[this.iPlaneNCI]}if(a<d){this.getPlaneVFR(b,!1);this.qpc.calcPlane(a,b=this.yzPlanes[a%2]);for(a=0;a<this.yzCount;a++)b[a]!=c&&this.recordData(b[a])}else for(a=0;a<this.yzCount;a++)b[a]=NaN;return b},"~N");e(c$,"getPlaneVFR",function(a,b){try{for(var c=0,d=0;c<this.nPointsY;++c){for(var e=0;e<this.nPointsZ;++e){var f=
this.getNextVoxelValue();b&&this.recordData(f);a[d++]=f;0!=this.nSkipX&&this.skipVoxels(this.nSkipX)}0!=this.nSkipY&&this.skipVoxels(this.nSkipY)}0!=this.nSkipZ&&this.skipVoxels(this.nSkipZ)}catch(g){if(!S(g,Exception))throw g;}},"~A,~B");n(c$,"getValue",function(a,b,c,d){return null!=this.boundingBox&&(this.volumeData.voxelPtToXYZ(a,b,c,this.ptTemp),this.ptTemp.x<this.boundingBox[0].x||this.ptTemp.x>this.boundingBox[1].x||this.ptTemp.y<this.boundingBox[0].y||this.ptTemp.y>this.boundingBox[1].y||
this.ptTemp.z<this.boundingBox[0].z||this.ptTemp.z>this.boundingBox[1].z)?NaN:this.getValue2(a,b,c,d)},"~N,~N,~N,~N");e(c$,"skipVoxels",function(a){for(;0<=--a;)this.getNextVoxelValue()},"~N");e(c$,"getVoxelBitSet",function(){return null},"~N");e(c$,"getNextVoxelValue",function(){var a=0;if(1<this.nSurfaces&&!this.params.blockCubeData){for(var b=1;b<this.params.fileIndex;b++)this.nextVoxel();a=this.nextVoxel();for(b=this.params.fileIndex;b<this.nSurfaces;b++)this.nextVoxel()}else a=this.nextVoxel();
return a});e(c$,"nextVoxel",function(){var a=this.parseFloat();if(Float.isNaN(a)){for(;null!=this.rd()&&Float.isNaN(a=this.parseFloatStr(this.line)););null==this.line&&(this.endOfData||JU.Logger.warn("end of file reading cube voxel data? nBytes="+this.nBytes+" nDataPoints="+this.nDataPoints+" (line):"+this.line),this.endOfData=!0,this.line="0 0 0 0 0 0 0 0 0 0")}return a});n(c$,"gotoData",function(a,b){if(this.params.blockCubeData){0<a&&JU.Logger.info("skipping "+a+" data sets, "+b+" points each");
for(var c=0;c<a;c++)this.skipData(b)}},"~N,~N");e(c$,"skipData",function(a){this.skipDataVFR(a)},"~N");e(c$,"skipDataVFR",function(a){for(var b=0;b<a;)b+=this.countData(this.rd())},"~N");e(c$,"countData",function(a){for(var b=0,c=0,d=a.length,e;c<d;){for(;c<d&&(" "==(e=a.charAt(c))||"\t"==e);)++c;for(c<d&&++b;c<d&&" "!=(e=a.charAt(c))&&"\t"!=e;)++c}return b},"~S");c$.checkAtomLine=e(c$,"checkAtomLine",function(a,b,c,d,e){0<=d.indexOf("ANGSTROMS")&&(b=!0);c=null==c?2147483647:JU.PT.parseInt(c);switch(c){case -2147483648:c=
0;d=" "+d.substring(d.indexOf(" ")+1);break;case 2147483647:c=-2147483648;break;default:var f=""+c;d=d.substring(d.indexOf(f)+f.length)}b?0>d.indexOf("ANGSTROM")&&(d+=" ANGSTROMS"):0>d.indexOf("BOHR")&&(d+=" BOHR");d=(-2147483648==c?"":(a?"+":"-")+Math.abs(c))+d+"\n";e.append(d);return b},"~B,~B,~S,~S,JU.SB");n(c$,"getSurfacePointAndFraction",function(a,b,c,d,e,f,g,n,k,p,l,q,v){return this.getSPFv(a,b,c,d,e,f,g,n,k,p,l,q,v)},"~N,~B,~N,~N,JU.T3,JU.V3,~N,~N,~N,~N,~N,~A,JU.T3");e(c$,"getSPFv",function(a,
b,c,d,e,f,g,n,k,p,l,q,v){a=this.getSPF(a,b,c,d,e,f,g,n,k,p,l,q,v);if(null==this.qpc||Float.isNaN(a)||!this.hasColorData)return a;p=this.marchingCubes.getLinearOffset(g,n,k,p);l=this.marchingCubes.getLinearOffset(g,n,k,l);return this.qpc.process(p,l,q[0])},"~N,~B,~N,~N,JU.T3,JU.V3,~N,~N,~N,~N,~N,~A,JU.T3");e(c$,"scaleIsosurface",function(a){this.isScaledAlready||(this.isScaledAlready=!0,this.isAnisotropic&&this.setVolumetricAnisotropy(),Float.isNaN(a)||(JU.Logger.info("applying scaling factor of "+
a),this.volumetricOrigin.scaleAdd2((1-a)/2,this.volumetricVectors[0],this.volumetricOrigin),this.volumetricOrigin.scaleAdd2((1-a)/2,this.volumetricVectors[1],this.volumetricOrigin),this.volumetricOrigin.scaleAdd2((1-a)/2,this.volumetricVectors[2],this.volumetricOrigin),this.volumetricVectors[0].scale(a),this.volumetricVectors[1].scale(a),this.volumetricVectors[2].scale(a)))},"~N");e(c$,"swapXZ",function(){var a=this.volumetricVectors[0];this.volumetricVectors[0]=this.volumetricVectors[2];this.volumetricVectors[2]=
a;a=this.voxelCounts[0];this.voxelCounts[0]=this.voxelCounts[2];this.voxelCounts[2]=a;this.params.insideOut=!this.params.insideOut})});F("J.jvxl.readers");L(["J.jvxl.readers.VolumeFileReader"],"J.jvxl.readers.JvxlXmlReader","java.lang.Float $.NullPointerException java.util.Hashtable JU.AU $.BS $.CU $.Lst $.P3 $.P4 $.PT $.SB J.jvxl.data.JvxlCoder $.MeshData J.jvxl.readers.XmlReader J.shapesurface.IsosurfaceMesh JU.C $.ColorEncoder $.Escape $.Logger".split(" "),function(){c$=M(function(){this.JVXL_VERSION=
"2.3";this.invalidatedVertexCount=this.excludedVertexCount=this.excludedTriangleCount=this.colorDataCount=this.edgeDataCount=this.surfaceDataCount=0;this.haveContourData=!1;this.xr=null;this.isXmlFile=!0;this.thisInside=!1;this.bsVoxelBitSet=this.tempDataXml=null;this.includeValueNaN=!0;this.valueCount=0;this.valueRange=this.valueMin=NaN;this.colorPtr=this.fractionPtr=0;this.strFractionTemp="";this.haveReadColorData=!1;this.jvxlColorEncodingRead=null;N(this,arguments)},J.jvxl.readers,"JvxlXmlReader",
J.jvxl.readers.VolumeFileReader);R(c$,function(){aa(this,J.jvxl.readers.JvxlXmlReader,[])});n(c$,"init2",function(a,b){this.init2JXR(a,b)},"J.jvxl.readers.SurfaceGenerator,java.io.BufferedReader");e(c$,"init2JXR",function(a,b){this.init2VFR(a,b);this.jvxlData.wasJvxl=this.isJvxl=!0;this.isXLowToHigh=this.canDownsample=!1;this.xr=new J.jvxl.readers.XmlReader(b)},"J.jvxl.readers.SurfaceGenerator,java.io.BufferedReader");n(c$,"readVolumeData",function(a){if(!this.readVolumeDataVFR(a))return!1;this.strFractionTemp=
this.jvxlEdgeDataRead;this.fractionPtr=0;return!0},"~B");n(c$,"gotoAndReadVoxelData",function(a){this.initializeVolumetricData();if(0>this.nPointsX||0>this.nPointsY||0>this.nPointsZ)return!0;try{this.gotoData(this.params.fileIndex-1,this.nPointsX*this.nPointsY*this.nPointsZ);if(this.vertexDataOnly)return!0;this.volumeData.setMappingPlane(this.params.thePlane);this.readSurfaceData(a);this.volumeData.setMappingPlane(null);0<this.edgeDataCount&&(this.jvxlEdgeDataRead=this.jvxlReadFractionData("edge",
this.edgeDataCount));this.params.bsExcluded=this.jvxlData.jvxlExcluded=Array(4);if(this.hasColorData=0<this.colorDataCount)this.jvxlColorDataRead=this.jvxlReadFractionData("color",this.colorDataCount);0<this.excludedVertexCount&&(this.jvxlData.jvxlExcluded[0]=J.jvxl.data.JvxlCoder.jvxlDecodeBitSet(this.xr.getXmlData("jvxlExcludedVertexData",null,!1,!1)),this.xr.isNext("jvxlExcludedPlaneData")&&(this.jvxlData.jvxlExcluded[2]=J.jvxl.data.JvxlCoder.jvxlDecodeBitSet(this.xr.getXmlData("jvxlExcludedPlaneData",
null,!1,!1))));0<this.excludedTriangleCount&&(this.jvxlData.jvxlExcluded[3]=J.jvxl.data.JvxlCoder.jvxlDecodeBitSet(this.xr.getXmlData("jvxlExcludedTriangleData",null,!1,!1)));0<this.invalidatedVertexCount&&(this.jvxlData.jvxlExcluded[1]=J.jvxl.data.JvxlCoder.jvxlDecodeBitSet(this.xr.getXmlData("jvxlInvalidatedVertexData",null,!1,!1)));this.haveContourData&&this.jvxlDecodeContourData(this.jvxlData,this.xr.getXmlData("jvxlContourData",null,!1,!1));if(this.jvxlDataIsColorMapped&&0<this.jvxlData.nVertexColors){this.jvxlData.vertexColorMap=
new java.util.Hashtable;var b=this.xr.getXmlData("jvxlVertexColorData",null,!0,!1),c=J.jvxl.readers.XmlReader.getXmlAttrib(b,"baseColor");this.jvxlData.baseColor=0<c.length?c:null;for(a=0;a<this.jvxlData.nVertexColors;a++){var d=this.xr.getXmlData("jvxlColorMap",b,!0,!1),e=J.jvxl.readers.XmlReader.getXmlAttrib(d,"color"),f=J.jvxl.data.JvxlCoder.jvxlDecodeBitSet(this.xr.getXmlData("jvxlColorMap",d,!1,!1));this.jvxlData.vertexColorMap.put(e,f)}}}catch(g){if(S(g,Exception))return JU.Logger.error(g.toString()),
!1;throw g;}return!0},"~B");n(c$,"readParameters",function(){var a=this.xr.getXmlData("jvxlFileTitle",null,!1,!1);this.jvxlFileHeaderBuffer=JU.SB.newS(a);this.xr.toTag("jvxlVolumeData");a=this.tempDataXml=this.xr.getXmlData("jvxlVolumeData",null,!0,!1);this.volumetricOrigin.setT(this.xr.getXmlPoint(a,"origin"));this.isAngstroms=!0;this.readVector(0);this.readVector(1);this.readVector(2);this.line=this.xr.toTag("jvxlSurfaceSet");this.nSurfaces=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(this.line,
"count"));JU.Logger.info("jvxl file surfaces: "+this.nSurfaces);JU.Logger.info("using default edge fraction base and range");JU.Logger.info("using default color fraction base and range");this.cJvxlEdgeNaN=String.fromCharCode(this.edgeFractionBase+this.edgeFractionRange)});e(c$,"readVector",function(a){var b=this.xr.getXmlData("jvxlVolumeVector",this.tempDataXml,!0,!0);this.tempDataXml=this.tempDataXml.substring(this.tempDataXml.indexOf(b)+b.length);var c=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,
"count"));-2147483648==c&&(this.vertexDataOnly=!0);this.voxelCounts[a]=0>c?0:c;this.volumetricVectors[a].setT(this.xr.getXmlPoint(b,"vector"));this.isAnisotropic&&this.setVectorAnisotropy(this.volumetricVectors[a])},"~N");n(c$,"gotoData",function(a,b){0<a&&JU.Logger.info("skipping "+a+" data sets, "+b+" points each");this.vertexDataOnly=this.jvxlData.vertexDataOnly=0==b;for(var c=0;c<a;c++)this.jvxlSkipData(b,!0);this.xr.toTag("jvxlSurface");this.jvxlReadSurfaceInfo()},"~N,~N");e(c$,"jvxlSkipData",
function(){this.rd();this.xr.skipTag("jvxlSurface")},"~N,~B");e(c$,"jvxlReadSurfaceInfo",function(){var a,b=this.xr.getXmlData("jvxlSurfaceInfo",null,!0,!0);this.isXLowToHigh=J.jvxl.readers.XmlReader.getXmlAttrib(b,"isXLowToHigh").equals("true");this.jvxlCutoff=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"cutoff"));Float.isNaN(this.jvxlCutoff)||JU.Logger.info("JVXL read: cutoff "+this.jvxlCutoff);var c=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"nContourData"));this.haveContourData=
0<c;this.params.isContoured=this.jvxlData.isModelConnected=J.jvxl.readers.XmlReader.getXmlAttrib(b,"contoured").equals("true");this.params.isModelConnected=J.jvxl.readers.XmlReader.getXmlAttrib(b,"isModelConnected").equals("true");if(this.params.isContoured){var d=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"nContours"));0>=d?d=0:(0>this.params.thisContour&&(this.params.thisContour=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"thisContour"))),a=J.jvxl.readers.XmlReader.getXmlAttrib(b,
"contourValues"),0<a.length&&(a=a.$replace("["," ").$replace("]"," "),this.jvxlData.contourValues=this.params.contoursDiscrete=this.parseFloatArrayStr(a),JU.Logger.info("JVXL read: contourValues "+JU.Escape.eAF(this.jvxlData.contourValues))),a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"contourColors"),0<a.length&&(this.jvxlData.contourColixes=this.params.contourColixes=JU.C.getColixArray(a),this.jvxlData.contourColors=JU.C.getHexCodes(this.jvxlData.contourColixes),JU.Logger.info("JVXL read: contourColixes "+
JU.C.getHexCodes(this.jvxlData.contourColixes))),this.params.contourFromZero=J.jvxl.readers.XmlReader.getXmlAttrib(b,"contourFromZero").equals("true"));this.params.nContours=this.haveContourData?c:d}this.jvxlData.nVertexColors=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"nVertexColors"));this.params.isBicolorMap=J.jvxl.readers.XmlReader.getXmlAttrib(b,"bicolorMap").equals("true");this.params.isBicolorMap&&(a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"colorPositive"),0<a.length&&(-2147483648==
this.params.colorRgb&&-16776961==this.params.colorPos)&&(this.params.colorPos=JU.CU.getArgbFromString(a)),a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"colorNegative"),0<a.length&&(-2147483648==this.params.colorRgb&&-65536==this.params.colorNeg)&&(this.params.colorNeg=JU.CU.getArgbFromString(a)));if(this.params.isBicolorMap||this.params.colorBySign)this.jvxlCutoff=0;this.jvxlDataIsColorMapped=(-2147483648==this.params.colorRgb||2147483647==this.params.colorRgb)&&(this.params.isBicolorMap||J.jvxl.readers.XmlReader.getXmlAttrib(b,
"colorMapped").equals("true"));this.jvxlData.isJvxlPrecisionColor=J.jvxl.readers.XmlReader.getXmlAttrib(b,"precisionColor").equals("true");this.jvxlData.jvxlDataIsColorDensity=this.params.colorDensity=-2147483648==this.params.colorRgb&&J.jvxl.readers.XmlReader.getXmlAttrib(b,"colorDensity").equals("true");this.jvxlData.jvxlDataIsColorDensity&&Float.isNaN(this.params.pointSize)&&(a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"pointSize"),0<a.length&&(this.jvxlData.pointSize=this.params.pointSize=this.parseFloatStr(a)));
a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"allowVolumeRender");this.jvxlData.allowVolumeRender=this.params.allowVolumeRender=0==a.length||a.equalsIgnoreCase("true");a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"plane");if(0<=a.indexOf("{")){this.params.thePlane=null;this.params.mapLattice=null;try{this.params.thePlane=JU.Escape.uP(a),a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"maplattice"),JU.Logger.info("JVXL read: plane "+this.params.thePlane),0<=a.indexOf("{")&&(this.params.mapLattice=JU.Escape.uP(a),
JU.Logger.info("JVXL read: mapLattice "+this.params.mapLattice)),0==this.params.scale3d&&(this.params.scale3d=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"scale3d"))),Float.isNaN(this.params.scale3d)&&(this.params.scale3d=0)}catch(e){if(S(e,Exception))null==this.params.thePlane?(JU.Logger.error("JVXL Error reading plane definition -- setting to 0 0 1 0  (z=0)"),this.params.thePlane=JU.P4.new4(0,0,1,0)):JU.Logger.error("JVXL Error reading mapLattice definition -- ignored");else throw e;
}this.edgeDataCount=this.surfaceDataCount=0}else this.params.thePlane=null,this.surfaceDataCount=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"nSurfaceInts")),this.edgeDataCount=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"nBytesUncompressedEdgeData")),a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"fixedLattice"),0<=a.indexOf("{")&&(this.jvxlData.fixedLattice=JU.Escape.uP(a));this.excludedVertexCount=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"nExcludedVertexes"));
this.excludedTriangleCount=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"nExcludedTriangles"));this.invalidatedVertexCount=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"nInvalidatedVertexes"));a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"slabInfo");0<a.length&&(this.jvxlData.slabInfo=a);this.colorDataCount=Math.max(0,this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"nBytesUncompressedColorData")));this.jvxlDataIs2dContour=null!=this.params.thePlane&&this.jvxlDataIsColorMapped;
this.jvxlData.color=J.jvxl.readers.XmlReader.getXmlAttrib(b,"color");if(0==this.jvxlData.color.length||0<=this.jvxlData.color.indexOf("null"))this.jvxlData.color="orange";this.jvxlData.translucency=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"translucency"));Float.isNaN(this.jvxlData.translucency)&&(this.jvxlData.translucency=0);a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"meshColor");0<a.length&&(this.jvxlData.meshColor=a);a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"rendering");0<a.length&&
(this.jvxlData.rendering=a);this.jvxlData.colorScheme=J.jvxl.readers.XmlReader.getXmlAttrib(b,"colorScheme");0==this.jvxlData.colorScheme.length&&(this.jvxlData.colorScheme=this.jvxlDataIsColorMapped?"roygb":null);0>this.jvxlData.thisSet&&(a=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"set")),0<a&&(this.jvxlData.thisSet=a-1));this.jvxlData.slabValue=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"slabValue"));this.jvxlData.isSlabbable=J.jvxl.readers.XmlReader.getXmlAttrib(b,
"slabbable").equalsIgnoreCase("true");this.jvxlData.diameter=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"diameter"));-2147483648==this.jvxlData.diameter&&(this.jvxlData.diameter=0);this.jvxlDataIs2dContour&&(this.params.isContoured=!0);this.params.colorBySign&&(this.params.isBicolorMap=!0);a=J.jvxl.readers.XmlReader.getXmlAttrib(b,"insideOut").equals("true");var f=d=c=NaN,g=NaN;this.jvxlDataIsColorMapped&&(c=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"dataMinimum")),
d=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"dataMaximum")),f=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"valueMappedToRed")),g=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(b,"valueMappedToBlue")),Float.isNaN(c)&&(c=f=-1,d=g=1));this.jvxlSetColorRanges(c,d,f,g,a)});e(c$,"jvxlSetColorRanges",function(a,b,c,d,e){this.jvxlDataIsColorMapped&&(!Float.isNaN(a)&&!Float.isNaN(b)&&(0==b&&0==a&&(a=-1,b=1),this.params.mappedDataMin=a,this.params.mappedDataMax=b,JU.Logger.info("JVXL read: data_min/max "+
this.params.mappedDataMin+"/"+this.params.mappedDataMax)),this.params.rangeDefined||(!Float.isNaN(c)&&!Float.isNaN(d)?(0==c&&0==d&&(c=-1,d=1),this.params.valueMappedToRed=Math.min(c,d),this.params.valueMappedToBlue=Math.max(c,d),this.params.isColorReversed=c>d):(this.params.valueMappedToRed=0,this.params.valueMappedToBlue=1),this.params.rangeDefined=!0),JU.Logger.info("JVXL read: color red/blue: "+this.params.valueMappedToRed+"/"+this.params.valueMappedToBlue));this.jvxlData.valueMappedToRed=this.params.valueMappedToRed;
this.jvxlData.valueMappedToBlue=this.params.valueMappedToBlue;this.jvxlData.mappedDataMin=this.params.mappedDataMin;this.jvxlData.mappedDataMax=this.params.mappedDataMax;this.jvxlData.isColorReversed=this.params.isColorReversed;this.params.insideOut&&(e=!e);this.params.insideOut=this.jvxlData.insideOut=e},"~N,~N,~N,~N,~B");n(c$,"readSurfaceData",function(){this.thisInside=!this.params.isContoured;this.readSurfaceDataXML()||(this.tempDataXml=this.xr.getXmlData("jvxlEdgeData",null,!0,!1),this.bsVoxelBitSet=
J.jvxl.data.JvxlCoder.jvxlDecodeBitSet(this.xr.getXmlData("jvxlEdgeData",this.tempDataXml,!1,!1)),this.readSurfaceDataJXR())},"~B");e(c$,"readSurfaceDataXML",function(){return this.vertexDataOnly?(this.getEncodedVertexData(),!0):null!=this.params.thePlane?(this.volumeData.setDataDistanceToPlane(this.params.thePlane),this.setVolumeDataV(this.volumeData),this.params.cutoff=0,this.jvxlData.setSurfaceInfo(this.params.thePlane,this.params.mapLattice,0,""),this.jvxlData.scale3d=this.params.scale3d,!0):
!1});e(c$,"readSurfaceDataJXR",function(){this.readSurfaceDataVFR(!1);this.volumeData.setMappingPlane(null)});e(c$,"jvxlReadFractionData",function(a){var b;try{if(a.equals("edge"))b=J.jvxl.data.JvxlCoder.jvxlDecompressString(J.jvxl.readers.XmlReader.getXmlAttrib(this.tempDataXml,"data"));else{var c=this.xr.getXmlData("jvxlColorData",null,!0,!1);this.jvxlData.isJvxlPrecisionColor=J.jvxl.readers.JvxlXmlReader.getEncoding(c).endsWith("2");b=J.jvxl.data.JvxlCoder.jvxlDecompressString(J.jvxl.readers.XmlReader.getXmlAttrib(c,
"data"))}}catch(d){if(S(d,Exception))throw JU.Logger.error("Error reading "+a+" data "+d),new NullPointerException;throw d;}return b},"~S,~N");n(c$,"getVoxelBitSet",function(a){if(null!=this.bsVoxelBitSet)return this.bsVoxelBitSet;var b=new JU.BS,c=0;if(0>=this.surfaceDataCount)return b;for(var d=0;c<a;){d=this.parseInt();if(-2147483648==d&&(this.rd(),null==this.line||-2147483648==(d=this.parseIntStr(this.line))))this.endOfData||JU.Logger.error("end of file in JvxlReader? line="+this.line),this.endOfData=
!0,d=1E4;this.thisInside=!this.thisInside;++this.jvxlNSurfaceInts;this.thisInside&&b.setBits(c,c+d);c+=d}return b},"~N");n(c$,"getSurfacePointAndFraction",function(a,b,c,d,e,f,g,n,k,p,l,q,v){if(0>=this.edgeDataCount)return this.getSPFv(a,b,c,d,e,f,g,n,k,p,l,q,v);v.scaleAdd2(q[0]=this.jvxlGetNextFraction(this.edgeFractionBase,this.edgeFractionRange,0.5),f,e);Float.isNaN(this.valueMin)&&this.setValueMinMax();return 0==this.valueCount||this.includeValueNaN&&Float.isNaN(q[0])?q[0]:this.getNextValue()},
"~N,~B,~N,~N,JU.T3,JU.V3,~N,~N,~N,~N,~N,~A,JU.T3");e(c$,"getNextValue",function(){for(var a=NaN;this.colorPtr<this.valueCount&&Float.isNaN(a);){a=this.jvxlData.isJvxlPrecisionColor?J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter2(this.jvxlColorDataRead.charCodeAt(this.colorPtr),this.jvxlColorDataRead.charCodeAt(this.colorPtr++ +this.valueCount),this.colorFractionBase,this.colorFractionRange):J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(this.jvxlColorDataRead.charCodeAt(this.colorPtr++),this.colorFractionBase,
this.colorFractionRange,0.5);break}return this.valueMin+a*this.valueRange});e(c$,"setValueMinMax",function(){this.valueCount=this.jvxlColorDataRead.length;this.jvxlData.isJvxlPrecisionColor&&(this.valueCount/=2);this.includeValueNaN=this.valueCount!=this.jvxlEdgeDataRead.length;this.valueMin=!this.jvxlData.isJvxlPrecisionColor?this.params.valueMappedToRed:3.4028235E38==this.params.mappedDataMin?0:this.params.mappedDataMin;this.valueRange=(!this.jvxlData.isJvxlPrecisionColor?this.params.valueMappedToBlue:
3.4028235E38==this.params.mappedDataMin?1:this.params.mappedDataMax)-this.valueMin;this.haveReadColorData=!0});e(c$,"jvxlGetNextFraction",function(a,b,c){this.fractionPtr>=this.strFractionTemp.length&&(this.endOfData||JU.Logger.error("end of file reading compressed fraction data"),this.endOfData=!0,this.strFractionTemp=""+String.fromCharCode(a),this.fractionPtr=0);return J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(this.strFractionTemp.charCodeAt(this.fractionPtr++),a,b,c)},"~N,~N,~N");n(c$,"readColorData",
function(){if(!this.jvxlDataIsColorMapped)return"";var a=this.jvxlData.vertexCount=this.meshData.vc,b=this.meshData.vcs,c=this.meshData.vvs;if("none".equals(this.jvxlColorEncodingRead)){this.jvxlData.vertexColors=u(a,0);for(var d=u(1,0),c=JU.PT.parseIntNext(this.jvxlColorDataRead,d),c=Math.min(c,a),a=JU.PT.getTokens(this.jvxlColorDataRead.substring(d[0])),e=!1,f=this.jvxlData.translucency,g=0,d=0;d<c;d++)try{var n=J.jvxl.readers.JvxlXmlReader.getColor(a[d]);0==n?n=g:g=n;b[d]=JU.C.getColixTranslucent(this.jvxlData.vertexColors[d]=
n);JU.C.isColixTranslucent(b[d])?e=!0:0!=f&&(b[d]=JU.C.getColixTranslucent3(b[d],!0,f))}catch(k){if(S(k,Exception))JU.Logger.info("JvxlXmlReader: Cannot interpret color code: "+a[d]);else throw k;}e&&0==f&&(this.jvxlData.translucency=0.5);return"-"}null==this.params.colorEncoder&&(this.params.colorEncoder=new JU.ColorEncoder(null,null));this.params.colorEncoder.setColorScheme(null,!1);this.params.colorEncoder.setRange(this.params.valueMappedToRed,this.params.valueMappedToBlue,this.params.isColorReversed);
JU.Logger.info("JVXL reading color data mapped min/max: "+this.params.mappedDataMin+"/"+this.params.mappedDataMax+" for "+a+" vertices. using encoding keys "+this.colorFractionBase+" "+this.colorFractionRange);JU.Logger.info("mapping red--\x3eblue for "+this.params.valueMappedToRed+" to "+this.params.valueMappedToBlue+" colorPrecision:"+this.jvxlData.isJvxlPrecisionColor);var p=Float.isNaN(this.valueMin);p&&this.setValueMinMax();var l=3.4028235E38,q=-3.4028235E38;if(null==b||b.length<a)this.meshData.vcs=
b=V(a,0);e=n=0;this.params.colorBySign&&(e=JU.C.getColix(this.params.isColorReversed?this.params.colorNeg:this.params.colorPos),n=JU.C.getColix(this.params.isColorReversed?this.params.colorPos:this.params.colorNeg));for(var f=this.meshData.vertexIncrement,v=3.4028235E38==this.params.mappedDataMin,d=0;d<a;d+=f)g=p?c[d]=this.getNextValue():c[d],v&&(g<l&&(l=g),g>q&&(q=g));v&&(this.params.mappedDataMin=l,this.params.mappedDataMax=q);if(null!=this.jvxlData.colorScheme){p=null!=this.marchingSquares&&this.params.isContoured;
for(d=0;d<a;d+=f)g=c[d],p?this.marchingSquares.setContourData(d,g):(g=!this.params.colorBySign?this.params.colorEncoder.getColorIndex(g):(this.params.isColorReversed?0<g:0>=g)?n:e,b[d]=JU.C.getColixTranslucent3(g,!0,this.jvxlData.translucency))}return this.jvxlColorDataRead+"\n"});c$.getColor=e(c$,"getColor",function(a){var b=0;try{switch(a.charAt(0)){case "[":b=JU.CU.getArgbFromString(a);break;case "0":b=JU.PT.parseIntRadix(a.substring(2),16);break;default:b=JU.PT.parseIntRadix(a,10)}}catch(c){if(!S(c,
Exception))throw c;}return b},"~S");e(c$,"getEncodedVertexData",function(){var a=this.xr.getXmlData("jvxlSurfaceData",null,!0,!1);this.jvxlDecodeVertexData(this.xr.getXmlData("jvxlVertexData",a,!0,!1),!1);var b=this.xr.getXmlData("jvxlTriangleData",a,!0,!1),c=this.xr.getXmlData("jvxlTriangleEdgeData",a,!0,!1),d=this.xr.getXmlData("jvxlPolygonColorData",a,!1,!1);this.jvxlDecodeTriangleData(b,c,d);a=this.xr.getXmlData("jvxlColorData",a,!0,!1);this.jvxlColorEncodingRead=J.jvxl.readers.JvxlXmlReader.getEncoding(a);
this.jvxlData.isJvxlPrecisionColor=this.jvxlColorEncodingRead.endsWith("2");a=this.getData(a,"jvxlColorData");this.jvxlColorDataRead=this.jvxlColorEncodingRead.equals("none")?a:J.jvxl.data.JvxlCoder.jvxlDecompressString(a);this.jvxlDataIsColorMapped=(-2147483648==this.params.colorRgb||2147483647==this.params.colorRgb)&&0<this.jvxlColorDataRead.length;this.haveContourData&&this.jvxlDecodeContourData(this.jvxlData,this.xr.getXmlData("jvxlContourData",null,!1,!1))});e(c$,"getData",function(a,b){var c=
J.jvxl.readers.XmlReader.getXmlAttrib(a,"data");0==c.length&&(c=this.xr.getXmlData(b,a,!1,!1));return c},"~S,~S");c$.getEncoding=e(c$,"getEncoding",function(a){if(0<J.jvxl.readers.XmlReader.getXmlAttrib(a,"len").length)return"";a=J.jvxl.readers.XmlReader.getXmlAttrib(a,"encoding");return 0==a.length?"none":a},"~S");e(c$,"jvxlDecodeVertexData",function(a,b){var c=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"count"));b||JU.Logger.info("Reading "+c+" vertices");var d=3*c,e=b?Array(c):null,
f,g=J.jvxl.readers.XmlReader.getXmlAttrib(a,"data"),n=J.jvxl.readers.JvxlXmlReader.getEncoding(a);if("none".equals(n)){0==g.length&&(g=this.xr.getXmlData("jvxlVertexData",a,!1,!1));d=JU.PT.parseFloatArray(g);d[0]!=3*c&&JU.Logger.info("JvxlXmlReader: vertexData count="+z(d[0])+"; expected "+3*c);g=0;for(n=1;g<c;g++){var k=JU.P3.new3(d[n++],d[n++],d[n++]);b?e[g]=k:this.addVertexCopy(k,0,g,!1)}}else{var p=this.xr.getXmlPoint(a,"min"),l=this.xr.getXmlPoint(a,"max");l.sub(p);var q=this.jvxlData.colorFractionBase,
v=this.jvxlData.colorFractionRange,s=J.jvxl.data.JvxlCoder.jvxlDecompressString(g);0==s.length&&(s=this.xr.getXmlData("jvxlVertexData",a,!1,!1));g=0;for(n=-1;g<c;g++)k=new JU.P3,f=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter2(s.charCodeAt(++n),s.charCodeAt(n+d),q,v),k.x=p.x+f*l.x,f=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter2(s.charCodeAt(++n),s.charCodeAt(n+d),q,v),k.y=p.y+f*l.y,f=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter2(s.charCodeAt(++n),s.charCodeAt(n+d),q,v),k.z=p.z+f*l.z,b?e[g]=
k:this.addVertexCopy(k,0,g,!1)}return e},"~S,~B");e(c$,"jvxlDecodeTriangleData",function(a,b,c){var d=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"count"));if(!(0>d)){var e=u(1,0),f=null==c?-1:1,g=0;JU.Logger.info("Reading "+d+" triangles");var n=J.jvxl.readers.JvxlXmlReader.getEncoding(a);a=this.getData(a,"jvxlTriangleData");b=this.getData(b,"jvxlTriangleEdgeData");var k=u(3,0),p=u(1,0),l=null,q=7,v=!"none".equals(n);if(v)a=J.jvxl.data.JvxlCoder.jvxlDecompressString(a),b=J.jvxl.data.JvxlCoder.jvxlDecompressString(b).trim(),
n=b.length==d;else{var s=JU.PT.parseIntNext(a,p);(n=0<b.length)?(l=u(1,0),JU.PT.parseIntNext(b,l)):0<s&&JU.Logger.info("JvxlXmlReader: jvxlTriangleEdgeData count="+s+"; expected "+d)}for(var C=s=0,x=0,z=-1;s<d;){if(v){var D=a.charAt(++z);switch(D){case "!":D=0;break;case "+":case ".":case " ":case "\n":case "\r":case "\t":case ",":continue;case "-":case "0":case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":p[0]=z;D=JU.PT.parseIntNext(a,p);z=p[0]-1;break;default:D=D.charCodeAt(0)-
92}C+=D}else C=JU.PT.parseIntNext(a,p)-1;k[x]=C;if(3==++x){x=0;if(n&&(q=null==l?b.charCodeAt(s)-48:JU.PT.parseIntNext(b,l),0>q||7<q))q=7;0==--f&&(f=JU.PT.parseIntNext(c,e),D=JU.PT.parseIntNext(c,e),-2147483648==D?f=0:g=D|4278190080);this.addTriangleCheck(k[0],k[1],k[2],q,g,!1,g);s++}}}},"~S,~S,~S");e(c$,"jvxlDecodeContourData",function(a,b){var c=new JU.Lst,d=new JU.SB,e=new JU.SB,f=-1;a.vContours=null;if(null!=b){for(;0<=(f=b.indexOf("<jvxlContour",f+1));){var g=new JU.Lst,n=this.xr.getXmlData("jvxlContour",
b.substring(f),!0,!1),k=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(n,"value"));d.append(" ").appendF(k);var p=J.jvxl.readers.JvxlXmlReader.getColor(J.jvxl.readers.XmlReader.getXmlAttrib(n,"color")),l=JU.C.getColix(p);e.append(" ").append(JU.Escape.escapeColor(p));var q=J.jvxl.data.JvxlCoder.jvxlDecompressString(J.jvxl.readers.XmlReader.getXmlAttrib(n,"data")),v=J.jvxl.data.JvxlCoder.jvxlDecodeBitSet(this.xr.getXmlData("jvxlContour",n,!1,!1)),n=v.length();J.shapesurface.IsosurfaceMesh.setContourVector(g,
n,v,k,l,p,JU.SB.newS(q));c.addLast(g)}n=c.size();if(0<n){a.vContours=JU.AU.createArrayOfArrayList(n);a.contourColixes=this.params.contourColixes=V(n,0);a.contourValues=this.params.contoursDiscrete=x(n,0);for(f=0;f<n;f++)a.vContours[f]=c.get(f),a.contourValues[f]=a.vContours[f].get(2).floatValue(),a.contourColixes[f]=a.vContours[f].get(3)[0];a.contourColors=JU.C.getHexCodes(a.contourColixes);JU.Logger.info("JVXL read: "+n+" discrete contours");JU.Logger.info("JVXL read: contour values: "+d);JU.Logger.info("JVXL read: contour colors: "+
e)}}},"J.jvxl.data.JvxlData,~S");n(c$,"postProcessVertices",function(){var a=this.params.bsExcluded[1];null!=a&&(null!=this.meshDataServer&&this.meshDataServer.fillMeshData(this.meshData,1,null),this.meshData.invalidateVertices(a),null!=this.meshDataServer&&(this.meshDataServer.fillMeshData(this.meshData,4,null),this.meshData=new J.jvxl.data.MeshData),this.updateTriangles())})});F("J.rendersurface");L(["J.render.MeshRenderer"],"J.rendersurface.IsosurfaceRenderer",["java.lang.Boolean","$.Float","JU.V3",
"JU.C","$.Normix"],function(){c$=M(function(){this.isBicolorMap=this.iHideBackground=!1;this.nError=this.backgroundColix=0;this.isosurface=this.imesh=this.vertexValues=null;this.showNumbers=this.iShowNormals=this.isNavigationMode=!1;this.showKey=null;this.hasColorRange=!1;this.meshScale=-1;this.globalSlabValue=this.mySlabValue=0;N(this,arguments)},J.rendersurface,"IsosurfaceRenderer",J.render.MeshRenderer);n(c$,"render",function(){return this.renderIso()});e(c$,"renderIso",function(){this.setGlobals();
for(var a=this.isosurface.meshCount;0<=--a;)if(this.mesh=this.imesh=this.isosurface.meshes[a],null==this.imesh.connectedAtoms||this.vwr.ms.at[this.imesh.connectedAtoms[0]].checkVisible())this.hasColorRange=!1,this.renderMeshSlab()&&(this.renderInfo(),this.isExport&&this.isGhostPass&&(this.exportPass=1,this.renderMeshSlab(),this.exportPass=2));return this.needTranslucent});e(c$,"setGlobals",function(){this.needTranslucent=!1;this.antialias=this.g3d.isAntialiased();this.iShowNormals=this.vwr.getBoolean(603979965);
this.showNumbers=this.vwr.getBoolean(603979964);this.isosurface=this.shape;this.exportPass=this.isExport?2:0;this.isNavigationMode=this.vwr.getBoolean(603979889);this.showKey=this.vwr.getBoolean(603979869)?Boolean.TRUE:null;this.isosurface.keyXy=null;this.meshScale=-1;this.globalSlabValue=this.vwr.gdata.slab;this.mySlabValue=this.isNavigationMode?z(this.tm.getNavigationOffset().z):2147483647});e(c$,"renderInfo",function(){if(!this.isExport&&this.hasColorRange&&!(null==this.imesh.colorEncoder||Boolean.TRUE!==
this.showKey)){this.showKey=Boolean.FALSE;var a=null,b=null,c=null,d=0,e=0;if(this.imesh.showContourLines)if(c=this.imesh.getContours(),null==c){b=this.imesh.jvxlData.contourColixes;if(null==b)return;d=b.length}else d=c.length,e=1;else a=this.imesh.colorEncoder.getColorSchemeArray(this.imesh.colorEncoder.currentPalette),d=null==a?0:a.length,e=2;if(!(2>d)){var f=this.antialias?2:1,g=this.vwr.getScreenHeight()*f,n=G(G(g/2)/(d-1)),g=3*G(g/4)-n,k=10*f,p=20*f;this.isosurface.keyXy=u(-1,[G(k/f),0,G((k+
p)/f),G((g+n)/f),G(n/f)]);for(var l=0;l<d;l++,g-=n){switch(e){case 0:if(!this.g3d.setC(b[l]))return;break;case 1:if(!this.g3d.setC(c[l].get(3)[0]))return;break;case 2:this.vwr.gdata.setColor(a[l])}this.g3d.fillTextRect(k,g,5,-2147483648,p,n)}this.isosurface.keyXy[1]=G((g+n)/f)}}});e(c$,"renderMeshSlab",function(){this.volumeRender=this.imesh.jvxlData.colorDensity&&this.imesh.jvxlData.allowVolumeRender;var a=this.mySlabValue;this.frontOnly=this.mesh.frontOnly||26==this.shapeID;this.isShell=this.mesh.isShell&&
26!=this.shapeID;if(!this.isNavigationMode&&(this.meshSlabValue=this.imesh.jvxlData.slabValue,-2147483648!=this.meshSlabValue&&this.imesh.jvxlData.isSlabbable)){for(var b=this.imesh.jvxlData.boundingBox,a=3.4028235E38,c=1.4E-45,d=b.length;0<=--d;)this.pt2f.setT(b[d]),this.tm.transformPt3f(this.pt2f,this.pt2f),this.pt2f.z<a&&(a=this.pt2f.z),this.pt2f.z>c&&(c=this.pt2f.z);a=Math.round(a+(c-a)*(100-this.meshSlabValue)/100);this.frontOnly=(new Boolean(this.frontOnly&100<=this.meshSlabValue)).valueOf();
this.isShell=(new Boolean(this.isShell&100<=this.meshSlabValue)).valueOf()}b=this.vwr.gdata.translucentCoverOnly;this.vwr.gdata.translucentCoverOnly=this.frontOnly||!this.vwr.getBoolean(603979967);this.thePlane=this.imesh.jvxlData.jvxlPlane;this.vertexValues=this.mesh.vvs;2147483647!=a&&this.imesh.jvxlData.isSlabbable?(this.g3d.setSlab(a),a=this.renderMesh2(this.mesh),this.g3d.setSlab(this.globalSlabValue)):a=this.renderMesh2(this.mesh);this.vwr.gdata.translucentCoverOnly=b;return a});n(c$,"render2",
function(a){if(this.volumeRender)this.renderPoints();else{switch(this.imesh.dataType){case 70:this.renderLonePair(!1);return;case 71:this.renderLonePair(!0);return}this.isBicolorMap=this.imesh.jvxlData.isBicolorMap;this.render2b(a);this.g3d.setC(4)&&this.imesh.showContourLines&&this.renderContourLines()}},"~B");e(c$,"renderLonePair",function(a){this.pt2f.setT(this.vertices[1]);this.tm.transformPt3f(this.pt2f,this.pt2f);var b=z(this.vwr.tm.scaleToScreen(z(this.pt2f.z),100));1>b&&(b=1);if(!a){var c=
new JU.V3;a=new JU.V3;this.pt1f.setT(this.vertices[0]);this.tm.transformPt3f(this.pt1f,this.pt1f);c.sub2(this.pt2f,this.pt1f);a.set(c.x,c.y,c.z+1);a.cross(a,c);a.normalize();c=this.vwr.tm.scaleToScreen(z(this.pt1f.z),100);a.scale(c);this.pt1f.add2(this.pt2f,a);this.pt2f.sub(a);this.screens[0].set(Math.round(this.pt1f.x),Math.round(this.pt1f.y),Math.round(this.pt1f.z));this.g3d.fillSphereI(b,this.screens[0])}this.screens[1].set(Math.round(this.pt2f.x),Math.round(this.pt2f.y),Math.round(this.pt2f.z));
this.g3d.fillSphereI(b,this.screens[1])},"~B");e(c$,"renderContourLines",function(){var a=this.imesh.getContours();if(null==a)null!=this.imesh.jvxlData.contourValues&&(this.hasColorRange=!0);else{this.hasColorRange=0==this.mesh.meshColix;for(var b=a.length;0<=--b;){var c=a[b];if(!(6>c.size())){this.colix=0==this.mesh.meshColix?c.get(3)[0]:this.mesh.meshColix;if(!this.g3d.setC(this.colix))break;for(var d=c.size()-1,e=this.getDiameter(),f=6;f<d;f++){var g=c.get(f),n=c.get(++f);if(Float.isNaN(g.x)||
Float.isNaN(n.x))break;this.tm.transformPtScrT3(g,this.pt1f);this.tm.transformPtScrT3(n,this.pt2f);this.pt1f.z-=2;this.pt2f.z-=2;!this.antialias&&1==e?this.g3d.drawLineAB(this.pt1f,this.pt2f):this.g3d.fillCylinderBits(1,e,this.pt1f,this.pt2f)}}}}});n(c$,"renderPoints",function(){try{this.volumeRender&&this.g3d.volumeRender(!0);var a=(this.volumeRender||0==this.mesh.pc)&&this.selectedPolyOnly,b=this.imesh.vertexIncrement,c;0>=this.mesh.diameter?(c=this.vwr.getInt(553648144),this.frontOnly=this.isShell=
!1):c=G(this.vwr.getScreenDim()/(this.volumeRender?50:100));var d=Math.round(Float.isNaN(this.mesh.volumeRenderPointSize)?150:1E3*this.mesh.volumeRenderPointSize);1>c&&(c=1);var e=this.showNumbers?G(this.vwr.getScreenWidth()/2):0,f=this.showNumbers?G(this.vwr.getScreenHeight()/2):0;this.showNumbers&&this.vwr.gdata.setFontFid(this.vwr.gdata.getFontFidFS("Monospaced",24));for(var g=!this.imesh.hasGridPoints||0>this.imesh.firstRealVertex?0:this.imesh.firstRealVertex;g<this.vertexCount;g+=b)if(!(null!=
this.vertexValues&&Float.isNaN(this.vertexValues[g])||this.frontOnly&&!this.isVisibleNormix(this.normixes[g])||0<=this.imesh.jvxlData.thisSet&&this.mesh.vertexSets[g]!=this.imesh.jvxlData.thisSet||!this.mesh.isColorSolid&&null!=this.mesh.vcs&&!this.setColix(this.mesh.vcs[g])||this.haveBsDisplay&&!this.mesh.bsDisplay.get(g)||a&&!this.bsPolygons.get(g))){this.hasColorRange=!0;if(this.showNumbers&&10<this.screens[g].z&&150>Math.abs(this.screens[g].x-e)&&150>Math.abs(this.screens[g].y-f)){var n=g+(this.mesh.isColorSolid?
"":" "+this.mesh.vvs[g]);this.g3d.setC(4);this.g3d.drawStringNoSlab(n,null,this.screens[g].x,this.screens[g].y,this.screens[g].z-30,0)}this.volumeRender?(c=z(this.vwr.tm.scaleToScreen(this.screens[g].z,d)),1>c&&(c=1),this.g3d.volumeRender4(c,this.screens[g].x,this.screens[g].y,this.screens[g].z)):this.g3d.fillSphereI(c,this.screens[g])}if(3==b){this.g3d.setC(this.isTranslucent?JU.C.getColixTranslucent3(12,!0,0.5):12);for(g=1;g<this.vertexCount;g+=3)this.g3d.fillCylinder(3,G(c/4),this.screens[g],this.screens[g+
1]);this.g3d.setC(this.isTranslucent?JU.C.getColixTranslucent3(21,!0,0.5):21);for(g=1;g<this.vertexCount;g+=3)this.g3d.fillSphereI(c,this.screens[g]);this.g3d.setC(this.isTranslucent?JU.C.getColixTranslucent3(7,!0,0.5):7);for(g=2;g<this.vertexCount;g+=3)this.g3d.fillSphereI(c,this.screens[g])}}catch(k){}this.volumeRender&&this.g3d.volumeRender(!1)});n(c$,"renderTriangles",function(a,b,c){this.g3d.addRenderer(1073742182);var d=this.mesh.pis;this.colix=this.isGhostPass?this.mesh.slabColix:!a&&0!=this.mesh.meshColix?
this.mesh.meshColix:this.mesh.colix;var e=!a&&0!=this.mesh.meshColix?null:this.mesh.vcs;this.isTranslucentInherit&&(this.colix=JU.C.copyColixTranslucency(this.mesh.slabColix,this.mesh.colix));this.g3d.setC(this.colix);c&&(this.frontOnly&&a&&(this.frontOnly=!1),this.bsPolygonsToExport.clearAll());1==this.exportType&&(this.frontOnly=!1);var f=this.isGhostPass&&!this.isBicolorMap||null==e||this.mesh.isColorSolid,g=this.isGhostPass&&!this.isBicolorMap||null==e||!a&&0!=this.mesh.meshColix,n=this.colix;
null!=this.imesh.jvxlData.jvxlPlane&&(!f&&!a&&this.mesh.fillTriangles)&&(f=!0,n=4);var k=f&&null!=this.mesh.pcs;k&&(!a&&this.mesh.fillTriangles)&&(k=!1);var p=this.imesh.jvxlData.contourColixes;this.hasColorRange=!f&&!this.isBicolorMap;for(var l=this.getDiameter(),q=this.mesh.pc;0<=--q;){var v=d[q];if(!(null==v||this.selectedPolyOnly&&!this.bsPolygons.get(q))){var s=v[0],u=v[1],x=v[2];if(!(0<=this.imesh.jvxlData.thisSet&&null!=this.mesh.vertexSets&&this.mesh.vertexSets[s]!=this.imesh.jvxlData.thisSet)&&
(!this.haveBsDisplay||this.mesh.bsDisplay.get(s)&&this.mesh.bsDisplay.get(u)&&this.mesh.bsDisplay.get(x))){var z=this.normixes[s],D=this.normixes[u],G=this.normixes[x],F=this.frontOnly||this.isShell?this.checkFront(z,D,G):7;if(!(a&&0==F)){var t,y,H;if(f){if(k&&q<this.mesh.pcs.length){t=this.mesh.pcs[q];if(0==t)continue;n=t}b&&(n=Math.round(10*Math.random())+5);t=y=H=n}else if(t=e[s],y=e[u],H=e[x],this.isBicolorMap){if(t!=y||y!=H)continue;this.isGhostPass&&(t=y=H=JU.C.copyColixTranslucency(this.mesh.slabColix,
t))}if(a)c?this.bsPolygonsToExport.set(q):(u==x?(this.setColix(t),s==u?this.g3d.fillSphereI(l,this.screens[s]):this.g3d.fillCylinder(3,l,this.screens[s],this.screens[u])):this.mesh.colorsExplicit?(this.vwr.gdata.setColor(v[4]),t=JU.C.copyColixTranslucency(this.mesh.colix,2047),this.g3d.setC(t),this.g3d.fillTriangle3CN(this.screens[s],t,z,this.screens[u],t,D,this.screens[x],t,G)):(this.isTranslucentInherit&&null!=e&&(t=JU.C.copyColixTranslucency(this.mesh.slabColix,e[s]),y=JU.C.copyColixTranslucency(this.mesh.slabColix,
e[u]),H=JU.C.copyColixTranslucency(this.mesh.slabColix,e[x])),this.g3d.fillTriangle3CN(this.screens[s],t,z,this.screens[u],y,D,this.screens[x],H,G)),this.iShowNormals&&this.renderNormals());else if(F&=v[3],0!=F){b&&(F=7);this.pt1i.setT(this.screens[s]);this.pt2i.setT(this.screens[u]);this.pt3i.setT(this.screens[x]);this.pt1i.z-=2;this.pt2i.z-=2;this.pt3i.z-=2;if(!g)if(k)this.g3d.setC(this.mesh.fillTriangles?4:p[v[4]%p.length]);else{this.drawTriangle(this.pt1i,t,this.pt2i,y,this.pt3i,H,F,l);continue}this.drawTriangle(this.pt1i,
n,this.pt2i,n,this.pt3i,n,F,l)}}}}}c&&this.exportSurface(f?n:0)},"~B,~B,~B");e(c$,"getDiameter",function(){var a;0>=this.mesh.diameter?(a=0>this.meshScale?this.meshScale=this.vwr.getInt(553648151):this.meshScale,this.antialias&&(a*=2)):a=G(this.vwr.getScreenDim()/100);1>a&&(a=1);return a});e(c$,"renderNormals",function(){if(this.g3d.setC(JU.C.copyColixTranslucency(this.mesh.colix,8))){this.vwr.gdata.setFontFid(this.vwr.gdata.getFontFidFS("Monospaced",24));for(var a=JU.Normix.getVertexVectors(),b=
this.vertexCount;0<=--b;)if(!(null!=this.vertexValues&&Float.isNaN(this.vertexValues[b]))){this.pt1f.setT(this.vertices[b]);var c=this.mesh.normixes[b];0<=c&&(this.pt2f.scaleAdd2(0.3,a[c],this.pt1f),this.tm.transformPtScrT3(this.pt2f,this.pt2f),this.pt1f.set(this.screens[b].x,this.screens[b].y,this.screens[b].z),this.g3d.drawLineAB(this.pt1f,this.pt2f))}}})})})(Clazz,Clazz.getClassName,Clazz.newLongArray,Clazz.doubleToByte,Clazz.doubleToInt,Clazz.doubleToLong,Clazz.declarePackage,Clazz.instanceOf,
Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,Clazz.floatToInt,Clazz.floatToLong,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.defineStatics,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.p0p,Clazz.pu$h,Clazz.newShortArray,Clazz.innerTypeInstance,Clazz.isClassDefined,Clazz.prepareCallback,Clazz.newArray,Clazz.castNullAs,Clazz.floatToShort,Clazz.superCall,Clazz.decorateAsType,
Clazz.newBooleanArray,Clazz.newCharArray,Clazz.implementOf,Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.clone,Clazz.doubleToShort,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.isAB,Clazz.isAI,Clazz.isAS,Clazz.isASS,Clazz.isAP,Clazz.isAFloat,Clazz.isAII,Clazz.isAFF,Clazz.isAFFF,Clazz.tryToSearchAndExecute,Clazz.getStackTrace,Clazz.inheritArgs,Clazz.alert,Clazz.defineMethod,Clazz.overrideMethod,Clazz.declareAnonymous,Clazz.cloneFinals);
