(function(ib,jc,kc,lc,M,mc,O,Y,L,C,z,x,nc,Z,oc,$,s,w,za,da,ia,g,Ia,ea,wa,na,oa,B,pc,qc,Ja,rc,sc,tc,uc,Ka,jb,vc,wc,xc,yc,zc,Ac,Bc,Cc,Dc,Ec,Fc,Gc,Hc,Ic,Jc,Kc,Lc,Mc,e,m){O("JS");L(null,"JS.ScriptExt",["JU.AU"],function(){var d=z(function(){this.e=this.vwr=null;this.chk=!1;this.st=null;this.slen=0;C(this,arguments)},JS,"ScriptExt",null);e(d,"init",function(a){this.e=a;this.vwr=this.e.vwr;return this},"~O");e(d,"atomExpressionAt",function(a){return this.e.atomExpressionAt(a)},"~N");e(d,"checkLength",function(a){this.e.checkLength(a)},
"~N");e(d,"error",function(a){this.e.error(a)},"~N");e(d,"invArg",function(){this.e.invArg()});e(d,"invPO",function(){this.error(23)});e(d,"getShapeProperty",function(a,b){return this.e.getShapeProperty(a,b)},"~N,~S");e(d,"paramAsStr",function(a){return this.e.paramAsStr(a)},"~N");e(d,"centerParameter",function(a){return this.e.centerParameter(a,null)},"~N");e(d,"floatParameter",function(a){return this.e.floatParameter(a)},"~N");e(d,"getPoint3f",function(a,b){return this.e.getPoint3f(a,b,!0)},"~N,~B");
e(d,"intParameter",function(a){return this.e.intParameter(a)},"~N");e(d,"isFloatParameter",function(a){switch(this.e.tokAt(a)){case 2:case 3:return!0}return!1},"~N");e(d,"setShapeProperty",function(a,b,c){this.e.setShapeProperty(a,b,c)},"~N,~S,~O");e(d,"showString",function(a){this.e.showString(a)},"~S");e(d,"stringParameter",function(a){return this.e.stringParameter(a)},"~N");e(d,"getToken",function(a){return this.e.getToken(a)},"~N");e(d,"tokAt",function(a){return this.e.tokAt(a)},"~N");e(d,"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(d,"getColorTrans",function(a,b,c,f){c=3.4028235E38;1765808134!=a.theTok&&--b;switch(this.tokAt(b+1)){case 1111490588:b++;c=this.isFloatParameter(b+1)?a.getTranslucentLevel(++b):this.vwr.getFloat(570425353);break;case 1073742074:b++,c=0}a.isColorParam(b+1)?f[0]=a.getArgbParam(++b):1073742333==this.tokAt(b+1)?(f[0]=0,a.iToken=b+1):3.4028235E38==c?this.invArg():
f[0]=-2147483648;return c},"JS.ScriptEval,~N,~B,~A");e(d,"finalizeObject",function(a,b,c,f,v,S,d,j){v&&this.setShapeProperty(a,"set",S);-2147483648!=b&&this.e.setShapePropertyBs(a,"color",Integer.$valueOf(b),j);3.4028235E38!=c&&this.e.setShapeTranslucency(a,"","translucent",c,j);0!=f&&this.setShapeProperty(a,"scale",Integer.$valueOf(f));0>d&&(d=-1-d,this.setShapeProperty(a,"token",Integer.$valueOf(1073742018)),this.setShapeProperty(a,"token",Integer.$valueOf(1073742046)));0<d&&(this.e.setMeshDisplayProperty(a,
d,0)||this.invArg())},"~N,~N,~N,~N,~B,~O,~N,JU.BS");e(d,"getIntArray2",function(a){a=this.e.getToken(a).getList();for(var b=JU.AU.newInt2(a.size()),c=b.length;0<=--c;){var f=a.get(c).getList();null==f&&this.invArg();b[c]=s(f.size(),0);for(var v=b[c].length;0<=--v;)b[c][v]=f.get(v).intValue}return b},"~N");e(d,"getAllPoints",function(a,b){var c=null,f=null;try{switch(this.e.tokAt(a)){case 7:c=this.e.getPointArray(a,-1,!1,!0);break;case 12290:case 10:case 1073742325:f=this.atomExpressionAt(a)}null==
c&&(null==f&&(f=this.vwr.getAllAtoms()),c=this.bsToArray(f))}catch(v){if(!$(v,Exception))throw v;}(null==c||c.length<b)&&this.invArg();return c},"~N,~N");e(d,"bsToArray",function(a){for(var b=Array(a.cardinality()),c=a.nextSetBit(0),f=0;0<=c;c=a.nextSetBit(c+1))b[f++]=this.vwr.ms.at[c];return b},"JU.BS")});O("JS");L(["JS.ScriptExt"],"JS.IsoExt","JU.AU $.BS $.Lst $.M4 $.Measure $.P3 $.PT $.Quat $.SB $.V3 J.api.Interface J.atomdata.RadiusData J.c.VDW JS.SV $.ScriptEval $.ScriptInterruption $.T JU.BSUtil $.BoxInfo $.C $.Escape $.GData $.Logger $.Parser $.Triangulator JV.JC".split(" "),
function(){var d=za(JS,"IsoExt",JS.ScriptExt);Z(d,function(){ia(this,JS.IsoExt,[])});m(d,"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(d,"dipole",function(){var a=this.e,b=null,c=null,f=!1,v=!1,S=!1,d=!1,j=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 e=1;e<this.slen;++e){c=b=null;switch(this.getToken(e).tok){case 1073742327:b="all";d=!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(e));break;case 10:10==this.tokAt(e+1)?this.setShapeProperty(17,"startSet",this.atomExpressionAt(e++)):
b="atomBitset";case 1073742325:null==b&&(b=f||v?"endSet":"startSet");c=j=this.atomExpressionAt(e);e=a.iToken;0==this.tokAt(e+1)&&"startSet"===b&&(b="atomBitset");d=f=!0;break;case 1073742332:case 8:c=this.getPoint3f(e,!0);e=a.iToken;b=f||v?"endCoord":"startCoord";v=!0;break;case 1677721602:b="bonds";d=!0;break;case 4102:d=!0;b="calculate";a.isAtomExpression(e+1)&&(c=j=this.atomExpressionAt(++e),e=a.iToken);break;case 1073741974:this.setShapeId(17,++e,S);e=a.iToken;break;case 1275069442:b="cross";
c=Boolean.TRUE;break;case 1073742040:b="cross";c=Boolean.FALSE;break;case 1073742066:this.isFloatParameter(e+1)?(c=this.floatParameter(++e),2==a.theTok?(b="offsetPercent",c=Integer.$valueOf(x(c))):(b="offset",c=Float.$valueOf(c))):(b="offsetPt",c=this.centerParameter(++e),e=a.iToken);break;case 1073742068:b="offsetSide";c=Float.$valueOf(this.floatParameter(++e));break;case 1073742188:b="value";c=Float.$valueOf(this.floatParameter(++e));break;case 1073742196:b="width";c=Float.$valueOf(this.floatParameter(++e));
break;default:if(268441089==a.theTok||JS.T.tokAttr(a.theTok,1073741824)){this.setShapeId(17,e,S);e=a.iToken;break}this.invArg()}S=12291!=a.theTok&&4102!=a.theTok;d&&(this.chk||a.getPartialCharges(j),d=!1);null!=b&&this.setShapeProperty(17,b,c)}(v||f)&&this.setShapeProperty(17,"set",null)}});e(d,"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,f=!1,v=!1,S=!1,d=0,j,e=null,k=0,g=3.4028235E38,n=s(-1,[-2147483648]),p=0,G="",W=0,fa=null,m=this.initIsosurface(22),w=(j=null!=m)&&null==this.getShapeProperty(22,"ID"),ra=null,La=0,pa=-1,I=-1,P=!1,K=!1,M=!1,O=!1,E=0,N=null,Q=null,q=a.iToken;q<this.slen;++q){var F=null,H=null,E=this.getToken(q).tok;switch(E){case 134217763:switch(E=this.getToken(q+(1073741864==this.tokAt(q+1)?2:1)).tok){case 1814695966:case 1812599299:k=E;v=!0;continue;case 1073742330:++q;F="intersect";H=a.objectNameParameter(++q);
b=v=!0;break;default:this.invArg()}break;case 1073741864:P=!0;I==q-1&&I++;switch(this.tokAt(q+1)){case 134217750:case 1073741998:case 1812599299:continue;default:this.invArg()}break;case 1611272194:this.chk||this.vwr.getModelkit(!1).drawAxes(null,m,G);return;case 1073741994:case 1814695966:case 1812599299:var R=N=null;j=null;switch(E){case 1812599299:switch(this.tokAt(q+1)){case 1073741864:switch(this.tokAt(q+2)){case 134217750:case 1073741998:break;case 1073742330:P=B(-1,[a.objectNameParameter(q+
3),null]);if(this.chk)return;this.vwr.shm.getShapePropertyData(24,"points",P);e=P[1];null==e&&this.invArg();q+=2;default:P=!0,q++}break;case 10:case 1073742325:j=a.getAtomsStartingAt(q+1),q=a.iToken}break;case 1814695966:P&&this.invArg();O=!0;if(a.isArrayParameter(q+1)){var C=a.getPointArray(q+1,-1,!1,!0),q=a.iToken;this.chk||(Q=this.vwr.getSymTemp().getUnitCell(C,!1,null))}else switch(this.tokAt(q+1)){case 4:C=this.stringParameter(q+1).toLowerCase();q=a.iToken;C.startsWith("unitcell_")&&(C=this.vwr.getCurrentModelAuxInfo().get(C));
if(!this.chk&&0<C.length&&null!=(Q=this.vwr.getCurrentUnitCell()))Q=this.vwr.getSymTemp().getUnitCell(Q.getV0abc(C,null),!1,"draw");break;case 8:case 1073742332:R=a.getFractionalPoint(q+1),q=a.iToken}1073741994==this.tokAt(q+1)&&(1814695966==k&&(k=1073741994),++q,N=a.checkHKL(a.getPointOrPlane(++q,3)),q=a.iToken);1611272194==this.tokAt(q+1)&&(M=!0,null==Q&&null==R&&(R=JU.P3.new3(555,555,1)),q++)}if(this.chk)break;if(null!=j)P&&(Q=this.vwr.getSymTemp().getUnitCell(this.vwr.getOrientation(1814695966,
"array",j,null),!1,null));else if(P)Q=this.vwr.getSymTemp().getUnitCell(this.vwr.getOrientation(1814695966,"array",null,e),!1,null);else if(1814695966==E&&null==Q){if(null!=R){this.vwr.getModelkit(!1).drawUnitCell(m,R,G);return}Q=this.vwr.getCurrentUnitCell()}if(null==N){e=null;if(null==Q&&1073742330==this.tokAt(q+1)&&(++q,e=this.e.objectNameParameter(++q),q=this.e.iToken,null==e||this.chk))return;e=this.getBoxPoints(null!=Q?1814695966:E,Q,j,e,p/100);if(null==e)return}else{j=JU.Measure.getLatticePoints(Q.getLatticeCentering(),
x(N.x),x(N.y),x(N.z));e=Array(j.size());for(E=0;E<j.size();E++)e[E]=j.get(E),Q.toCartesian(e[E],!0)}P=!1;if(!v){F="polygon";j=new JU.Lst;j.addLast(e);if(null==N){this.vwr.getTriangulator();var z;switch(null==Q?7:Q.getPeriodicity()){case 1:z=JU.Triangulator.edgeA;break;case 2:z=JU.Triangulator.edgeB;break;case 4:z=JU.Triangulator.edgeC;break;case 3:z=JU.Triangulator.abFace;break;default:case 7:z=JU.Triangulator.fullCubePolygon}j.addLast(z)}else j.addLast(null);H=j;b=!0;p=0;K=!0;break}1073742335==this.tokAt(q+
1)&&(I=++q);break;case 1073741998:case 134219777:case 134217750:R=I==q-1;if(!b&&!v&&0==k){if(134219777==a.theTok){b=!0;this.setShapeProperty(22,"plane",null);E=new JU.Lst;a.hklParameter(++q,E,!0);q=a.iToken;F="coords";H=E;break}if(!P){F=134217750==E?"plane":"line";pa=q+1;break}!this.chk&&(1073741998!=E&&null==e)&&(Q=this.vwr.getCurrentUnitCell(),k=null==Q?1812599299:1814695966,e=this.getBoxPoints(k,Q,null,null,p/100),v=!0)}N=j=null;C=!1;switch(E){case 134217750:j=a.planeParameter(q,P);break;case 134219777:j=
a.hklParameter(++q,null,!0);1073742327==this.tokAt(a.iToken+1)&&(C=!0,a.iToken++);break;case 1073741998:1073741994==k&&this.invArg(),N=P?this.bsToArray(a.getAtomsStartingAt(++q)):a.isCenterParameter(q+1)?B(-1,[this.centerParameter(++q),this.centerParameter(a.iToken+1)]):a.getPointArray(++q,2,!1,!0),2>N.length&&this.invArg()}q=a.iToken;b=!0;if(this.chk)break;if(1073741998==E){N=JU.Measure.getBestLineThroughPoints(N,-1);if(0!=k&&(j=JU.V3.newVsub(N[1],N[0]),j.scale(1/j.length()),N=R?JU.Measure.getProjectedLineSegment(e,
-1,N[0],j,null):this.vwr.getTriangulator().intersectLine(e,-1,N[0],j),null==N||null==N[1]))return;c||(this.setShapeProperty(22,"points",Integer.$valueOf(p)),c=!0);E=new JU.Lst;E.addLast(N[0]);E.addLast(N[1]);this.setShapeProperty(22,"coords",E);break}0==k?(H=j,F="planedef"):(1073741994==k?(F="polygon",j=JU.Measure.getPointsOnPlane(e,j),e=j.toArray(Array(j.size())),j=new JU.Lst,j.addLast(e),j.addLast(null),H=j):(C&&1814695966==k&&J.api.Interface.getInterface("JU.BZone",this.vwr,"script").drawHKL(this.vwr,
m,j,e),F="polygon",H=this.vwr.getTriangulator().intersectPlane(j,e,R?-1:0)),p=0);break;case 1275068447:e=a.isArrayParameter(++q)?a.getPointArray(q,-1,!1,!0):null;null==e&&a.isAtomExpression(q)&&(j=a.atomExpressionAt(q),e=this.vwr.ms.getAtomPointVector(j).toArray(Array(j.cardinality())));null!=e&&(q=a.iToken+1,12289==this.tokAt(q)&&(fa=a.centerParameter(++q,null),q=a.iToken+1));switch(this.tokAt(q)){case 536875059:c="";break;case 1111490563:c="Cs";break;case 1073742330:P=B(-1,[a.objectNameParameter(++q),
null]);if(this.chk)return;this.vwr.shm.getShapePropertyData(21,"points",P);e=P[1];null==e&&this.invArg();c="";break;case 1275203608:c=":poly";break;case 134217764:null==fa&&(fa=new JU.P3);c=this.vwr.ms.generateCrystalClass(this.vwr.bsA().nextSetBit(0),JU.P3.new3(NaN,NaN,NaN));null!=e&&this.invArg();e=Array(c.size());for(E=c.size();0<=--E;)e[E]=c.get(E);q++;c="";break;default:c=a.optParameterAsString(q)}p=0==p?1:p/100;f=0;0<c.length&&this.isFloatParameter(++q)&&(f=this.intParameter(q++));536875059==
this.tokAt(q)&&(p=this.floatParameter(++q));this.chk||a.runScript(this.vwr.ms.getPointGroupAsString(this.vwr.bsA(),0<c.length?c:null,f,p,e,fa,null==m?"":m));return;case 4106:ra=s(4,0);La=4;b=a.floatParameterSet(++q,4,4);q=a.iToken;for(E=0;4>E;E++)ra[E]=x(b[E]);b=!0;break;case 1677721602:case 1153433601:if(null==ra||La>(1228931586==a.theTok?2:3))La=0,ra=s(-1,[-1,-1,-1,-1]);ra[La++]=this.atomExpressionAt(++q).nextSetBit(0);q=a.iToken;ra[La++]=1677721602==a.theTok?this.atomExpressionAt(++q).nextSetBit(0):
-1;q=a.iToken;b=!0;break;case 554176565:switch(this.getToken(++q).tok){case 1073742330:F="slab";H=a.objectNameParameter(++q);q=a.iToken;b=!0;break;default:this.invArg()}break;case 1275203608:case 134217751:case 1073742106:N=134217751==E;F="polygon";b=!0;j=new JU.Lst;var H=z=0,L=C=R=null;if(a.isArrayParameter(++q)){R=a.getPointArray(q,-1,!0,!0);if(0<R.length&&null==R[0]){1275203608==E?z=this.getIntArray2(q):(z=JU.AU.newInt2(1),z[0]=a.expandFloatArray(a.floatParameterSet(q,-1,2147483647),-1,!1));R=
this.getAllPoints(this.e.iToken+1,3);try{L=J.api.Interface.getInterface("JU.MeshCapper",this.vwr,"script").set(null).triangulateFaces(z,R,null)}catch($){this.invArg()}}z=R.length}1275203608==E&&(z=R.length);if(null==R){z=Math.max(0,this.intParameter(q));R=Array(z);for(E=0;E<z;E++)R[E]=this.centerParameter(++a.iToken)}q=a.iToken;switch(this.tokAt(q+1)){case 11:case 12:C=JS.SV.newT(this.getToken(++q)).toArray().getList();H=C.size();break;case 7:C=this.getToken(++q).getList();H=C.size();break;case 2:H=
this.intParameter(++q);0>H&&(N=!0);break;default:null==L&&(!N&&!this.chk)&&(L=J.api.Interface.getInterface("JU.MeshCapper",this.vwr,"script").set(null).triangulatePolygon(R,-1))}if(null==L&&!N){L=JU.AU.newInt2(H);for(E=0;E<H;E++)N=null==C?a.floatParameterSet(++a.iToken,3,4):JS.SV.flistValue(C.get(E),0),(3>N.length||4<N.length)&&this.invArg(),L[E]=s(-1,[x(N[0]),x(N[1]),x(N[2]),3==N.length?7:x(N[3])])}0<z?(j.addLast(R),j.addLast(L)):j=null;H=j;q=a.iToken;break;case 134217764:case 1296041986:case 1296041985:e=
null;c=2147483647;v=f=null;S=0;k=d=null;g=1296041986==E;n=1296041985==E;W=-1;w=B(-1,[null,this.vwr.getVisibleFrameAtomsNoSplitData()]);ra=!1;if(g||n)switch(c=0,this.tokAt(++q)){case 4:e=this.stringParameter(q);break;case 12:e=this.vwr.getSymStatic().convertTransform("xyz",this.getToken(q).value);break;default:if(!a.isCenterParameter(q))if(a.isArrayParameter(q)){q=a.floatParameterSet(q,1,2147483647);k=s(q.length,0);for(E=k.length;0<=--E;)k[E]=x(q[E]);q=a.iToken+1}else c=this.intParameter(q++),a.isArrayParameter(q)&&
(d=JU.P3.newA(a.floatParameterSet(q,3,3)),q=a.iToken+1);a.isCenterParameter(q)&&(fa=a.centerParameter(q,w));null==k&&a.isCenterParameter(a.iToken+1)&&(f=a.centerParameter(++a.iToken,w));if(this.chk)return;q=a.iToken;ra=!0}else 1073742327==this.tokAt(q+1)?(W=-2,a.iToken=++q):ra=!0;ra&&(null==fa&&a.isCenterParameter(q+1)&&(fa=this.centerParameter(++q),v=a.isAtomExpression(q)?this.atomExpressionAt(q):null,q=a.iToken),W=(!g&&!n&&null!=fa||null!=f)&&2==this.tokAt(q+1)?a.getToken(++q).intValue:-1,-1>W&&
this.invArg(),g?1814695966==this.tokAt(q+1)?(f=new JU.P3,S=1073742066,a.iToken=++q):1073742066==this.tokAt(q+1)&&(q++,f=this.getPoint3f(q+1,!1),S=1073742066,q=a.iToken):n&&(S=1296041985));if((g||n)&&null!=e)q++,a.isCenterParameter(q)&&(fa=a.centerParameter(q,w));a.checkLast(a.iToken);if(this.chk)return;q="";w=null!=v?v.nextSetBit(0):-1;null==v&&0<=this.vwr.am.cmi&&(v=this.vwr.getModelUndeletedAtomsBitSet(this.vwr.am.cmi));if(null!=v){q=this.vwr.getModelkit(!1).drawSymmetry(m,g,w,e,c,d,fa,f,p,W,S,
k,!1);if(null==q)return;if((g||n)&&Y(f,"JM.Atom")&&Y(fa,"JM.Atom"))0<=a.fullCommand.indexOf("#quiet")&&(q=JU.PT.rep(q,"print","#print")),q+="\nmodelkit set atomset "+JU.PT.esc(m+"|"+fa.i+"|"+f.i+"|"+a.fullCommand)+";"}a.runBufferedSafely(0<q.length?q:'draw ID "'+m+'*" delete',a.outputBuffer);return;case 4115:S=!0;continue;case 1073742332:case 9:case 8:if(9==a.theTok||!a.isPoint3f(q)){H=a.getPoint4f(q);if(S){a.checkLast(a.iToken);this.chk||a.runScript(JU.Escape.drawQuat(JU.Quat.newP4(H),null==m?"frame":
m," "+G,null==fa?new JU.P3:fa,p/100));return}F="planedef"}else H=fa=this.getPoint3f(q,!0),F="coord";q=a.iToken;b=!0;break;case 1073742E3:F="lineData";H=a.floatParameterSet(++q,0,2147483647);q=a.iToken;b=!0;break;case 12290:case 10:case 1073742325:F="atomSet";H=this.atomExpressionAt(q);S&&(fa=this.centerParameter(q));q=a.iToken;b=!0;break;case 7:b=!0;F=pa==q?"coords":"modelBasedPoints";H=a.theToken.value;break;case 1073742195:case 268436992:break;case 268437504:H=a.xypParameter(q);if(null!=H){q=a.iToken;
F="coord";b=!0;break}f&&this.invArg();f=!0;break;case 268437505:f||this.invArg();f=!1;break;case 1140850693:F="reverse";break;case 1073742166:if(1765808134==this.tokAt(++q)){H=Integer.$valueOf(this.e.getArgbParamOrNone(++q,!1));F="titlecolor";q=this.e.iToken;break}if(4114==this.tokAt(q)){--q;continue}case 4:H=this.stringParameter(q);F="title";break;case 545259562:H=this.stringParameter(++q);F="hoverlabel";break;case 4114:E=this.floatParameter(++q);H=1073741824==this.tokAt(q+1)?this.paramAsStr(++q):
null;j=1073741824==this.tokAt(q+1)?this.paramAsStr(++q):null;(4!=this.tokAt(q+1)&&++q!=this.slen||0>=E||255<E)&&this.invArg();F="myfont";if(null==H||null==j)N=this.vwr.shm.getShapePropertyIndex(22,"font",-1),null==H&&(H=N.fontFace),null==j&&(j=N.fontStyle);H=this.vwr.getFont3D(H,j,E);break;case 135198:F="vector";break;case 1275068435:H=Float.$valueOf(this.floatParameter(++q));F="length";break;case 3:H=Float.$valueOf(this.floatParameter(q));F="length";break;case 1094717454:F="imodel";H=Integer.$valueOf(this.intParameter(++q));
d=q;break;case 1094713359:F="modelIndex";H=Integer.$valueOf(this.intParameter(++q));break;case 2:f?(F="modelIndex",H=Integer.$valueOf(this.intParameter(q))):p=this.intParameter(q);break;case 536875059:p=Math.round(this.floatParameter(++q)*(2==this.getToken(q).tok?1:100));continue;case 1073741974:m=this.setShapeId(22,++q,j);w=null==this.getShapeProperty(22,"ID");q=a.iToken;break;case 1073742027:F="fixed";H=Boolean.FALSE;break;case 12293:F="fixed";H=Boolean.TRUE;break;case 1073742066:E=this.getPoint3f(++q,
!0);q=a.iToken;F="offset";H=E;break;case 1073741906:F="crossed";break;case 1073742196:H=Float.$valueOf(this.floatParameter(++q));F="width";G=F+" "+H;break;case 1073741908:F="curve";pa=q+1;break;case 1073741840:F="arc";pa=q+1;break;case 1073741846:F="arrow";pa=q+1;break;case 1073742194:F="vertices";pa=q+1;break;case 1073741880:F="circle";break;case 1073741912:F="cylinder";break;case 1073742048:F="nohead";break;case 1073741860:F="isbarb";break;case 1073742130:F="rotate45";break;case 1073742092:F="perp";
break;case 1665140738:case 1073741917:G=1665140738==a.theTok;N=this.floatParameter(++q);G&&(N*=2);H=Float.$valueOf(N);F=G||3==this.tokAt(q)?"width":"diameter";G=F+(3==this.tokAt(q)?" "+N:" "+x(N));break;case 1073742330:if(268437504==this.tokAt(q+2)||S){b=fa=this.centerParameter(q);q=a.iToken;F="coord";H=b;b=!0;break}H=a.objectNameParameter(++q);F="identifier";b=!0;break;case 1765808134:case 1111490588:case 1073742074:j=!0;g=this.getColorTrans(a,q,!1,n);q=a.iToken;continue;default:if(!a.setMeshDisplayProperty(22,
0,a.theTok)){if(268441089==a.theTok||JS.T.tokAttr(a.theTok,1073741824)){m=this.setShapeId(22,q,j);q=a.iToken;break}this.invArg()}0==W&&(W=q);q=a.iToken;continue}j=12291!=a.theTok&&(2<q||q>d);b&&(!c&&!S)&&(this.setShapeProperty(22,"points",Integer.$valueOf(p)),c=!0,p=0);b&&w&&this.invArg();if(null!=F){if(""===G){E=0;switch(F){case "vector":E=0.1;break;case "line":E=0.05}0!=E&&(G="width "+E,this.setShapeProperty(22,"width",Float.$valueOf(E)))}this.setShapeProperty(22,F,H)}}K&&(W=-1-W);this.chk||(this.finalizeObject(22,
n[0],g,p,b,ra,W,null),O&&(null==m&&(P=Array(1),this.vwr.shm.getShapePropertyData(22,"id",P),m=P[0],E=m.indexOf("_"),0<=E&&(m=m.substring(0,E))),this.vwr.getModelkit(!1).drawAxes(e,m,M?G:"delete")))});e(d,"mo",function(a,b){var c=this.e,f=2147483647,v=!1,d=null,h=this.vwr.getVisibleFramesBitSet(),e=new JU.Lst,u=!1,k=1073877011==this.tokAt(0),g=1;if(k){var n=this.e.optParameterAsString(1).equals("view");if(1==this.e.slen||n||this.e.optParameterAsString(1).equals("options")){this.chk||(c=n?"VIEW":this.e.optParameterAsString(2),
this.vwr.plugin("NBO","start",c));return}}if(1094717454==this.tokAt(1)||4115==this.tokAt(1))g=c.modelNumberParameter(2),0>g&&this.invArg(),h.clearAll(),h.set(g),g=3;c.sm.loadShape(b);for(n=h.nextSetBit(0);0<=n;n=h.nextSetBit(n+1)){var p=g;if(1073742001==this.tokAt(p)&&this.listIsosurface(b))break;this.setShapeProperty(b,"init",Integer.$valueOf(n));if(a)break;var G=null,W=this.getShapeProperty(b,"moNumber").intValue(),m=this.getShapeProperty(b,"moLinearCombination"),s=this.getShapeProperty(b,"moSquareData"),
B=null==m?null:this.getShapeProperty(b,"moSquareLinear");0==W&&(W=2147483647);var x=null,C=null,z=!1,I=null,P=null;switch(this.getToken(p).tok){case 1275082241:x="select";P=this.atomExpressionAt(++p);JU.BSUtil.andNot(P,this.vwr.slm.bsDeleted);C=P;break;case 1140850696:if(1073877010==b){this.mo(a,28);return}d=this.paramAsStr(++p).toUpperCase();4==c.tokAt(p+1)&&(I=this.paramAsStr(++c.iToken));break;case 1073741875:case 554176565:x=c.theToken.value;C=this.getCapSlabObject(p,!1);break;case 1073741914:B=
Boolean.TRUE;m=w(-1,[1]);f=W=0;break;case 2:W=this.intParameter(p);1073741865==this.tokAt(p+1)&&(u=!0);m=this.moCombo(e);null==m&&0>W&&(m=w(-1,[-100,-W]));z=!0;break;case 268440576:switch(this.tokAt(++p)){case 1073741973:case 1073742008:break;default:this.invArg()}v=!0;case 1073741973:case 1073742008:2147483647==(f=this.moOffset(p))&&this.invArg();W=0;m=this.moCombo(e);z=!0;break;case 1073742037:W=1073742037;u=!1;m=this.moCombo(e);z=!0;break;case 1073742108:W=1073742108;u=!1;m=this.moCombo(e);z=!0;
break;case 1765808134:this.setColorOptions(null,p+1,b,2);break;case 134217750:x="plane";C=1073742333==this.tokAt(this.e.iToken=++p)?null:c.planeParameter(p,!1);break;case 134217751:this.addShapeProperty(e,"randomSeed",2==this.tokAt(p+2)?Integer.$valueOf(this.intParameter(p+2)):null);x="monteCarloCount";C=Integer.$valueOf(this.intParameter(p+1));break;case 536875059:x="scale";C=Float.$valueOf(this.floatParameter(p+1));break;case 1073741910:268440577==this.tokAt(p+1)?(x="cutoffPositive",C=Float.$valueOf(this.floatParameter(p+
2))):(x="cutoff",C=Float.$valueOf(this.floatParameter(p+1)));break;case 536870916:x="debug";break;case 1073742054:x="plane";break;case 1073742104:case 1073742122:x="resolution";C=Float.$valueOf(this.floatParameter(p+1));break;case 1073742156:null==m?s=Boolean.TRUE:B=Boolean.TRUE;z=!1;break;case 1073742168:p+1<this.slen&&4==this.tokAt(p+1)&&(x="titleFormat",C=this.paramAsStr(p+1));break;case 1073741824:this.invArg();break;case 4:if(k&&1==p){I=c.stringParameter(p);break}default:k&&4==c.tokAt(p)&&(I=
this.paramAsStr(p++));if(c.isArrayParameter(p)){m=c.floatParameterSet(p,1,2147483647);1073742156==this.tokAt(c.iToken+1)&&(z=!1,B=Boolean.TRUE,c.iToken++);break}f=c.iToken;c.setMeshDisplayProperty(b,0,c.theTok)||this.invArg();this.setShapeProperty(b,"setProperties",e);c.setMeshDisplayProperty(b,f,this.tokAt(f));return}null!=x&&this.addShapeProperty(e,x,C);p=2147483647!=W||null!=m;if(this.chk)break;if(null!=d||null!=I||p){p&&4==this.tokAt(c.iToken+1)&&(G=this.paramAsStr(++c.iToken));c.setCursorWait(!0);
if(null!=d||null!=I)d=d+":"+I;this.setMoData(e,W,m,f,v,n,G,d,u);p&&this.addShapeProperty(e,"finalize",null)}null==P&&null!=this.vwr.slm.bsDeleted&&(P=this.vwr.bsA(),this.addShapeProperty(e,"select",P));z||(this.setShapeProperty(b,"squareLinear",B),this.setShapeProperty(b,"squareData",s));0<e.size()&&this.setShapeProperty(b,"setProperties",e);p&&!c.tQuiet&&(G="",k?G=this.getShapeProperty(b,"moLabel"):(W=this.getShapeProperty(b,"moNumber").intValue(),G=""+W),this.showString(JS.T.nameOf(this.tokAt(0))+
" "+G+" "+(u?"beta ":"")+this.getShapeProperty(b,"message")));e.clear()}},"~B,~N");e(d,"setNBOType",function(a,b){var c=-1,f=null,v=b.indexOf(":");0<v&&(f=b.substring(v+1),b=b.substring(0,v),b.equals("null")&&(b=null),f.equals("null")&&(f=null));0>(null==b?0:JV.JC.getNBOTypeFromName(b))&&this.invArg();a.containsKey("nboLabels")||this.error(27);if(this.chk)return-1;null!=b&&!J.api.Interface.getInterface("J.adapter.readers.quantum.GenNBOReader",this.vwr,"script").readNBOCoefficients(a,b,this.vwr)&&
this.error(27);var v=a.get("auxFiles"),d=this.vwr.getCurrentModelAuxInfo().get("auxFiles");null==d?this.vwr.getCurrentModelAuxInfo().put("auxFiles",v):d.addAll(v);if(null!=f){v=f.indexOf(".");0<v&&(d=JU.PT.parseInt(f.substring(v+1)),f=f.substring(0,v),v=d);for(var d=a.get("nboLabels"),h=0,e=d.length;h<e;h++)if(f.equals(d[h])&&(0>v||0==--v)){c=h+1;break}0>c&&this.error(27)}return c},"java.util.Map,~S");e(d,"moCombo",function(a){if(1073742156!=this.tokAt(this.e.iToken+1))return null;this.addShapeProperty(a,
"squareLinear",Boolean.TRUE);this.e.iToken++;return w(0,0)},"JU.Lst");e(d,"moOffset",function(a){var b=1073741973==this.getToken(a).tok?0:1,c=this.tokAt(++a);2==c&&"-"==this.e.st[a].value.charAt(0)?b+=this.intParameter(a):268440577==c?b+=this.intParameter(++a):268440576==c&&(b-=this.intParameter(++a));return b},"~N");e(d,"setMoData",function(a,b,c,f,v,d,h,e,u){var k=this.e;0>d&&(d=this.vwr.am.cmi,0>d&&k.errorStr(30,"MO isosurfaces"));var g=this.vwr.ms.getInfo(d,"moData");null==g&&this.error(27);this.vwr.checkMenuUpdate();
if(null!=e){var n=this.setNBOType(g,e),p=g.get("nboLabels").length;k.showString(p+" orbitals of type "+e.substring(0,e.indexOf(":")+1)+" modelIndex="+this.vwr.getModelNumberDotted(d));0<n&&(b=n);if(null==c&&2147483647==b)return}e=null;n=0;d=null;if(null==c||2>c.length){null!=c&&1==c.length?f=0:u&&g.containsKey("firstBeta")&&(f=g.get("firstBeta").intValue());e=g.containsKey("lastMoNumber")?g.get("lastMoNumber").intValue():0;n=g.containsKey("lastMoCount")?g.get("lastMoCount").intValue():1;1073742108==
b?b=e-1:1073742037==b&&(b=e+n);e=g.get("mos");n=null==e?0:e.size();0==n&&this.error(25);1==n&&1<b&&this.error(29);if(2147483647!=f){if(!u)if(g.containsKey("HOMO"))b=g.get("HOMO").intValue()+f,f=0;else{b=n;for(u=0;u<n;u++)if(p=e.get(u),null!=(d=p.get("occupancy"))){if(0.5>d.floatValue()){b=u;break}}else if(null!=(d=p.get("energy"))){if(0<d.floatValue()){b=u;break}}else break;null==d&&this.error(28)}b+=f;this.chk||JU.Logger.info("MO "+b)}(1>b||b>n)&&k.errorStr(26,""+n)}b=Math.abs(b);g.put("lastMoNumber",
Integer.$valueOf(b));g.put("lastMoCount",Integer.$valueOf(1));v&&null==c&&(c=w(-1,[-100,b]));if(null!=c&&2>c.length){p=e.get(b-1);if(null==(d=p.get("energy")))c=w(-1,[100,b]);else{k=d.floatValue();f=JU.BS.newN(n);v=0;c=1==c.length&&1==c[0];for(u=0;u<n;u++)if(null!=(d=e.get(u).get("energy")))if(d=d.floatValue(),c?d<=k:d==k)f.set(u+1),v+=2;c=w(v,0);for(k=u=0;u<v;u+=2)c[u]=1,c[u+1]=k=f.nextSetBit(k+1);g.put("lastMoNumber",Integer.$valueOf(f.nextSetBit(0)));g.put("lastMoCount",Integer.$valueOf(M(v/2)))}this.addShapeProperty(a,
"squareLinear",Boolean.TRUE)}this.addShapeProperty(a,"moData",g);null!=h&&this.addShapeProperty(a,"title",h);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(d,"isosurface",function(a){var b=this.e;b.sm.loadShape(a);if(!(1073742001==this.tokAt(1)&&this.listIsosurface(a))){var c=0,f=null,v=!1,d=!1,h=24==a,e=29==a,u=30==a,g=26==a,r=g||12291==this.tokAt(1)||b.$isStateScript,n=!1,p=!1,G=!1,W=
!1,m=!1,C=!1,z=!1,L=!1,O=!1,pa=!1,I=!1,P=!1,K=!1,Z=!1,ea=!1,E=!1,N=null,Q=null,q=null,F,H,R,da,ia,va=NaN,sa=NaN,wa=0,Ca=null,na=2147483647,V=null,X=null,ga=null,t=new JU.SB,T,oa=null,za=null,Ia=!1,ba=null,ta=0,ka=null,aa=this.chk?0:-2147483648;b.setCursorWait(!0);var Aa=null!=this.initIsosurface(a),kb=Aa&&null==this.getShapeProperty(a,"ID"),Ja=!1,lb=!1,Ma=!1,Ka=!1,Na=null,mb=null,Db=null,nb=null,qa=null,ob=null,Ga=null,Oa=null,D=new JU.Lst,Eb=!1;(e||u)&&this.addShapeProperty(D,"fileType","Pmesh");
for(var l=b.iToken;l<this.slen;++l){var A=null,y=null,U=this.getToken(l).tok;1073741824==U&&(ka=this.paramAsStr(l),ka.equalsIgnoreCase("map")&&(U=4125));switch(U){case 1073742148:r=!0;t.append(" silent");A="silent";break;case 603979867:Ca=1073742335==this.getToken(++l).tok?Boolean.TRUE:1073742334==b.theTok?Boolean.FALSE:null;null==Ca&&this.invArg();continue;case 553648146:na=this.intParameter(++l);continue;case 4128:A="moveIsosurface";12!=this.tokAt(++l)&&this.invArg();y=this.getToken(l++).value;
break;case 1296041986:for(var Fb=this.floatArraySet(l+2,this.intParameter(l+1),16),Ga=Array(Fb.length),ca=Ga.length;0<=--ca;)Ga[ca]=JU.M4.newA16(Fb[ca]);l=b.iToken;break;case 1088421903:0>aa&&(aa=Math.min(this.vwr.am.cmi,0));var Gb=null==ga;null==X&&(X=JU.BSUtil.andNot(JU.BSUtil.copy(this.vwr.bsA()),this.vwr.slm.bsDeleted));X.and(this.vwr.ms.getAtoms(1296041986,Integer.$valueOf(1)));Gb||X.andNot(ga);this.addShapeProperty(D,"select",X);Gb&&(ga=JU.BSUtil.copy(X),JU.BSUtil.invertInPlace(ga,this.vwr.ms.ac),
E=!0,this.addShapeProperty(D,"ignore",ga),t.append(" ignore ").append(JU.Escape.eBS(ga)));t.append(" symmetry");0==ta&&this.addShapeProperty(D,"colorRGB",Integer.$valueOf(1296041986));Ga=this.vwr.ms.getSymMatrices(aa);break;case 1073742066:A="offset";y=this.centerParameter(++l);l=b.iToken;break;case 528432:A="rotate";y=1073742333==this.tokAt(b.iToken=++l)?null:b.getPoint4f(l);l=b.iToken;break;case 1610612740:A="scale3d";y=Float.$valueOf(this.floatParameter(++l));break;case 1073742090:t.append(" periodic");
A="periodic";break;case 1073742078:case 266298:case 134217751:A=b.theToken.value.toString();t.append(" ").appendO(b.theToken.value);y=this.centerParameter(++l);t.append(" ").append(JU.Escape.eP(y));l=b.iToken;break;case 1812599299:if(0<=b.fullCommand.indexOf("# BBOX="))var Hb=JU.PT.split(JU.PT.getQuotedAttribute(b.fullCommand,"# BBOX"),","),ba=B(-1,[JU.Escape.uP(Hb[0]),JU.Escape.uP(Hb[1])]);else b.isCenterParameter(l+1)?(ba=B(-1,[this.getPoint3f(l+1,!0),this.getPoint3f(b.iToken+1,!0)]),l=b.iToken):
ba=this.vwr.ms.getBBoxVertices();t.append(" boundBox "+JU.Escape.eP(ba[0])+" "+JU.Escape.eP(ba[ba.length-1]));A="boundingBox";y=ba;break;case 135188:e=!0;t.append(" pmesh");A="fileType";y="Pmesh";break;case 134217763:X=JU.BSUtil.andNot(this.atomExpressionAt(++l),this.vwr.slm.bsDeleted);this.chk?V=new JU.BS:1073742325==this.tokAt(b.iToken+1)||10==this.tokAt(b.iToken+1)?(V=JU.BSUtil.andNot(this.atomExpressionAt(++b.iToken),this.vwr.slm.bsDeleted),V.and(this.vwr.ms.getAtomsWithinRadius(5,X,!1,null,null))):
(V=this.vwr.ms.getAtomsWithinRadius(5,X,!0,null,null),V.andNot(this.vwr.ms.getAtoms(1094713360,X)));V.andNot(X);t.append(" intersection ").append(JU.Escape.eBS(X)).append(" ").append(JU.Escape.eBS(V));l=b.iToken;if(134320141==this.tokAt(l+1)){l++;var Pa=this.getToken(++l).value;t.append(" function ").append(JU.PT.esc(Pa));this.chk||this.addShapeProperty(D,"func",Pa.equals("a+b")||Pa.equals("a-b")?Pa:this.createFunction("__iso__","a,b",Pa))}else ea=!0;A="intersection";y=B(-1,[X,V]);break;case 1610625028:case 134217759:if(v=
1610625028==U){t.append(" display");c=l;U=this.tokAt(l+1);if(0==U)continue;l++;this.addShapeProperty(D,"token",Integer.$valueOf(1073742335));if(10==U||1073742327==U){A="bsDisplay";1073742327==U?t.append(" all"):(y=this.st[l].value,t.append(" ").append(JU.Escape.eBS(y)));b.checkLast(l);break}else 134217759!=U&&(b.iToken=l,this.invArg())}else wa=l;var Ya,Da=null,V=null,Za=Array(1);1073742325==this.tokAt(l+1)?(Ya=this.floatParameter(l+3),b.isPoint3f(l+4)?(Da=b.centerParameter(l+4,null),b.iToken+=2):
b.isPoint3f(l+5)?(Da=b.centerParameter(l+5,null),b.iToken+=2):(V=b.atomExpression(this.st,l+5,this.slen,!0,!1,Za,!0),null==V&&this.invArg())):(Ya=this.floatParameter(++l),Da=b.centerParameter(++l,Za),V=Y(Za[0],"JU.BS")?Za[0]:null);v&&b.checkLast(b.iToken);l=b.iToken;0<=b.fullCommand.indexOf("# WITHIN=")&&(V=JU.BS.unescape(JU.PT.getQuotedAttribute(b.fullCommand,"# WITHIN")));this.chk||(null!=V&&0<=aa&&(V=this.vwr.restrictToModel(V,aa)),null==Da&&(Da=null==V?new JU.P3:this.vwr.ms.getAtomSetCenter(V)),
ba=this.getWithinDistanceVector(D,Ya,Da,V,v),t.append(" within ").appendF(Ya).append(" ").append(null==V?JU.Escape.eP(Da):JU.Escape.eBS(V)));continue;case 1073742083:var A="parameters",Ib=b.floatParameterSet(++l,1,10),l=b.iToken,y=Ib;t.append(" parameters ").append(JU.Escape.eAF(Ib));break;case 1715472409:case 1073742190:var Na=b.theToken.value,ib=1073742190==U,Qa=this.tokAt(l+1);null==ob?(!n&&(!G&&!p)&&(this.addShapeProperty(D,"sasurface",Float.$valueOf(0)),t.append(" vdw"),n=!0),A="property",null==
Ca&&(Ca=JS.T.tokAttr(Qa,1111490560)&&1==this.vwr.getIsosurfacePropertySmoothing(!1)?Boolean.TRUE:Boolean.FALSE),this.addShapeProperty(D,"propertySmoothing",Ca),t.append(" isosurfacePropertySmoothing "+Ca),Ca===Boolean.TRUE&&(2147483647==na&&(na=this.vwr.getIsosurfacePropertySmoothing(!0)),this.addShapeProperty(D,"propertySmoothingPower",Integer.$valueOf(na)),t.append(" isosurfacePropertySmoothingPower "+na)),this.vwr.g.rangeSelected&&this.addShapeProperty(D,"rangeSelected",Boolean.TRUE)):A=ob;ka=
this.paramAsStr(l);t.append(" ").append(ka);if(0==ka.toLowerCase().indexOf("property_")){Q=w(this.vwr.ms.ac,0);if(this.chk)continue;Q=this.vwr.getDataObj(ka,null,1);null==Q&&this.invArg();this.addShapeProperty(D,A,Q);continue}var Ra=this.vwr.ms.ac,Q=w(Ra,0);if(ib){var Jb=this.paramAsStr(++l);0==Jb.length?Q=b.floatParameterSet(l,Ra,Ra):(Q=w(Ra,0),this.chk||JU.Parser.parseStringInfestedFloatArray(""+b.getParameter(Jb,4,!0),null,Q));this.chk||t.append(' "" ').append(JU.Escape.eAF(Q))}else{this.getToken(++l);
if(!this.chk){t.append(" "+b.theToken.value);var jb=this.vwr.ms.at;this.vwr.autoCalculate(Qa,null);if(1765808134!=Qa){T=new JU.P3;for(var pb=Ra;0<=--pb;)Q[pb]=jb[pb].atomPropertyFloat(this.vwr,Qa,T)}}1765808134==Qa&&(qa="inherit");if(134217759==this.tokAt(l+1)){var Kb=this.floatParameter(l+=2);t.append(" within "+Kb);this.addShapeProperty(D,"propertyDistanceMax",Float.$valueOf(Kb))}}y=Q;break;case 1094713359:case 1094717454:n&&this.invArg();aa=1094713359==U?this.intParameter(++l):b.modelNumberParameter(++l);
t.append(" modelIndex "+aa);if(0>aa){A="fixed";y=Boolean.TRUE;break}A="modelIndex";y=Integer.$valueOf(aa);break;case 1275082241:var A="select",$a=this.atomExpressionAt(++l);JU.BSUtil.andNot($a,this.vwr.slm.bsDeleted);y=$a;l=b.iToken;1073742072==this.tokAt(l+1)&&(l++,ga=JU.BSUtil.copy($a),JU.BSUtil.invertInPlace(ga,this.vwr.ms.ac),this.addShapeProperty(D,"ignore",ga),t.append(" ignore ").append(JU.Escape.eBS(ga)),E=!0);n||G?t.append(" select "+JU.Escape.eBS($a)):(X=JU.BSUtil.andNot(y,this.vwr.slm.bsDeleted),
0>aa&&0<=X.nextSetBit(0)&&(aa=this.vwr.ms.at[X.nextSetBit(0)].mi));break;case 2109448:q=10==b.getToken(++l).tok?b.theToken.value:b.expandFloatArray(b.floatParameterSet(l,1,2147483647),1,!0);l=b.iToken;break;case 36867:var Lb=this.intParameter(++l),q=0<Lb?JU.BSUtil.newAndSetBit(Lb-1):new JU.BS;break;case 12289:A="center";y=this.centerParameter(++l);t.append(" center "+JU.Escape.eP(y));l=b.iToken;break;case 1073742147:case 1765808134:Aa=!0;if(1073742147==U)Ma=!0,t.append(" sign"),this.addShapeProperty(D,
"sign",Boolean.TRUE);else{if(1073741914==this.tokAt(l+1)){l++;A="colorDensity";t.append(" color density");Ka=!0;if(this.isFloatParameter(l+1)){var Mb=this.floatParameter(++l);t.append(" "+Mb);y=Float.$valueOf(Mb)}break}if(4==this.getToken(l+1).tok)qa=this.paramAsStr(++l),0<qa.indexOf(" ")&&(Oa=JU.C.getColixArray(qa),null==Oa&&this.error(4));else if(1073742018==b.theTok){l++;t.append(" color mesh");ta=b.getArgbParam(++l);this.addShapeProperty(D,"meshcolor",Integer.$valueOf(ta));t.append(" ").append(JU.Escape.escapeColor(ta));
l=b.iToken;continue}if(1111490588==(b.theTok=this.tokAt(l+1))||1073742074==b.theTok){t.append(" color");nb=this.setColorOptions(t,l+1,24,-2);l=b.iToken;continue}switch(this.tokAt(l+1)){case 1073741826:case 1073742114:this.getToken(++l);t.append(" color range");this.addShapeProperty(D,"rangeAll",null);if(1073742327==this.tokAt(l+1)){l++;t.append(" all");continue}var Nb=this.floatParameter(++l),Ob=this.floatParameter(++l);this.addShapeProperty(D,"red",Float.$valueOf(Nb));this.addShapeProperty(D,"blue",
Float.$valueOf(Ob));t.append(" ").appendF(Nb).append(" ").appendF(Ob);continue}if(b.isColorParam(l+1)&&(ta=b.getArgbParam(l+1),1073742170==this.tokAt(l+2))){qa=b.getColorRange(l+1);l=b.iToken;break}t.append(" color")}b.isColorParam(l+1)?(ta=b.getArgbParam(++l),t.append(" ").append(JU.Escape.escapeColor(ta)),l=b.iToken,this.addShapeProperty(D,"colorRGB",Integer.$valueOf(ta)),Aa=!0,b.isColorParam(l+1)?(ta=b.getArgbParam(++l),l=b.iToken,this.addShapeProperty(D,"colorRGB",Integer.$valueOf(ta)),t.append(" ").append(JU.Escape.escapeColor(ta)),
W=!0):Ma&&this.invPO()):!Ma&&(null==Oa&&null==qa)&&this.invPO();continue;case 134221829:h||this.invArg();I=!this.chk;1073742327==this.tokAt(l+1)&&(this.checkLength(l+2),P=!0,l++);continue;case 134221834:102409!=this.tokAt(l+3)&&this.invArg();this.chk||(f="cache://"+this.stringParameter(l+1),Db=this.getToken(l+2).value.toString(),this.vwr.cachePut(f,Db));l+=2;continue;case 1228935687:4!=this.tokAt(l+1)&&this.invPO();continue;case 1111492618:case 1648363544:t.append(" ").appendO(b.theToken.value);var Sa=
b.encodeRadiusParameter(l,!1,!0);if(null==Sa)return;t.append(" ").appendO(Sa);Float.isNaN(Sa.value)&&(Sa.value=100);y=Sa;A="radius";pa=!0;G&&(n=!1);l=b.iToken;break;case 1073741864:d=!0;continue;case 134217750:p=!0;A="plane";y=b.planeParameter(l,d);l=b.iToken;t.append(" plane ").append(JU.Escape.eP4(y));break;case 536875059:A="scale";y=Float.$valueOf(this.floatParameter(++l));t.append(" scale ").appendO(y);break;case 1073742327:Aa&&this.invArg();A="thisID";break;case 1112150020:n=!0;++l;y=b.getPoint4f(l);
A="ellipsoid";l=b.iToken;t.append(" ellipsoid ").append(JU.Escape.eP4(y));break;case 134219777:p=!0;A="plane";y=b.hklParameter(++l,null,!0);l=b.iToken;t.append(" plane ").append(JU.Escape.eP4(y));break;case 135182:var n=!0,ab=this.paramAsStr(++l);this.addShapeProperty(D,"lcaoType",ab);t.append(" lcaocartoon ").append(JU.PT.esc(ab));switch(this.getToken(++l).tok){case 12290:case 10:case 1073742325:A="lcaoCartoon";V=this.atomExpressionAt(l);l=b.iToken;if(this.chk)continue;var Ta=V.nextSetBit(0);0>Ta&&
this.error(14);t.append(" ({").appendI(Ta).append("})");aa=this.vwr.ms.at[Ta].mi;this.addShapeProperty(D,"modelIndex",Integer.$valueOf(aa));var qb=B(-1,[new JU.V3,new JU.V3,JU.V3.newV(this.vwr.ms.at[Ta]),new JU.V3]);if(!ab.equalsIgnoreCase("s")&&null==this.vwr.getHybridizationAndAxes(Ta,qb[0],qb[1],ab))return;y=qb;break;default:this.error(14)}break;case 1073877011:N=this.paramAsStr(++l).toUpperCase(),t.append(" nbo ").append(N).append(" ");case 1073877010:null==N&&t.append(" mo ");var Ua=2147483647,
Ha=2147483647,rb=268440576==this.tokAt(l+1);rb&&l++;var Va=null;switch(this.tokAt(++l)){case 0:b.bad();break;case 1073741914:t.append("[1] squared ");this.addShapeProperty(D,"squareLinear",Boolean.TRUE);Va=w(-1,[1]);Ha=Ua=0;l++;break;case 1073741973:case 1073742008:Ha=this.moOffset(l);Ua=0;l=b.iToken;t.append((rb?"-":"")+"HOMO ");0<Ha&&t.append("+");0!=Ha&&t.appendI(Ha);break;case 2:Ua=this.intParameter(l);t.appendI(Ua);1073741865==this.tokAt(l+1)&&(L=!0,l++);break;default:b.isArrayParameter(l)&&
(Va=b.floatParameterSet(l,1,2147483647),l=b.iToken)}if(1073742156==this.tokAt(l+1))this.addShapeProperty(D,"squareLinear",Boolean.TRUE),t.append(" squared"),null==Va&&(Va=w(0,0));else if(134217751==this.tokAt(l+1)){++l;var Pb=this.intParameter(++l),Qb=2==this.tokAt(l+1)?this.intParameter(++l):-System.currentTimeMillis()%1E4;this.addShapeProperty(D,"monteCarloCount",Integer.$valueOf(Pb));this.addShapeProperty(D,"randomSeed",Integer.$valueOf(Qb));t.append(" points ").appendI(Pb).appendC(" ").appendI(Qb)}this.setMoData(D,
Ua,Va,Ha,rb,aa,null,N,L);n=!0;continue;case 1073742036:A="nci";t.append(" "+A);var U=this.tokAt(l+1),Rb=1228935687!=U&&4!=U&&1073742032!=U,y=Boolean.$valueOf(Rb);Rb&&(n=!0);break;case 1073742016:case 1073742022:var Sb=1073742016==U,A=Sb?"mep":"mlp";t.append(" "+A);var bb=null,sb=-1,n=!0;2==this.tokAt(l+1)&&(sb=this.intParameter(++l),t.append(" "+sb),this.addShapeProperty(D,"mepCalcType",Integer.$valueOf(sb)));if(4==this.tokAt(l+1))bb=this.stringParameter(++l),t.append(" /*file*/"+JU.PT.esc(bb));else if(1715472409==
this.tokAt(l+1)){ob=A;continue}if(!this.chk)try{Q=null==bb&&Sb?this.vwr.getOrCalcPartialCharges(X,ga):this.getAtomicPotentials(X,ga,bb)}catch(Tb){if($(Tb,"JV.JmolAsyncException"))throw new JS.ScriptInterruption(this.e,"partialcharge",1);throw Tb;}!this.chk&&null==Q&&this.error(32);y=Q;break;case 1312817669:z=!this.chk;t.append(" volume");break;case 1073741974:this.setShapeId(a,++l,Aa);kb=null==this.getShapeProperty(a,"ID");l=b.iToken;break;case 1073741888:1111490588==this.tokAt(l+1)&&(Ja=!0,l++);
qa=this.paramAsStr(++l).toLowerCase();qa.equals("sets")?t.append(' colorScheme "sets"'):b.isColorParam(l)&&(qa=b.getColorRange(l),l=b.iToken);break;case 1073741828:A="addHydrogens";y=Boolean.TRUE;t.append(" addHydrogens");break;case 1073741836:A="angstroms";t.append(" angstroms");break;case 1073741837:A="anisotropy";y=this.getPoint3f(++l,!1);t.append(" anisotropy").append(JU.Escape.eP(y));l=b.iToken;break;case 1073741842:C=!this.chk;t.append(" area");break;case 1073741850:case 1073742076:n=!0;W&&
!m&&(t.append(' phase "_orb"'),this.addShapeProperty(D,"phase","_orb"));var ja=w(7,0);ja[0]=this.intParameter(++l);ja[1]=this.intParameter(++l);ja[2]=this.intParameter(++l);ja[3]=this.isFloatParameter(l+1)?this.floatParameter(++l):6;t.append(" atomicOrbital ").appendI(x(ja[0])).append(" ").appendI(x(ja[1])).append(" ").appendI(x(ja[2])).append(" ").appendF(ja[3]);134217751==this.tokAt(l+1)&&(l+=2,ja[4]=this.intParameter(l),ja[5]=3==this.tokAt(l+1)?this.floatParameter(++l):0,ja[6]=2==this.tokAt(l+
1)?this.intParameter(++l):-System.currentTimeMillis()%1E4,t.append(" points ").appendI(x(ja[4])).appendC(" ").appendF(ja[5]).appendC(" ").appendI(x(ja[6])));A="hydrogenOrbital";y=ja;break;case 1073741866:t.append(" binary");continue;case 1073741868:t.append(" blockData");A="blockData";y=Boolean.TRUE;break;case 1073741875:case 554176565:Z=!0;A=b.theToken.value;y=this.getCapSlabObject(l,!1);l=b.iToken;break;case 1073741876:h||this.invArg();var O=!0,Ub=this.isFloatParameter(l+1)?this.floatParameter(++l):
1.2,tb=this.isFloatParameter(l+1)?this.floatParameter(++l):10;if(this.chk)continue;if(50<tb){b.integerOutOfRange(0,50);return}t.append(" cavity ").appendF(Ub).append(" ").appendF(tb);this.addShapeProperty(D,"envelopeRadius",Float.$valueOf(tb));this.addShapeProperty(D,"cavityRadius",Float.$valueOf(Ub));A="cavity";break;case 1073741896:case 1073741900:A="contour";t.append(" contour");switch(this.tokAt(l+1)){case 1073741920:y=b.floatParameterSet(l+2,1,2147483647);t.append(" discrete ").append(JU.Escape.eAF(y));
l=b.iToken;break;case 1073741981:T=this.getPoint3f(l+2,!1);(0>=T.z||T.y<T.x)&&this.invArg();T.z==x(T.z)&&T.z>T.y-T.x&&(T.z=(T.y-T.x)/T.z);y=T;l=b.iToken;t.append(" increment ").append(JU.Escape.eP(T));break;default:y=Integer.$valueOf(2==this.tokAt(l+1)?this.intParameter(++l):0),t.append(" ").appendO(y),2==this.tokAt(l+1)&&(this.addShapeProperty(D,A,y),y=Integer.$valueOf(-Math.abs(this.intParameter(++l))),t.append(" ").appendO(y))}break;case 1073741910:t.append(" cutoff ");268440577==this.tokAt(++l)?
(A="cutoffPositive",y=Float.$valueOf(sa=this.floatParameter(++l)),t.append("+").appendO(y)):this.isFloatParameter(l)?(A="cutoff",y=Float.$valueOf(sa=this.floatParameter(l)),t.appendO(y)):Ka?(A="cutoffRange",y=b.floatParameterSet(l,2,2),this.addShapeProperty(D,"cutoff",Float.$valueOf(0)),t.append(JU.Escape.eAF(y)),l=b.iToken):this.invArg();break;case 1073741928:A="downsample";y=Integer.$valueOf(this.intParameter(++l));t.append(" downsample ").appendO(y);break;case 1073741931:A="eccentricity";y=b.getPoint4f(++l);
t.append(" eccentricity ").append(JU.Escape.eP4(y));l=b.iToken;break;case 1073741932:t.append(" ed");this.setMoData(D,-1,null,0,!1,aa,null,null,!1);n=!0;continue;case 536870916:case 1073742041:t.append(" ").appendO(b.theToken.value);A="debug";y=536870916==U?Boolean.TRUE:Boolean.FALSE;break;case 12293:t.append(" fixed");A="fixed";y=Boolean.TRUE;break;case 1073741962:t.append(" fullPlane");A="fullPlane";y=Boolean.TRUE;break;case 1073741966:case 1073741968:var ec=1073741968==U,A=""+b.theToken.value,
xa=new JU.Lst,y=xa,K=n=!0;t.append(" ").append(A);var la=this.paramAsStr(++l);if(la.equals("=")){t.append(" =");la=this.paramAsStr(++l);t.append(" ").append(JU.PT.esc(la));xa.addLast(la);this.chk||this.addShapeProperty(D,"func",this.createFunction("__iso__","x,y,z",la));break}var ub=JU.PT.getQuotedAttribute(b.fullCommand,"# DATA"+(K?"2":""));null==ub?ub="inline":la=ub;var Vb=0==la.indexOf("data2d_"),fc=0==la.indexOf("data3d_"),lb=la.equals("inline");t.append(" inline");xa.addLast(la);var Wb=this.getPoint3f(++l,
!1);t.append(" ").append(JU.Escape.eP(Wb));xa.addLast(Wb);var ya;da=++b.iToken;xa.addLast(ya=b.getPoint4f(da));t.append(" ").append(JU.Escape.eP4(ya));F=x(ya.x);ia=++b.iToken;xa.addLast(ya=b.getPoint4f(ia));t.append(" ").append(JU.Escape.eP4(ya));H=x(ya.x);xa.addLast(ya=b.getPoint4f(++b.iToken));t.append(" ").append(JU.Escape.eP4(ya));R=x(ya.x);(0==F||0==H||0==R)&&this.invArg();if(!this.chk){var ma=null,ua=null;if(ec){lb?(F=Math.abs(F),H=Math.abs(H),R=Math.abs(R),ua=this.floatArraySetXYZ(++b.iToken,
F,H,R)):ua=fc?this.vwr.getDataObj(la,null,3):this.vwr.functionXYZ(la,F,H,R);F=Math.abs(F);H=Math.abs(H);R=Math.abs(R);null==ua&&(b.iToken=da,b.errorStr(53,"xyzdata is null."));if(ua.length!=F||ua[0].length!=H||ua[0][0].length!=R)b.iToken=da,b.errorStr(53,"xyzdata["+ua.length+"]["+ua[0].length+"]["+ua[0][0].length+"] is not of size ["+F+"]["+H+"]["+R+"]");xa.addLast(ua);t.append(" ").append(JU.Escape.e(ua))}else{lb?(F=Math.abs(F),H=Math.abs(H),ma=this.floatArraySet(++b.iToken,F,H)):Vb?(ma=this.vwr.getDataObj(la,
null,2),F=null==ma?0:ma.length,H=3):(ma=this.vwr.functionXY(la,F,H),F=Math.abs(F),H=Math.abs(H));null==ma&&(b.iToken=da,b.errorStr(53,"fdata is null."));ma.length!=F&&!Vb&&(b.iToken=da,b.errorStr(53,"fdata length is not correct: "+ma.length+" "+F+"."));for(ca=0;ca<F;ca++)null==ma[ca]&&(b.iToken=ia,b.errorStr(53,"fdata["+ca+"] is null.")),ma[ca].length!=H&&(b.iToken=ia,b.errorStr(53,"fdata["+ca+"] is not the right length: "+ma[ca].length+" "+H+"."));xa.addLast(ma);t.append(" ").append(JU.Escape.e(ma))}}l=
b.iToken;break;case 1073742188:var gc=this.e.isAtomExpression(++l),Xb=this.getAllPoints(l,1);t.append(" value "+(gc?this.e.atomExpressionAt(l).toString():JU.Escape.eAP(Xb)));A="probes";y=Xb;l=this.e.iToken;break;case 1073741970:A="gridPoints";t.append(" gridPoints");break;case 1073741976:ga=this.atomExpressionAt(++l);null!=this.vwr.slm.bsDeleted&&ga.or(this.vwr.slm.bsDeleted);A="ignore";y=ga;t.append(" ignore ").append(JU.Escape.eBS(ga));l=b.iToken;break;case 1073741985:A="insideOut";t.append(" insideout");
break;case 1073741988:case 1073741986:case 1073742100:t.append(" ").appendO(b.theToken.value);A="pocket";y=1073742100==U?Boolean.TRUE:Boolean.FALSE;break;case 1073742002:A="lobe";y=b.getPoint4f(++l);l=b.iToken;t.append(" lobe ").append(JU.Escape.eP4(y));n=!0;break;case 1073742004:case 1073742006:A="lp";y=b.getPoint4f(++l);l=b.iToken;t.append(" lp ").append(JU.Escape.eP4(y));n=!0;break;case 4125:(G||this.slen==l+1)&&this.invArg();G=!0;if((O||pa||ea)&&!n)n=!0,this.addShapeProperty(D,"bsSolvent",pa||
ea?new JU.BS:b.lookupIdentifierValue("solvent")),this.addShapeProperty(D,"sasurface",Float.$valueOf(0));0==t.length()?(oa=this.getShapeProperty(24,"plane"),null==oa?null!=this.getShapeProperty(24,"contours")&&this.addShapeProperty(D,"nocontour",null):(this.addShapeProperty(D,"plane",oa),t.append("plane ").append(JU.Escape.eP4(oa)),p=!0,oa=null)):!n&&!p&&this.invArg();t.append("; isosurface map");this.addShapeProperty(D,"map",n?Boolean.TRUE:Boolean.FALSE);break;case 1073742014:A="maxset";y=Integer.$valueOf(this.intParameter(++l));
t.append(" maxSet ").appendO(y);break;case 1073742020:A="minset";y=Integer.$valueOf(this.intParameter(++l));t.append(" minSet ").appendO(y);break;case 1073742112:n=!0;A="rad";y=b.getPoint4f(++l);l=b.iToken;t.append(" radical ").append(JU.Escape.eP4(y));break;case 1073742027:A="fixed";y=Boolean.FALSE;t.append(" modelBased");break;case 1073742028:case 1073742135:case 1612709912:var Na=b.theToken.value,cb;1073742028==U?(A="molecular",t.append(" molecular"),cb=this.isFloatParameter(l+1)?this.floatParameter(++l):
1.4):(this.addShapeProperty(D,"bsSolvent",b.lookupIdentifierValue("solvent")),A=1073742135==U?"sasurface":"solvent",t.append(" ").appendO(b.theToken.value),cb=this.isFloatParameter(l+1)?this.floatParameter(++l):this.vwr.getFloat(570425394));t.append(" ").appendF(cb);y=Float.$valueOf(cb);1073741961==this.tokAt(l+1)&&(this.addShapeProperty(D,"doFullMolecular",null),t.append(" full"),l++);n=!0;break;case 1073742032:this.addShapeProperty(D,"fileType","Mrc");t.append(" mrc");continue;case 1140850696:var ha=
b.stringParameter(++l);this.addShapeProperty(D,"fileType",ha);t.append(' type "'+ha+'"');continue;case 1073742064:case 1073742062:this.addShapeProperty(D,"fileType","Obj");t.append(" obj");continue;case 1073742033:this.addShapeProperty(D,"fileType","Msms");t.append(" msms");continue;case 1073742094:n&&this.invArg();A="phase";m=!0;y=4==this.tokAt(l+1)?this.stringParameter(++l):"_orb";t.append(" phase ").append(JU.PT.esc(y));break;case 1073742104:case 1073742122:A="resolution";y=Float.$valueOf(this.floatParameter(++l));
t.append(" resolution ").appendO(y);break;case 1073742124:A="reverseColor";y=Boolean.TRUE;t.append(" reversecolor");break;case 1073742127:case 1073742146:A="sigma";y=Float.$valueOf(va=this.floatParameter(++l));t.append(" sigma ").appendO(y);break;case 1112150021:A="geodesic";y=Float.$valueOf(this.floatParameter(++l));t.append(" geosurface ").appendO(y);n=!0;break;case 1073742154:A="sphere";y=Float.$valueOf(this.floatParameter(++l));t.append(" sphere ").appendO(y);n=!0;break;case 1073742156:A="squareData";
y=Boolean.TRUE;t.append(" squared");break;case 1073741984:A=!n&&!p&&!G?"readFile":"mapColor";ka=this.stringParameter(++l);null==ka&&this.invArg();e&&(ka=JU.PT.replaceWithCharacter(ka,"{,}|"," "));b.debugHigh&&JU.Logger.debug("pmesh inline data:\n"+ka);y=this.chk?null:ka;this.addShapeProperty(D,"fileName","");t.append(" INLINE ").append(JU.PT.esc(ka));n=!0;break;case 268437504:case 1073742195:case 7:(null!=mb||kb)&&this.invArg();var db=b.listParameter4(l,2,2147483647,!0),l=b.iToken,Wa=M(db.size()/
2);(0==Wa||2*Wa!=db.size())&&this.invArg();var vb=Array(Wa),wb=w(Wa,0);t.append("[");try{for(var Yb=ca=0;ca<Wa;ca++)wb[ca]=db.get(Yb++).floatValue(),vb[ca]=this.e.checkFileExists("ISOSURFACE_"+ca+"_",!1,db.get(Yb++),l,!1),t.appendF(wb[ca]),t.append(" /*file*/").append(JU.PT.esc(vb[ca]));t.append("]")}catch(Zb){if($(Zb,Exception))this.invArg();else throw Zb;}mb=B(-1,[vb,wb]);A=!n&&!p&&!G?"readFile":"mapColor";n=!0;if(this.chk)break;this.addShapeProperty(D,"filesData",mb);break;case 545259556:case 545259557:case 1073741914:case 4:case 102409:var xb=
!n&&!p,A=xb&&!G?"readFile":"mapColor";switch(U){case 4:var f=this.paramAsStr(l),yb=f.indexOf("::");if(0<yb){var eb=f.substring(0,yb),eb=eb.substring(0,1).toUpperCase()+eb.substring(1).toLowerCase();this.addShapeProperty(D,"fileType",eb);f=f.substring(yb+2)}break;case 1073741914:f="=density/";break;case 102409:f="cache://"+this.stringParameter(++l)}if(null==f||0==f.length||f.equals("*")||f.equals("="))if(this.chk)f="";else{var f=null,$b=this.vwr.getPdbID(),f=null==$b?this.vwr.ms.getModelFileName(this.vwr.am.cmi):
"*"+(545259557==U?"*":"")+$b;null==f&&b.errorStr(22,"no PDBID available")}var ac=!1;f.startsWith("http://eds.bmc.uu.se/eds/dfs/cb/")&&f.endsWith(".omap")&&(f=(0<=f.indexOf("_diff")?"*":"")+"*"+f.substring(32,36));if(f.startsWith("*")||f.startsWith("=")){var hc=!Float.isNaN(sa)||!Float.isNaN(va),zb=0<=f.indexOf("/full");zb&&(f=JU.PT.rep(f,"/full",""));0<=f.indexOf("/diff")&&(f="*"+f.substring(0,f.indexOf("/diff")));f.startsWith("**")&&(hc||this.addShapeProperty(D,"sigma",Float.$valueOf(va=3)),Ma||
(Ma=!0,t.append(" sign"),this.addShapeProperty(D,"sign",Boolean.TRUE)));var ic=f,f=this.vwr.setLoadFormat(!1,f,this.chk?"?":zb?"_":"-",!1);null==f&&b.errorStr(22,"error parsing filename: "+ic);ac=!zb}ac&&(null==ba&&0==wa&&(Na=f,0>aa&&(aa=this.vwr.am.cmi),V=this.vwr.getModelUndeletedAtomsBitSet(aa),0<=V.nextSetBit(0)&&(ba=this.getWithinDistanceVector(D,2,null,V,!1),t.append(" within 2.0 ").append(JU.Escape.eBS(V)))),null!=ba&&0<=f.indexOf("/0,0,0/0,0,0?")&&(f=f.$replace("0,0,0/0,0,0",ba[0].x+","+ba[0].y+
","+ba[0].z+"/"+ba[ba.length-1].x+","+ba[ba.length-1].y+","+ba[ba.length-1].z)),xb&&(Eb=!0));var fb=null==f?-1:f.indexOf("#-");if(Float.isNaN(va)&&Float.isNaN(sa))if(0<=(fb=f.indexOf("#-cutoff=")))this.addShapeProperty(D,"cutoff",Float.$valueOf(sa=Float.parseFloat(f.substring(fb+9)))),t.append(" cutoff "+sa);else if(0<=(fb=f.indexOf("#-sigma=")))this.addShapeProperty(D,"sigma",Float.$valueOf(va=Float.parseFloat(f.substring(fb+8)))),t.append(" sigma "+va);Float.isNaN(va)?Float.isNaN(sa)||this.showString("using cutoff = "+
sa):this.showString("using sigma = "+va);xb&&(this.vwr.getP("_fileType").equals("Pdb")&&Float.isNaN(va)&&Float.isNaN(sa))&&(this.addShapeProperty(D,"sigma",Float.$valueOf(-1)),t.append(" sigma -1.0"));0==f.length&&(0>aa&&(aa=this.vwr.am.cmi),f=b.getFullPathName(!1),y=this.vwr.ms.getInfo(aa,"jmolSurfaceInfo"));var Ab=-1;null==y&&2==this.tokAt(l+1)&&this.addShapeProperty(D,"fileIndex",Integer.$valueOf(Ab=this.intParameter(++l)));var Xa=4==this.tokAt(l+1)?this.stringParameter(++l):null,n=!0;if(this.chk)break;
var bc,Ba=null;null==y&&(0<=b.fullCommand.indexOf("# FILE0=")?(f=JU.PT.getQuotedAttribute(b.fullCommand,"# FILE0"),1073741848==this.tokAt(l+1)&&(l+=2)):1073741848==this.tokAt(l+1)&&(Ba=this.vwr.fm.getFilePath(this.stringParameter(b.iToken=l+=2),!1,!1),bc=this.vwr.getFullPathNameOrError(Ba),Ba=bc[0],""!==this.vwr.fm.getPathForAllFiles()?(f=Ba,Ba=null):this.addShapeProperty(D,"localName",Ba)));null==Xa&&(f=this.e.checkFileExists("ISOSURFACE_"+(G?"MAP_":""),!1,f,l,!1));this.showString("reading isosurface data from "+
f);null!=Xa&&(y=this.vwr.fm.cacheGet(f,!1),this.addShapeProperty(D,"calculationType",Xa));null==y&&(this.addShapeProperty(D,"fileName",f),null!=Ba&&(f=Ba),0<=Ab&&t.append(" ").appendI(Ab));t.append(" /*file*/").append(JU.PT.esc(f));null!=Xa&&t.append(" ").append(JU.PT.esc(Xa));break;case 4106:A="connections";switch(this.tokAt(++l)){case 12290:case 10:case 1073742325:y=s(-1,[this.atomExpressionAt(l).nextSetBit(0)]);break;default:y=s(-1,[x(b.floatParameterSet(l,1,1)[0])])}l=b.iToken;break;case 1094713347:A=
"atomIndex";y=Integer.$valueOf(this.intParameter(++l));break;case 1073741999:A="link";t.append(" link");break;case 1814695966:24!=a&&this.invArg();268440577==this.tokAt(l+1)&&l++;A="extendGrid";y=Float.$valueOf(this.floatParameter(++l));t.append(" unitcell "+y);break;case 1073741994:24!=a&&this.invArg();T=this.getPoint3f(++l,!1);l=b.iToken;if(0>=T.x||0>=T.y||0>=T.z)break;T.x=x(T.x);T.y=x(T.y);T.z=x(T.z);t.append(" lattice ").append(JU.Escape.eP(T));G?(A="mapLattice",y=T):(za=T,12293==this.tokAt(l+
1)&&(t.append(" fixed"),Ia=!0,l++));break;default:1073741824==U&&(A="thisID",y=ka);if(!b.setMeshDisplayProperty(a,0,U)){if(JS.T.tokAttr(U,1073741824)&&!Aa){this.setShapeId(a,l,Aa);l=b.iToken;break}this.invArg()}0==c&&(c=l);l=this.slen-1}Aa=12291!=U;kb&&n&&this.invArg();null!=A&&this.addShapeProperty(D,A,y)}if(!this.chk){if((O||pa)&&!n)n=!0,this.addShapeProperty(D,"bsSolvent",pa?new JU.BS:b.lookupIdentifierValue("solvent")),this.addShapeProperty(D,"sasurface",Float.$valueOf(0));p&&(!n&&!G)&&(this.addShapeProperty(D,
"nomap",Float.$valueOf(0)),n=!0);null!=q&&this.addShapeProperty(D,"getSurfaceSets",q);if(null!=Oa)this.addShapeProperty(D,"colorDiscrete",Oa);else if("sets".equals(qa))this.addShapeProperty(D,"setColorScheme",null);else if(null!=qa){var gb=this.vwr.cm.getColorEncoder(qa);null!=gb&&(gb.isTranslucent=Ja,gb.hi=3.4028235E38,this.addShapeProperty(D,"remapColor",gb))}if(n&&!g&&0!=t.indexOf(";")){D.add(0,B(-1,["newObject",null]));var cc=null==X;cc&&(X=JU.BSUtil.andNot(JU.BSUtil.copy(this.vwr.bsA()),this.vwr.slm.bsDeleted));
0>aa&&(aa=this.vwr.am.cmi);X.and(this.vwr.getModelUndeletedAtomsBitSet(aa));null!=this.vwr.slm.bsDeleted&&null==ga&&(D.add(1,B(-1,["ignore",JU.BS.copy(this.vwr.slm.bsDeleted)])),t.insert(0," ignore "+this.vwr.slm.bsDeleted));null!=Na&&(1<this.vwr.ms.getModelBS(X,!1).cardinality()&&b.errorStr(30,"ISOSURFACE "+Na),cc&&(D.add(0,B(-1,["select",X])),0==t.indexOf("; isosurface map")&&(t=(new JU.SB).append("; isosurface map select ").append(JU.Escape.eBS(X)).append(t.substring(16)))))}ea&&!Z&&(n||this.addShapeProperty(D,
"sasurface",Float.$valueOf(0)),G||(this.addShapeProperty(D,"map",Boolean.TRUE),this.addShapeProperty(D,"select",V),this.addShapeProperty(D,"sasurface",Float.$valueOf(0))),this.addShapeProperty(D,"slab",this.getCapSlabObject(-100,!1)));var dc=n&&this.vwr.getBoolean(603979934);dc&&JU.Logger.startTimer("isosurface");this.setShapeProperty(a,"setProperties",D);dc&&this.showString(JU.Logger.getTimerMsg("isosurface",0));Eb&&(this.setShapeProperty(a,"token",Integer.$valueOf(1073742018)),this.setShapeProperty(a,
"token",Integer.$valueOf(1073742046)),E=!0,t.append(" mesh nofill frontOnly"))}null!=za&&(this.setShapeProperty(a,"lattice",za),Ia&&this.setShapeProperty(a,"fixLattice",Boolean.TRUE));null!=Ga&&this.setShapeProperty(a,"symops",Ga);E&&this.setShapeProperty(a,"token",Integer.$valueOf(1073741960));0<c&&(b.setMeshDisplayProperty(a,c,0)||this.invArg());if(!this.chk){var Ea=null,Fa=null;C&&(Ea=this.getShapeProperty(a,"area"),Y(Ea,Float)?this.vwr.setFloatProperty("isosurfaceArea",Ea.floatValue()):this.vwr.g.setUserVariable("isosurfaceArea",
JS.SV.getVariableAD(Ea)));z&&(Fa=z?this.getShapeProperty(a,"volume"):null,Y(Fa,Float)?this.vwr.setFloatProperty("isosurfaceVolume",Fa.floatValue()):this.vwr.g.setUserVariable("isosurfaceVolume",JS.SV.getVariableAD(Fa)));if(!g){ha=null;if(G&&!n)this.setShapeProperty(a,"finalize",t.toString());else if(n){var hb=t.toString(),hb=(0==hb.indexOf("; isosurface map")?"":" select "+JU.Escape.eBS(X)+" ")+hb;this.setShapeProperty(a,"finalize",hb);ha=this.getShapeProperty(a,"ID");null!=ha&&(!b.tQuiet&&!r)&&(sa=
this.getShapeProperty(a,"cutoff").floatValue(),Float.isNaN(sa)&&!Float.isNaN(va)&&JU.Logger.error("sigma not supported"),ha+=" created "+this.getShapeProperty(a,"message"))}var Bb,Cb;if(C||z)Bb=C?"isosurfaceArea = "+(Y(Ea,Float)?""+Ea:JU.Escape.eAD(Ea)):null,Cb=z?"isosurfaceVolume = "+(Y(Fa,Float)?""+Fa:JU.Escape.eAD(Fa)):null,null==ha?(C&&this.showString(Bb),z&&this.showString(Cb)):(C&&(ha+="\n"+Bb),z&&(ha+="\n"+Cb));null!=ha&&!r&&this.showString(ha);n&&(ha=this.getShapeProperty(a,"output"),null!=
ha&&!r&&this.showString(ha))}null!=nb&&this.setShapeProperty(a,"translucency",nb);this.setShapeProperty(a,"clear",null);I&&this.setShapeProperty(a,P?"cacheAll":"cache",null);!r&&(!v&&!Z&&12291!=b.theTok)&&this.listIsosurface(a)}}},"~N");e(d,"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 f=
null,v=null;switch(this.getToken(c).tok){case 1073741875:case 554176565:f=a.theToken.value;1073742334==this.tokAt(c+1)&&(a.iToken=c+1);v=this.getCapSlabObject(c,!0);c=a.iToken;break;case 12289:this.isosurface(26);return;case 528432:var d=v=0,h=0;switch(this.getToken(++c).tok){case 1111492629:v=0.017453292519943295*this.floatParameter(++c);break;case 1111492630:d=0.017453292519943295*this.floatParameter(++c);break;case 1111492631:h=0.017453292519943295*this.floatParameter(++c);break;default:this.invArg()}f=
"rotationAxis";v=JU.V3.new3(v,d,h);break;case 1073742335:case 1610625028:case 2097192:f="on";break;case 1073742334:case 12294:case 2097194:f="off";break;case 12291:f="delete";break;case 12290:case 10:case 1073742325:f="select";v=this.atomExpressionAt(c);c=a.iToken;break;case 1140850693:f="reversecolor";v=Boolean.TRUE;1073742335==this.tokAt(c+1)?++c:1073742334==this.tokAt(c+1)&&(v=Boolean.FALSE,++c);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 1111490588:case 1073742074:a.setMeshDisplayProperty(26,c,a.theTok);c=a.iToken;b=!0;continue;case 1112152075:case 4:v=this.paramAsStr(c).toLowerCase();v.equals("spacefill")&&(v="cpk");f="create";a.optParameterAsString(c+1).equalsIgnoreCase("molecular")&&(c++,f="molecular");break;case 1275082241:a.isAtomExpression(c+1)?(f="select",v=this.atomExpressionAt(c+1),c=a.iToken):(f="selectType",v=this.paramAsStr(++c),v.equals("spacefill")&&(v="cpk"));break;case 536875059:f=
"scale";v=Float.$valueOf(this.floatParameter(++c));break;case 1073742004:case 1073742006:f="lonePair";break;case 1073742112:case 1073742111:f="radical";break;case 1073742028:f="molecular";break;case 1073741904:v=this.paramAsStr(++c);f="create";a.optParameterAsString(c+1).equalsIgnoreCase("molecular")&&(c++,f="molecular");break;case 1073741974:v=a.setShapeNameParameter(++c);c=a.iToken;b&&this.invArg();f="lcaoID";break;default:if(268441089==a.theTok||JS.T.tokAttr(a.theTok,1073741824))268441089!=a.theTok&&
(v=this.paramAsStr(c)),b&&this.invArg(),f="lcaoID"}12291!=a.theTok&&(b=!0);null==f&&this.invArg();this.setShapeProperty(26,f,v)}this.setShapeProperty(26,"clear",null)}});e(d,"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),f=c&&null==this.getShapeProperty(25,"ID"),v=null,d=null,h=null,e=null,u=null,g=!1,r=new JU.SB,n=2147483647,p=134217750,G=0,m=NaN,s=NaN,C=!0,x=null,z=null,
L=0,O=!1,I=-2147483648,P=1<a.iToken,K=a.iToken;K<this.slen;++K){switch(h=this.getToken(K).tok){default:P=!0;if(!a.setMeshDisplayProperty(25,0,a.theTok)){268441089!=a.theTok&&!JS.T.tokAttr(a.theTok,1073741824)&&this.invArg();this.setShapeId(25,K,c);K=a.iToken;break}0==b&&(b=K);K=a.iToken;continue;case 1073741974:P=!0;this.setShapeId(25,++K,c);f=null==this.getShapeProperty(25,"ID");K=a.iToken;break;case 1765808134:switch(this.tokAt(K+1)){case 1073741914:h=0;g=!0;r.append(" color density");K++;break;
case 1140850696:h=0,O=!0,r.append(" color type"),K++}if(0==h)break;case 1111490588:case 1073742074:P=!0;0==L&&(L=K);a.setMeshDisplayProperty(25,K,a.theTok);K=a.iToken;break;case 554176565:P=!0;z=this.getCapSlabObject(K,!1);this.setShapeProperty(25,"slab",z);K=a.iToken;break;case 1073741914:g=!0;r.append(" density");this.isFloatParameter(K+1)&&(null==u&&(u=w(1,0)),u[0]=-Math.abs(this.floatParameter(++K)),r.append(" "+-u[0]));break;case 1073742122:c=this.floatParameter(++K);0<c&&(r.append(" resolution ").appendF(c),
this.setShapeProperty(25,"resolution",Float.$valueOf(c)));break;case 1094717454:case 1094713359:I=1094713359==a.theTok?this.intParameter(++K):a.modelNumberParameter(++K);r.append(" modelIndex "+I);break;case 134217759:case 1275069443:m=this.floatParameter(++K);r.append(" within ").appendF(m);break;case 268440577:case 2:case 3:e=a.encodeRadiusParameter(K,!1,!1);if(null==e)return!1;r.append(" ").appendO(e);K=a.iToken;break;case 1073741990:case 1073741989:x=1073741989==h?Boolean.TRUE:Boolean.FALSE;r.append(" ").appendO(a.theToken.value);
break;case 1073742020:n=this.intParameter(++K);break;case 1613238294:case 1073741881:case 1648363544:G=h;r.append(" ").appendO(a.theToken.value);break;case 1073742135:this.isFloatParameter(K+1)&&(s=this.floatParameter(++K));case 1073741875:case 1073742036:case 2097180:C=!1;case 1275068932:case 1073741961:case 134217750:case 4106:p=h;r.append(" ").appendO(a.theToken.value);1073742135==h&&r.append(" ").appendF(s);break;case 1073742083:u=a.floatParameterSet(++K,1,10);K=a.iToken;break;case 12290:case 10:case 1073742325:(f||
null!=d)&&this.invArg(),h=JU.BSUtil.copy(this.atomExpressionAt(K)),K=a.iToken,null==v?v=h:d=h,r.append(" ").append(JU.Escape.eBS(h))}c=12291!=a.theTok}!P&&null==v&&this.error(13);if(this.chk)return!1;if(null!=v){1648363544==G&&null==e&&(e=new J.atomdata.RadiusData(null,0,J.atomdata.RadiusData.EnumType.OFFSET,J.c.VDW.AUTO));K=null==e?new J.atomdata.RadiusData(null,0.26,J.atomdata.RadiusData.EnumType.OFFSET,J.c.VDW.AUTO):e;d=1073742036==p&&null==d&&null!=x&&x.booleanValue()?v:a.getMathExt().setContactBitSets(v,
d,C,m,K,!0);switch(p){case 1073741875:case 1073742135:K=a.lookupIdentifierValue("solvent");v.andNot(K);d.andNot(K);d.andNot(v);break;case 2097180:d.andNot(v);break;case 1073742036:2147483647==n&&(n=100),this.setShapeProperty(25,"minset",Integer.$valueOf(n)),r.append(" minSet ").appendI(n),null==u&&(u=w(-1,[0.5,2]))}null!=x&&(u=null==u?w(2,0):JU.AU.ensureLengthA(u,2),u[1]=x.booleanValue()?1:2);null!=u&&r.append(" parameters ").append(JU.Escape.eAF(u));this.setShapeProperty(25,"set",B(-1,[Integer.$valueOf(G),
Integer.$valueOf(p),Boolean.$valueOf(g),Boolean.$valueOf(O),v,d,e,Float.$valueOf(s),u,Integer.$valueOf(I),r.toString()]));0<L&&a.setMeshDisplayProperty(25,L,0)}0<b&&(a.setMeshDisplayProperty(25,b,0)||this.invArg());null!=z&&null!=v&&this.setShapeProperty(25,"slab",z);if(null!=v&&(1073742036==p||C)){v=this.getShapeProperty(25,"volume");b=1073741961==p;if(JU.AU.isAD(v))for(K=a=0;K<v.length;K++)a+=b?v[K]:Math.abs(v[K]);else a=v.floatValue();a=Math.round(1E3*a)/1E3;if(g||1275068932!=p)g=this.getShapeProperty(25,
"nSets").intValue(),g="Contacts: "+(0>g?M(-g/2):g),0!=a&&(g+=", with "+(b?"approx ":"net ")+"volume "+a+" A^3"),this.showString(g)}return!0});e(d,"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),f=c&&null==this.getShapeProperty(23,"ID"),v=!1,d=!1,h=!1,e=-1,u=null,g=3.4028235E38,r=s(-1,[-2147483648]),n=0,p=a.iToken;p<this.slen;++p){var G=null,e=null;switch(this.getToken(p).tok){case 134221829:d=
!this.chk;1073742327==this.tokAt(p+1)&&(this.checkLength(p+2),h=!0,p++);continue;case 134221834:case 268437504:case 1073742195:case 7:(null!=u||f)&&this.invArg();u=new JU.Lst;p=s(-1,[p,this.slen]);a.getShapePropertyData(23,"data",B(-1,[this.st,p,u,this.vwr]))||this.invArg();p=p[0];continue;case 536875059:++p>=this.slen&&this.error(34);switch(this.getToken(p).tok){case 2:n=this.intParameter(p);continue;case 3:n=Math.round(100*this.floatParameter(p));continue}this.error(34);break;case 12293:G="modelIndex";
e=Integer.$valueOf(-1);break;case 1094713359:case 1094717454:e=1094713359==a.theTok?this.intParameter(++p):a.modelNumberParameter(++p);G="modelIndex";e=Integer.$valueOf(e);break;case 1765808134:case 1111490588:case 1073742074:g=this.getColorTrans(a,p,!1,r);p=a.iToken;c=!0;continue;case 1073741974:this.setShapeId(23,++p,c);f=null==this.getShapeProperty(23,"ID");p=a.iToken;break;case 1073742196:G="width";e=Double.$valueOf(this.floatParameter(++p));break;default:if(!a.setMeshDisplayProperty(23,0,a.theTok)){if(268441089==
a.theTok||JS.T.tokAttr(a.theTok,1073741824)){this.setShapeId(23,p,c);p=a.iToken;break}this.invArg()}0==b&&(b=p);p=a.iToken;continue}c=12291!=a.theTok;null!=u&&!v&&(G="points",e=Integer.$valueOf(n),v=!0,n=0);null!=G&&this.setShapeProperty(23,G,e)}d&&this.setShapeProperty(23,h?"cacheAll":"cache",null);this.finalizeObject(23,r[0],g,n,null!=u,u,b,null);return!0});e(d,"getAtomicPotentials",function(a,b,c){var f=w(this.vwr.ms.ac,0),v=J.api.Interface.getOption("quantum.MlpCalculation",this.vwr,"script");
v.set(this.vwr);c=null==c?null:this.vwr.getFileAsString3(c,!1,null);try{v.assignPotentials(this.vwr.ms.at,f,this.vwr.getSmartsMatch("a",a),this.vwr.getSmartsMatch("/noAromatic/[$(C=O),$(O=C),$(NC=O)]",a),b,c)}catch(d){if(!$(d,Exception))throw d;}return f},"JU.BS,JU.BS,~S");e(d,"getCapSlabObject",function(a,b){if(0>a)return JU.GData.getSlabWithinRange(a,0);var c=this.e,f=null,v=554176565==this.tokAt(a),d=this.tokAt(a+1),h=null,e=h=null,g=null,k=null;if(1111490588==d)switch(g=this.isFloatParameter(++a+
1)?this.floatParameter(++a):0.5,c.isColorParam(a+1)?(g=Short.$valueOf(JU.C.getColixTranslucent3(JU.C.getColix(c.getArgbParam(a+1)),0!=g,g)),a=c.iToken):g=Short.$valueOf(JU.C.getColixTranslucent3(1,0!=g,g)),d=this.tokAt(a+1)){case 1073742018:case 1073741938:k=Integer.$valueOf(d);d=this.tokAt(++a+1);break;default:k=Integer.$valueOf(1073741938)}switch(d){case 1073742334:return c.iToken=a+1,Integer.$valueOf(-2147483648);case 1073742333:c.iToken=a+1;break;case 1073742330:a++;f=B(-1,[Float.$valueOf(1),
this.paramAsStr(++a)]);d=1073742018;break;case 134217759:a++;if(1073742114==this.tokAt(++a))f=this.floatParameter(++a),d=this.floatParameter(++a),f=B(-1,[Float.$valueOf(f),Float.$valueOf(d)]),d=1073742114;else if(this.isFloatParameter(a)){f=this.floatParameter(a);if(c.isCenterParameter(++a)){var h=Array(1),r=c.centerParameter(a,h);if(this.chk||!Y(h[0],"JU.BS"))h=B(-1,[r]);else for(var r=this.vwr.ms.at,e=h[0],h=Array(e.cardinality()),n=0,p=e.nextSetBit(0);0<=p;p=e.nextSetBit(p+1),n++)h[n]=r[p]}else h=
c.getPointArray(a,-1,!1,!0);0==h.length&&(c.iToken=a,this.invArg());f=B(-1,[Float.$valueOf(f),h,e])}else f=c.getPointArray(a,4,!1,!0),d=1812599299;break;case 1812599299:c.iToken=a+1;f=JU.BoxInfo.toOABC(this.vwr.ms.getBBoxVertices(),null);break;case 1073741872:case 1814695966:c.iToken=a+1;c=this.vwr.getCurrentUnitCell();if(null==c)1814695966==d&&this.invArg();else{h=JU.BoxInfo.toOABC(c.getUnitCellVerticesNoOffset(),c.getCartesianOffset());c=x(c.getUnitCellInfoType(6));f=e=null;switch(c){case 1:f=JU.V3.newVsub(h[2],
h[0]),f.scale(1E3);case 2:e=JU.V3.newVsub(h[1],h[0]),e.scale(1E3),h[0].sub(e),h[1].scale(2E3),1==c&&(h[0].sub(f),h[2].scale(2E3))}f=h}break;case 12290:case 10:case 1073742325:if(f=this.atomExpressionAt(a+1),d=3,!c.isCenterParameter(++c.iToken)){v=!0;break}default:if(!b&&v&&this.isFloatParameter(a+1)){f=this.floatParameter(++a);if(!this.isFloatParameter(a+1))return Integer.$valueOf(x(f));d=this.floatParameter(++a);f=B(-1,[Float.$valueOf(f),Float.$valueOf(d)]);d=1073742114;break}h=c.planeParameter(++a,
!1);d=this.isFloatParameter(c.iToken+1)?this.floatParameter(++c.iToken):NaN;Float.isNaN(d)||(h.w-=d);f=h;d=134217750}g=null==k?null:B(-1,[k,g]);return JU.GData.getSlabObjectType(d,f,!v,g)},"~N,~B");e(d,"setColorOptions",function(a,b,c,f){var v=this.e;this.getToken(b);var d="opaque";if(1111490588==v.theTok)if(d="translucent",0>f){var h=this.isFloatParameter(b+1)?this.floatParameter(++b):3.4028235E38;v.setShapeTranslucency(c,null,"translucent",h,null);null!=a&&(a.append(" translucent"),3.4028235E38!=
h&&a.append(" ").appendF(h))}else v.setMeshDisplayProperty(c,b,v.theTok);else 1073742074==v.theTok?0<=f&&v.setMeshDisplayProperty(c,b,v.theTok):v.iToken--;f=Math.abs(f);for(h=0;h<f;h++)if(v.isColorParam(v.iToken+1)){var e=v.getArgbParam(++v.iToken);this.setShapeProperty(c,"colorRGB",Integer.$valueOf(e));null!=a&&a.append(" ").append(JU.Escape.escapeColor(e))}else if(v.iToken<b)this.invArg();else break;return d},"JU.SB,~N,~N,~N");e(d,"createFunction",function(a,b,c){var f=(new JS.ScriptEval).setViewer(this.vwr);
try{f.compileScript(null,"function "+a+"("+b+") { return "+c+"}",!1);var v=new JU.Lst;for(a=0;a<b.length;a+=2)v.addLast(JS.SV.newF(0).setName(b.substring(a,a+1)));return B(-1,[f.aatoken[0][1].value,v])}catch(d){if($(d,Exception))return null;throw d;}},"~S,~S,~S");e(d,"getWithinDistanceVector",function(a,b,c,f,v){var d=new JU.Lst,h=Array(2);if(null==f){var e=JU.P3.new3(b,b,b),g=JU.P3.newP(c);g.sub(e);e.add(c);h[0]=g;h[1]=e;d.addLast(c)}else c=this.vwr.ms.getBoxInfo(f,-Math.abs(2*b)),h[0]=c.getBoundBoxVertices()[0],
h[1]=c.getBoundBoxVertices()[7],1==f.cardinality()&&d.addLast(this.vwr.ms.at[f.nextSetBit(0)]);1==d.size()&&!v&&(this.addShapeProperty(a,"withinDistance",Float.$valueOf(b)),this.addShapeProperty(a,"withinPoint",d.get(0)));this.addShapeProperty(a,v?"displayWithin":"withinPoints",B(-1,[Float.$valueOf(b),h,f,d]));return h},"JU.Lst,~N,JU.P3,JU.BS,~B");e(d,"addShapeProperty",function(a,b,c){this.chk||a.addLast(B(-1,[b,c]))},"JU.Lst,~S,~O");e(d,"floatArraySetXYZ",function(a,b,c,f){var d=this.e,S=this.tokAt(a++);
1073742195==S&&(S=this.tokAt(a++));(268437504!=S||0>=b)&&this.invArg();for(var h=JU.AU.newFloat3(b,-1),e=0;268437505!=S;)switch(S=this.getToken(a).tok,S){case 1073742195:case 268437505:continue;case 268436992:a++;break;case 268437504:h[e++]=this.floatArraySet(a,c,f);a=++d.iToken;S=0;e==b&&268437505!=this.tokAt(a)&&this.invArg();break;default:this.invArg()}return h},"~N,~N,~N,~N");e(d,"floatArraySet",function(a,b,c){var f=this.tokAt(a++);1073742195==f&&(f=this.tokAt(a++));268437504!=f&&this.invArg();
for(var d=JU.AU.newFloat2(b),S=0;268437505!=f;)switch(f=this.getToken(a).tok,f){case 1073742195:case 268437505:continue;case 268436992:a++;break;case 268437504:a++;f=w(c,0);d[S++]=f;for(var h=0;h<c;h++)f[h]=this.floatParameter(a++),268436992==this.tokAt(a)&&a++;268437505!=this.tokAt(a++)&&this.invArg();f=0;S==b&&268437505!=this.tokAt(a)&&this.invArg();break;default:this.invArg()}return d},"~N,~N,~N");e(d,"initIsosurface",function(a){var b=this.e;this.setShapeProperty(a,"init",b.fullCommand);b.iToken=
0;var c=this.tokAt(1),f=this.tokAt(2);if(12291==c||12291==f&&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",B(-1,[b.thisCommand])),1073741974!=c&&(268441089==f||268441089==c&&b.setMeshDisplayProperty(a,
0,f)))?(a=this.setShapeId(a,1,!1),b.iToken++,a):null},"~N");e(d,"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(d,"getBoxPoints",function(a,b,c,f,d){switch(a){case 1814695966:return null==b?null:b.getCanonicalCopy(d,!0);case 1812599299:if(null==c)if(null==f)a=this.vwr.ms.getBoxInfo();else{c=this.e.getObjectBoundingBox(f);if(null==c)return null;a=new JU.BoxInfo;a.addBoundBoxPoint(c[0]);
a.addBoundBoxPoint(c[1])}else a=new JU.BoxInfo,this.vwr.calcAtomsMinMax(c,a);return JU.BoxInfo.getCanonicalCopy(a.getBoundBoxVertices(),d);default:return null}},"~N,J.api.SymmetryInterface,JU.BS,~S,~N")});O("JU");L(["JU.TriangleData"],"JU.Triangulator","JU.AU $.BS $.Lst $.Measure $.P3 $.P4 $.V3".split(" "),function(){var d=za(JU,"Triangulator",JU.TriangleData);e(d,"intersectLine",function(a,b,c,f){b=new JU.V3;for(var d=new JU.V3,S=new JU.V3,h=new JU.V3,e=null,g=null,k=new JU.P3,r=new JU.P4,n=3.4028235E38,
p=-3.4028235E38,G=0;12>G;G++){var m=JU.Triangulator.fullCubePolygon[G];if(0==G%2){JU.Measure.getPlaneThroughPoints(a[m[0]],a[m[1]],a[m[2]],b,d,r);if(null==JU.Measure.getIntersection(c,f,r,k,b,S)){G++;continue}h.sub2(k,c)}if(JU.Measure.isInTriangle(k,a[m[0]],a[m[1]],a[m[2]],b,d,S)){m=f.dot(h);m<n&&(n=m,e=k);m>p&&(p=m,g=k);0==G%2&&G++;if(0.01<p-n)break;k=new JU.P3}}return null==e||(null==g||0.001>e.distance(g))&&null==(g=e)?null:B(-1,[e,g])},"~A,~N,JU.P3,JU.V3");e(d,"getCellProjection",function(a,b){for(var c=
new JU.V3,f=0,d=-3.4028235E38,e=0,h=Array(8),j=0;8>j;j++)f=b[j].dot(a),f>d&&(d=f,e=j),JU.Measure.getPlaneProjection(b[j],a,h[j]=new JU.P3,c);f=JU.Triangulator.fullCubeCorners[e][3];c=JU.AU.newInt2(6);for(j=d=0;12>j;j++)if(0!=(f&JU.TriangleData.Pwr2[j])){var g=s(4,0),k=JU.Triangulator.fullCubePolygon[j];g[0]=k[0];g[1]=k[1];g[2]=k[2];g[3]=k[0]==e?2:k[1]==e?0:k[2]==e?1:3;c[d++]=g}e=new JU.Lst;e.addLast(h);e.addLast(c);return e},"JU.P4,~A");e(d,"intersectPlane",function(a,b,c){if(-1==c&&8==b.length)return this.getCellProjection(a,
b);for(var f=new JU.Lst,d=Array(12),e=0,h=w(8,0),j=0;8>j;j++)h[j]=a.x*b[j].x+a.y*b[j].y+a.z*b[j].z+a.w,0>h[j]&&(e|=JU.TriangleData.Pwr2[j]);a=JU.TriangleData.triangleTable2[e];if(null==a)return null;for(j=0;24>j;j+=2){var e=JU.TriangleData.edgeVertexes[j],g=JU.TriangleData.edgeVertexes[j+1],k=JU.P3.newP(b[g]);k.sub(b[e]);k.scale(h[e]/(h[e]-h[g]));k.add(b[e]);d[j>>1]=k}if(0==c){c=new JU.BS;for(j=0;j<a.length;j++)c.set(a[j]),2==j%4&&j++;j=c.cardinality();h=Array(j);f.addLast(h);b=s(12,0);for(j=e=0;j<
a.length;j++)g=a[j],c.get(g)&&(c.clear(g),h[e]=d[g],b[g]=e++),2==j%4&&j++;d=JU.AU.newInt2(a.length>>2);f.addLast(d);for(j=0;j<a.length;j++)d[j>>2]=s(-1,[b[a[j++]],b[a[j++]],b[a[j++]],a[j]]);return f}for(j=0;j<a.length;j++)b=d[a[j++]],h=d[a[j++]],e=d[a[j++]],1==(c&1)&&f.addLast(B(-1,[b,h,e])),2==(c&2)&&(g=a[j],1==(g&1)&&f.addLast(B(-1,[b,h])),2==(g&2)&&f.addLast(B(-1,[h,e])),4==(g&4)&&f.addLast(B(-1,[b,e])));return f},"JU.P4,~A,~N");d.edgeC=B(-1,[s(-1,[0,3,0,1])]);d.edgeB=B(-1,[s(-1,[0,4,0,1])]);d.edgeA=
B(-1,[s(-1,[0,1,0,1])]);d.abFace=B(-1,[s(-1,[0,4,5,3]),s(-1,[5,1,0,3])]);d.fullCubePolygon=B(-1,[s(-1,[0,4,5,3]),s(-1,[5,1,0,3]),s(-1,[1,5,6,2]),s(-1,[6,2,1,3]),s(-1,[2,6,7,2]),s(-1,[7,3,2,3]),s(-1,[3,7,4,2]),s(-1,[4,0,3,2]),s(-1,[6,5,4,0]),s(-1,[4,7,6,0]),s(-1,[0,1,2,0]),s(-1,[2,3,0,0])]);d.fullCubeCorners=B(-1,[s(-1,[1,4,3,3267]),s(-1,[0,2,5,3087]),s(-1,[1,3,6,3132]),s(-1,[2,0,7,3312]),s(-1,[0,5,7,963]),s(-1,[1,6,4,783]),s(-1,[2,7,5,828]),s(-1,[3,4,6,1008])])});O("JU");L(["JU.P3i"],"JU.TriangleData",
null,function(){var d=za(JU,"TriangleData",null);d.Pwr2=s(-1,[1,2,4,8,16,32,64,128,256,512,1024,2048]);d.cubeVertexOffsets=B(-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)]);d.edgeVertexes=g(-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]);d.triangleTable2=B(-1,[null,g(-1,[0,8,3,7]),g(-1,[0,1,9,7]),g(-1,[1,8,3,6,9,8,1,5]),g(-1,[1,2,10,7]),g(-1,[0,8,3,7,1,2,10,7]),g(-1,[9,2,10,6,0,2,9,
5]),g(-1,[2,8,3,6,2,10,8,1,10,9,8,3]),g(-1,[3,11,2,7]),g(-1,[0,11,2,6,8,11,0,5]),g(-1,[1,9,0,7,2,3,11,7]),g(-1,[1,11,2,6,1,9,11,1,9,8,11,3]),g(-1,[3,10,1,6,11,10,3,5]),g(-1,[0,10,1,6,0,8,10,1,8,11,10,3]),g(-1,[3,9,0,6,3,11,9,1,11,10,9,3]),g(-1,[9,8,10,5,10,8,11,6]),g(-1,[4,7,8,7]),g(-1,[4,3,0,6,7,3,4,5]),g(-1,[0,1,9,7,8,4,7,7]),g(-1,[4,1,9,6,4,7,1,1,7,3,1,3]),g(-1,[1,2,10,7,8,4,7,7]),g(-1,[3,4,7,6,3,0,4,3,1,2,10,7]),g(-1,[9,2,10,6,9,0,2,3,8,4,7,7]),g(-1,[2,10,9,3,2,9,7,0,2,7,3,6,7,9,4,6]),g(-1,[8,
4,7,7,3,11,2,7]),g(-1,[11,4,7,6,11,2,4,1,2,0,4,3]),g(-1,[9,0,1,7,8,4,7,7,2,3,11,7]),g(-1,[4,7,11,3,9,4,11,1,9,11,2,2,9,2,1,6]),g(-1,[3,10,1,6,3,11,10,3,7,8,4,7]),g(-1,[1,11,10,6,1,4,11,0,1,0,4,3,7,11,4,5]),g(-1,[4,7,8,7,9,0,11,1,9,11,10,6,11,0,3,6]),g(-1,[4,7,11,3,4,11,9,4,9,11,10,6]),g(-1,[9,5,4,7]),g(-1,[9,5,4,7,0,8,3,7]),g(-1,[0,5,4,6,1,5,0,5]),g(-1,[8,5,4,6,8,3,5,1,3,1,5,3]),g(-1,[1,2,10,7,9,5,4,7]),g(-1,[3,0,8,7,1,2,10,7,4,9,5,7]),g(-1,[5,2,10,6,5,4,2,1,4,0,2,3]),g(-1,[2,10,5,3,3,2,5,1,3,5,4,
2,3,4,8,6]),g(-1,[9,5,4,7,2,3,11,7]),g(-1,[0,11,2,6,0,8,11,3,4,9,5,7]),g(-1,[0,5,4,6,0,1,5,3,2,3,11,7]),g(-1,[2,1,5,3,2,5,8,0,2,8,11,6,4,8,5,5]),g(-1,[10,3,11,6,10,1,3,3,9,5,4,7]),g(-1,[4,9,5,7,0,8,1,5,8,10,1,2,8,11,10,3]),g(-1,[5,4,0,3,5,0,11,0,5,11,10,6,11,0,3,6]),g(-1,[5,4,8,3,5,8,10,4,10,8,11,6]),g(-1,[9,7,8,6,5,7,9,5]),g(-1,[9,3,0,6,9,5,3,1,5,7,3,3]),g(-1,[0,7,8,6,0,1,7,1,1,5,7,3]),g(-1,[1,5,3,5,3,5,7,6]),g(-1,[9,7,8,6,9,5,7,3,10,1,2,7]),g(-1,[10,1,2,7,9,5,0,5,5,3,0,2,5,7,3,3]),g(-1,[8,0,2,3,
8,2,5,0,8,5,7,6,10,5,2,5]),g(-1,[2,10,5,3,2,5,3,4,3,5,7,6]),g(-1,[7,9,5,6,7,8,9,3,3,11,2,7]),g(-1,[9,5,7,3,9,7,2,0,9,2,0,6,2,7,11,6]),g(-1,[2,3,11,7,0,1,8,5,1,7,8,2,1,5,7,3]),g(-1,[11,2,1,3,11,1,7,4,7,1,5,6]),g(-1,[9,5,8,5,8,5,7,6,10,1,3,3,10,3,11,6]),g(-1,[5,7,0,1,5,0,9,6,7,11,0,1,1,0,10,5,11,10,0,1]),g(-1,[11,10,0,1,11,0,3,6,10,5,0,1,8,0,7,5,5,7,0,1]),g(-1,[11,10,5,3,7,11,5,5]),g(-1,[10,6,5,7]),g(-1,[0,8,3,7,5,10,6,7]),g(-1,[9,0,1,7,5,10,6,7]),g(-1,[1,8,3,6,1,9,8,3,5,10,6,7]),g(-1,[1,6,5,6,2,6,
1,5]),g(-1,[1,6,5,6,1,2,6,3,3,0,8,7]),g(-1,[9,6,5,6,9,0,6,1,0,2,6,3]),g(-1,[5,9,8,3,5,8,2,0,5,2,6,6,3,2,8,5]),g(-1,[2,3,11,7,10,6,5,7]),g(-1,[11,0,8,6,11,2,0,3,10,6,5,7]),g(-1,[0,1,9,7,2,3,11,7,5,10,6,7]),g(-1,[5,10,6,7,1,9,2,5,9,11,2,2,9,8,11,3]),g(-1,[6,3,11,6,6,5,3,1,5,1,3,3]),g(-1,[0,8,11,3,0,11,5,0,0,5,1,6,5,11,6,6]),g(-1,[3,11,6,3,0,3,6,1,0,6,5,2,0,5,9,6]),g(-1,[6,5,9,3,6,9,11,4,11,9,8,6]),g(-1,[5,10,6,7,4,7,8,7]),g(-1,[4,3,0,6,4,7,3,3,6,5,10,7]),g(-1,[1,9,0,7,5,10,6,7,8,4,7,7]),g(-1,[10,6,
5,7,1,9,7,1,1,7,3,6,7,9,4,6]),g(-1,[6,1,2,6,6,5,1,3,4,7,8,7]),g(-1,[1,2,5,5,5,2,6,6,3,0,4,3,3,4,7,6]),g(-1,[8,4,7,7,9,0,5,5,0,6,5,2,0,2,6,3]),g(-1,[7,3,9,1,7,9,4,6,3,2,9,1,5,9,6,5,2,6,9,1]),g(-1,[3,11,2,7,7,8,4,7,10,6,5,7]),g(-1,[5,10,6,7,4,7,2,1,4,2,0,6,2,7,11,6]),g(-1,[0,1,9,7,4,7,8,7,2,3,11,7,5,10,6,7]),g(-1,[9,2,1,6,9,11,2,2,9,4,11,1,7,11,4,5,5,10,6,7]),g(-1,[8,4,7,7,3,11,5,1,3,5,1,6,5,11,6,6]),g(-1,[5,1,11,1,5,11,6,6,1,0,11,1,7,11,4,5,0,4,11,1]),g(-1,[0,5,9,6,0,6,5,2,0,3,6,1,11,6,3,5,8,4,7,7]),
g(-1,[6,5,9,3,6,9,11,4,4,7,9,5,7,11,9,1]),g(-1,[10,4,9,6,6,4,10,5]),g(-1,[4,10,6,6,4,9,10,3,0,8,3,7]),g(-1,[10,0,1,6,10,6,0,1,6,4,0,3]),g(-1,[8,3,1,3,8,1,6,0,8,6,4,6,6,1,10,6]),g(-1,[1,4,9,6,1,2,4,1,2,6,4,3]),g(-1,[3,0,8,7,1,2,9,5,2,4,9,2,2,6,4,3]),g(-1,[0,2,4,5,4,2,6,6]),g(-1,[8,3,2,3,8,2,4,4,4,2,6,6]),g(-1,[10,4,9,6,10,6,4,3,11,2,3,7]),g(-1,[0,8,2,5,2,8,11,6,4,9,10,3,4,10,6,6]),g(-1,[3,11,2,7,0,1,6,1,0,6,4,6,6,1,10,6]),g(-1,[6,4,1,1,6,1,10,6,4,8,1,1,2,1,11,5,8,11,1,1]),g(-1,[9,6,4,6,9,3,6,0,9,1,
3,3,11,6,3,5]),g(-1,[8,11,1,1,8,1,0,6,11,6,1,1,9,1,4,5,6,4,1,1]),g(-1,[3,11,6,3,3,6,0,4,0,6,4,6]),g(-1,[6,4,8,3,11,6,8,5]),g(-1,[7,10,6,6,7,8,10,1,8,9,10,3]),g(-1,[0,7,3,6,0,10,7,0,0,9,10,3,6,7,10,5]),g(-1,[10,6,7,3,1,10,7,1,1,7,8,2,1,8,0,6]),g(-1,[10,6,7,3,10,7,1,4,1,7,3,6]),g(-1,[1,2,6,3,1,6,8,0,1,8,9,6,8,6,7,6]),g(-1,[2,6,9,1,2,9,1,6,6,7,9,1,0,9,3,5,7,3,9,1]),g(-1,[7,8,0,3,7,0,6,4,6,0,2,6]),g(-1,[7,3,2,3,6,7,2,5]),g(-1,[2,3,11,7,10,6,8,1,10,8,9,6,8,6,7,6]),g(-1,[2,0,7,1,2,7,11,6,0,9,7,1,6,7,10,
5,9,10,7,1]),g(-1,[1,8,0,6,1,7,8,2,1,10,7,1,6,7,10,5,2,3,11,7]),g(-1,[11,2,1,3,11,1,7,4,10,6,1,5,6,7,1,1]),g(-1,[8,9,6,1,8,6,7,6,9,1,6,1,11,6,3,5,1,3,6,1]),g(-1,[0,9,1,7,11,6,7,7]),g(-1,[7,8,0,3,7,0,6,4,3,11,0,5,11,6,0,1]),g(-1,[7,11,6,7]),g(-1,[7,6,11,7]),g(-1,[3,0,8,7,11,7,6,7]),g(-1,[0,1,9,7,11,7,6,7]),g(-1,[8,1,9,6,8,3,1,3,11,7,6,7]),g(-1,[10,1,2,7,6,11,7,7]),g(-1,[1,2,10,7,3,0,8,7,6,11,7,7]),g(-1,[2,9,0,6,2,10,9,3,6,11,7,7]),g(-1,[6,11,7,7,2,10,3,5,10,8,3,2,10,9,8,3]),g(-1,[7,2,3,6,6,2,7,5]),
g(-1,[7,0,8,6,7,6,0,1,6,2,0,3]),g(-1,[2,7,6,6,2,3,7,3,0,1,9,7]),g(-1,[1,6,2,6,1,8,6,0,1,9,8,3,8,7,6,3]),g(-1,[10,7,6,6,10,1,7,1,1,3,7,3]),g(-1,[10,7,6,6,1,7,10,4,1,8,7,2,1,0,8,3]),g(-1,[0,3,7,3,0,7,10,0,0,10,9,6,6,10,7,5]),g(-1,[7,6,10,3,7,10,8,4,8,10,9,6]),g(-1,[6,8,4,6,11,8,6,5]),g(-1,[3,6,11,6,3,0,6,1,0,4,6,3]),g(-1,[8,6,11,6,8,4,6,3,9,0,1,7]),g(-1,[9,4,6,3,9,6,3,0,9,3,1,6,11,3,6,5]),g(-1,[6,8,4,6,6,11,8,3,2,10,1,7]),g(-1,[1,2,10,7,3,0,11,5,0,6,11,2,0,4,6,3]),g(-1,[4,11,8,6,4,6,11,3,0,2,9,5,2,
10,9,3]),g(-1,[10,9,3,1,10,3,2,6,9,4,3,1,11,3,6,5,4,6,3,1]),g(-1,[8,2,3,6,8,4,2,1,4,6,2,3]),g(-1,[0,4,2,5,4,6,2,3]),g(-1,[1,9,0,7,2,3,4,1,2,4,6,6,4,3,8,6]),g(-1,[1,9,4,3,1,4,2,4,2,4,6,6]),g(-1,[8,1,3,6,8,6,1,0,8,4,6,3,6,10,1,3]),g(-1,[10,1,0,3,10,0,6,4,6,0,4,6]),g(-1,[4,6,3,1,4,3,8,6,6,10,3,1,0,3,9,5,10,9,3,1]),g(-1,[10,9,4,3,6,10,4,5]),g(-1,[4,9,5,7,7,6,11,7]),g(-1,[0,8,3,7,4,9,5,7,11,7,6,7]),g(-1,[5,0,1,6,5,4,0,3,7,6,11,7]),g(-1,[11,7,6,7,8,3,4,5,3,5,4,2,3,1,5,3]),g(-1,[9,5,4,7,10,1,2,7,7,6,11,
7]),g(-1,[6,11,7,7,1,2,10,7,0,8,3,7,4,9,5,7]),g(-1,[7,6,11,7,5,4,10,5,4,2,10,2,4,0,2,3]),g(-1,[3,4,8,6,3,5,4,2,3,2,5,1,10,5,2,5,11,7,6,7]),g(-1,[7,2,3,6,7,6,2,3,5,4,9,7]),g(-1,[9,5,4,7,0,8,6,1,0,6,2,6,6,8,7,6]),g(-1,[3,6,2,6,3,7,6,3,1,5,0,5,5,4,0,3]),g(-1,[6,2,8,1,6,8,7,6,2,1,8,1,4,8,5,5,1,5,8,1]),g(-1,[9,5,4,7,10,1,6,5,1,7,6,2,1,3,7,3]),g(-1,[1,6,10,6,1,7,6,2,1,0,7,1,8,7,0,5,9,5,4,7]),g(-1,[4,0,10,1,4,10,5,6,0,3,10,1,6,10,7,5,3,7,10,1]),g(-1,[7,6,10,3,7,10,8,4,5,4,10,5,4,8,10,1]),g(-1,[6,9,5,6,6,
11,9,1,11,8,9,3]),g(-1,[3,6,11,6,0,6,3,4,0,5,6,2,0,9,5,3]),g(-1,[0,11,8,6,0,5,11,0,0,1,5,3,5,6,11,3]),g(-1,[6,11,3,3,6,3,5,4,5,3,1,6]),g(-1,[1,2,10,7,9,5,11,1,9,11,8,6,11,5,6,6]),g(-1,[0,11,3,6,0,6,11,2,0,9,6,1,5,6,9,5,1,2,10,7]),g(-1,[11,8,5,1,11,5,6,6,8,0,5,1,10,5,2,5,0,2,5,1]),g(-1,[6,11,3,3,6,3,5,4,2,10,3,5,10,5,3,1]),g(-1,[5,8,9,6,5,2,8,0,5,6,2,3,3,8,2,5]),g(-1,[9,5,6,3,9,6,0,4,0,6,2,6]),g(-1,[1,5,8,1,1,8,0,6,5,6,8,1,3,8,2,5,6,2,8,1]),g(-1,[1,5,6,3,2,1,6,5]),g(-1,[1,3,6,1,1,6,10,6,3,8,6,1,5,
6,9,5,8,9,6,1]),g(-1,[10,1,0,3,10,0,6,4,9,5,0,5,5,6,0,1]),g(-1,[0,3,8,7,5,6,10,7]),g(-1,[10,5,6,7]),g(-1,[11,5,10,6,7,5,11,5]),g(-1,[11,5,10,6,11,7,5,3,8,3,0,7]),g(-1,[5,11,7,6,5,10,11,3,1,9,0,7]),g(-1,[10,7,5,6,10,11,7,3,9,8,1,5,8,3,1,3]),g(-1,[11,1,2,6,11,7,1,1,7,5,1,3]),g(-1,[0,8,3,7,1,2,7,1,1,7,5,6,7,2,11,6]),g(-1,[9,7,5,6,9,2,7,0,9,0,2,3,2,11,7,3]),g(-1,[7,5,2,1,7,2,11,6,5,9,2,1,3,2,8,5,9,8,2,1]),g(-1,[2,5,10,6,2,3,5,1,3,7,5,3]),g(-1,[8,2,0,6,8,5,2,0,8,7,5,3,10,2,5,5]),g(-1,[9,0,1,7,5,10,3,1,
5,3,7,6,3,10,2,6]),g(-1,[9,8,2,1,9,2,1,6,8,7,2,1,10,2,5,5,7,5,2,1]),g(-1,[1,3,5,5,3,7,5,3]),g(-1,[0,8,7,3,0,7,1,4,1,7,5,6]),g(-1,[9,0,3,3,9,3,5,4,5,3,7,6]),g(-1,[9,8,7,3,5,9,7,5]),g(-1,[5,8,4,6,5,10,8,1,10,11,8,3]),g(-1,[5,0,4,6,5,11,0,0,5,10,11,3,11,3,0,3]),g(-1,[0,1,9,7,8,4,10,1,8,10,11,6,10,4,5,6]),g(-1,[10,11,4,1,10,4,5,6,11,3,4,1,9,4,1,5,3,1,4,1]),g(-1,[2,5,1,6,2,8,5,0,2,11,8,3,4,5,8,5]),g(-1,[0,4,11,1,0,11,3,6,4,5,11,1,2,11,1,5,5,1,11,1]),g(-1,[0,2,5,1,0,5,9,6,2,11,5,1,4,5,8,5,11,8,5,1]),g(-1,
[9,4,5,7,2,11,3,7]),g(-1,[2,5,10,6,3,5,2,4,3,4,5,2,3,8,4,3]),g(-1,[5,10,2,3,5,2,4,4,4,2,0,6]),g(-1,[3,10,2,6,3,5,10,2,3,8,5,1,4,5,8,5,0,1,9,7]),g(-1,[5,10,2,3,5,2,4,4,1,9,2,5,9,4,2,1]),g(-1,[8,4,5,3,8,5,3,4,3,5,1,6]),g(-1,[0,4,5,3,1,0,5,5]),g(-1,[8,4,5,3,8,5,3,4,9,0,5,5,0,3,5,1]),g(-1,[9,4,5,7]),g(-1,[4,11,7,6,4,9,11,1,9,10,11,3]),g(-1,[0,8,3,7,4,9,7,5,9,11,7,2,9,10,11,3]),g(-1,[1,10,11,3,1,11,4,0,1,4,0,6,7,4,11,5]),g(-1,[3,1,4,1,3,4,8,6,1,10,4,1,7,4,11,5,10,11,4,1]),g(-1,[4,11,7,6,9,11,4,4,9,2,11,
2,9,1,2,3]),g(-1,[9,7,4,6,9,11,7,2,9,1,11,1,2,11,1,5,0,8,3,7]),g(-1,[11,7,4,3,11,4,2,4,2,4,0,6]),g(-1,[11,7,4,3,11,4,2,4,8,3,4,5,3,2,4,1]),g(-1,[2,9,10,6,2,7,9,0,2,3,7,3,7,4,9,3]),g(-1,[9,10,7,1,9,7,4,6,10,2,7,1,8,7,0,5,2,0,7,1]),g(-1,[3,7,10,1,3,10,2,6,7,4,10,1,1,10,0,5,4,0,10,1]),g(-1,[1,10,2,7,8,7,4,7]),g(-1,[4,9,1,3,4,1,7,4,7,1,3,6]),g(-1,[4,9,1,3,4,1,7,4,0,8,1,5,8,7,1,1]),g(-1,[4,0,3,3,7,4,3,5]),g(-1,[4,8,7,7]),g(-1,[9,10,8,5,10,11,8,3]),g(-1,[3,0,9,3,3,9,11,4,11,9,10,6]),g(-1,[0,1,10,3,0,10,
8,4,8,10,11,6]),g(-1,[3,1,10,3,11,3,10,5]),g(-1,[1,2,11,3,1,11,9,4,9,11,8,6]),g(-1,[3,0,9,3,3,9,11,4,1,2,9,5,2,11,9,1]),g(-1,[0,2,11,3,8,0,11,5]),g(-1,[3,2,11,7]),g(-1,[2,3,8,3,2,8,10,4,10,8,9,6]),g(-1,[9,10,2,3,0,9,2,5]),g(-1,[2,3,8,3,2,8,10,4,0,1,8,5,1,10,8,1]),g(-1,[1,10,2,7]),g(-1,[1,3,8,3,9,1,8,5]),g(-1,[0,9,1,7]),g(-1,[0,3,8,7]),null])});O("J.jvxl.api");Ia(J.jvxl.api,"VertexDataServer");O("J.jvxl.api");Ia(J.jvxl.api,"MeshDataServer",J.jvxl.api.VertexDataServer);O("J.shapesurface");L(["J.jvxl.api.MeshDataServer",
"J.shape.MeshCollection","JU.P4"],"J.shapesurface.Isosurface","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 $.GData $.Logger JV.JC $.Viewer".split(" "),function(){var d=z(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.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.newFileName=this.oldFileName=null;C(this,arguments)},J.shapesurface,"Isosurface",J.shape.MeshCollection,J.jvxl.api.MeshDataServer);
da(d,function(){this.isomeshes=Array(4);this.lcaoDir=new JU.P4});m(d,"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(d,"initShape",function(){Ja(this,J.shapesurface.Isosurface,"initShape",
[]);this.myType="isosurface";this.newSg()});e(d,"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(d,"clearSg",function(){this.sg=null});m(d,"setProperty",function(a,b,c){this.setPropI(a,b,c)},"~S,~O,JU.BS");e(d,"setPropI",function(a,b,c){if("cacheAll"===a){c=this.thisMesh;for(var f=this.meshCount;0<=--f;)null!=this.isomeshes[f]&&
(b=this.isomeshes[f].thisID,this.setPropI("init",null,null),this.setPropI("thisID",b,null),this.setPropI("cache",null,null));null!=c&&(this.setPropI("init",null,null),this.setPropI("thisID",c.thisID,null))}else if("cache"===a)null!=this.currentMesh&&(f=this.currentMesh.modelIndex,b=this.currentMesh.thisID,c="cache://isosurface_"+b,a=this.getPropI("jvxlDataXml",-1),this.vwr.cachePut(c,a.getBytes()),this.deleteMeshI(this.currentMesh.index),this.setPropI("init",null,null),this.setPropI("thisID",b,null),
this.setPropI("modelIndex",Integer.$valueOf(f),null),this.setPropI("fileName",c,null),this.setPropI("readFile",null,null),this.setPropI("finalize","isosurface ID "+JU.PT.esc(b)+(0<=f?" modelIndex "+f:"")+" /*file*/"+JU.PT.esc(c),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(f=this.meshCount;0<=--f;)null!=this.isomeshes[f]&&"#inherit;".equals(this.isomeshes[f].colorCommand)&&
this.isomeshes[f].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("pymolparams"===a)null!=this.thisMesh&&(this.ensureMeshSource(),this.thisMesh.setPymolVertexColixesForAtoms(this.vwr,b,c));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&&(f=JU.C.getColixO(b[0]),b=b[1].floatValue(),1.7976931348623157E308!=b&&0!=b&&(f=JU.C.getColixTranslucent3(f,!0,b)),this.thisMesh.colorVertices(f,c,!1));else if("colorPhase"===a){f=b;c=JU.C.getColix(f[0].intValue());a=JU.C.getColix(f[1].intValue());b=null!=this.thisMesh?this.thisMesh.thisID:JU.PT.isWild(this.previousMeshID)?this.previousMeshID:null;
for(var d=this.getMeshList(b,!1),f=d.size();0<=--f;)d.get(f).setPropertyColorPhase(c,a,this.translucentLevel)}else if("color"===a){var e=JU.C.getHexCode(JU.C.getColixO(b));if(null!=this.thisMesh)this.thisMesh.setPropertyColor(e);else{d=this.getMeshList(JU.PT.isWild(this.previousMeshID)?this.previousMeshID:null,!1);for(f=d.size();0<=--f;)d.get(f).setPropertyColor(e)}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(f=this.meshCount;0<=--f;)this.meshes[f].modelIndex==c&&(null!=this.meshes[f].connectedAtoms||this.meshes[f].isModelConnected)&&this.meshes[f].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)f=b,this.explicitID||this.setPropertySuper("thisID",null,null),this.sg.setProp("lcaoCartoonCenter",f[2],null)||this.drawLcaoCartoon(f[0],f[1],f[3],"lonePair"===a?2:"radical"===a?1:0,null==this.thisMesh?!1:this.thisMesh.reverseColor);else if(!("select"===a&&this.iHaveBitSets||"ignore"===
a&&this.iHaveBitSets))if("reversecolor"===a)null!=this.thisMesh&&(this.thisMesh.reverseColor=b===Boolean.TRUE);else if("meshcolor"===a)f=b.intValue(),this.meshColix=JU.C.getColix(f),null!=this.thisMesh&&(this.thisMesh.meshColix=this.meshColix);else if("offset"===a)f=JU.P3.newP(b),0==f.lengthSquared()&&(f=null),null!=this.thisMesh&&(this.thisMesh.rotateTranslate(null,f,!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)f=b,this.displayWithinDistance2=f[0].floatValue(),this.isDisplayWithinNot=0>this.displayWithinDistance2,this.displayWithinDistance2*=this.displayWithinDistance2,this.displayWithinPoints=f[3],0==this.displayWithinPoints.size()&&(this.displayWithinPoints=this.ms.getAtomPointVector(f[2]));else if("finalize"===a)null!=this.thisMesh&&(f=b,null!=f&&!f.startsWith("; isosurface map")&&(this.thisMesh.setDiscreteColixes(this.sg.params.contoursDiscrete,
this.sg.params.contourColixes),this.setJvxlInfo()),this.setScriptInfo(f)),this.clearSg();else if("connections"===a)null!=this.currentMesh&&(this.connections=b,0<=this.connections[0]&&this.connections[0]<this.ms.ac?this.currentMesh.connectedAtoms=this.connections:this.connections=this.currentMesh.connectedAtoms=null);else if("fixLattice"===a)null!=this.thisMesh&&this.thisMesh.fixLattice();else{if("slab"===a){if(Y(b,Integer)){null!=this.thisMesh&&(this.thisMesh.jvxlData.slabValue=b.intValue());return}if(null!=
this.thisMesh){f=b;switch(f[0].intValue()){case 1073742018:b=f[1];c=this.getMesh(b[1]);if(null==c)return;b[1]=c}this.slabPolygons(f);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("probes"===a)null!=this.sg&&(this.sg.params.probes=
b,this.sg.params.probeValues=w(this.sg.params.probes.length,0));else if("deleteVdw"===a){for(f=this.meshCount;0<=--f;)null!=this.isomeshes[f].bsVdw&&(null==c||c.intersects(this.isomeshes[f].bsVdw))&&this.deleteMeshI(f);this.currentMesh=this.thisMesh=null}else{if("mapColor"===a||"readFile"===a){if(null==b){if(null==this.sg.params.filesData)b=this.getFileReader(this.sg.params.fileName);else{b=this.sg.params.filesData;d=this.sg.params.filesData[0];e=Array(d.length);for(f=e.length;0<=--f&&null!=b;)if(null==
(e[f]=this.getFileReader(d[f])))b=null;null!=b&&(this.sg.params.filesData[0]=e)}if(null==b)return}}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)f=b.intValue(),1296041986==f?this.colorType=f:(this.colorType=0,this.defaultColix=JU.C.getColix(f));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){if(null!=this.thisMesh){if(Y(b,"JU.BS"))e=b,e.isEmpty()&&(e=null);else{e=new JU.BS;d=b;for(f=d.length;0<=--f;)0<d[f]&&e.set(d[f]-1)}this.thisMesh.jvxlData.thisSet=e;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(),Y(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)f=this.ms.am[this.currentMesh.modelIndex].mat4,null!=f&&(f=JU.M4.newM4(f),f.invert(),this.setPropI("modelInvRotation",f,null))}else"phase"===a?this.isPhaseColored=!0:"plane"!==a&&"pocket"!==a&&("scale3d"===a?(this.scale3d=b.floatValue(),null!=this.thisMesh&&(this.thisMesh.scale3d=this.thisMesh.jvxlData.scale3d=this.scale3d,this.thisMesh.altVertices=null)):"title"===a?("string"==typeof b&&"-".equals(b)&&
(b=null),this.setPropertySuper(a,b,c),b=this.title):"withinPoints"===a?(f=b,this.withinDistance2=f[0].floatValue(),this.isWithinNot=0>this.withinDistance2,this.withinDistance2*=this.withinDistance2,this.withinPoints=f[3],0==this.withinPoints.size()&&(this.withinPoints=this.ms.getAtomPointVector(f[2]))):("nci"===a||"orbital"===a)&&null!=this.sg?this.sg.params.testFlags=this.vwr.getBoolean(603979962)?2:0:"cutoffRange"===a&&(this.cutoffRange=b));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="",f="string"==typeof b?b:null,b=null==f?-1:f.indexOf("# ID="),this.actualID=0<=b?JU.PT.getQuotedStringAt(f,b):null,this.setPropertySuper("thisID","+PREVIOUS_MESH+",null),null!=f&&!(this.iHaveBitSets=this.getScriptBitSets(f,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];d=b[2][1];b=b[2][2];for(f=this.meshCount;0<=--f;)c=this.meshes[f],null!=c&&(null!=c.connectedAtoms&&(e=c.connectedAtoms[0],e>=d+b?c.connectedAtoms[0]=e-b:e>=d&&(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,f,1)):c.modelIndex>a&&(c.modelIndex--,c.atomIndex>=d&&(c.atomIndex-=b)))}else this.setPropertySuper(a,b,c)}}}},"~S,~O,JU.BS");e(d,"getFileReader",function(a){var b=this.vwr.fm.getBufferedReaderOrErrorMessageFromName(a,null,!0,!0);if("string"==typeof b)return JU.Logger.error("Isosurface: could not open file "+a+" -- "+b),null;if(!Y(b,"java.io.BufferedReader"))try{b=JU.Rdr.getBufferedReader(b,"ISO-8859-1")}catch(c){if(!$(c,
"java.io.IOException"))throw c;}return b},"~S");e(d,"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",w(this.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(d,"slabPolygons",function(a){this.thisMesh.calculatedVolume=null;this.thisMesh.calculatedArea=null;this.thisMesh.getMeshSlicer().slabPolygons(a,!1);this.thisMesh.reinitializeLightingAndColor(this.vwr)},"~A");m(d,"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");m(d,"getPropertyData",function(a,b){var c;"keys"===a&&(c=Y(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 f=Array(2);f[0]=JU.P3.newP(c.jvxlData.boundingBox[0]);f[1]=JU.P3.newP(c.jvxlData.boundingBox[1]);var d=new JU.V3;c.mat4.getTranslation(d);
f[0].add(d);f[1].add(d);b[2]=f}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;f=JU.P3.newP(c.jvxlData.boundingBox[0]);f.add(c.jvxlData.boundingBox[1]);f.scale(0.5);null!=c.mat4&&(d=new JU.V3,c.mat4.getTranslation(d),f.add(d));b[2]=f;return!0}return this.getPropDataMC(a,b)},"~S,~A");m(d,"getProperty",function(a,b){return this.getPropI(a,b)},"~S,~N");
e(d,"getPropI",function(a,b){var c=this.thisMesh;if(0<=b&&(b>=this.meshCount||null==(c=this.isomeshes[b])))return null;var f=this.getPropMC(a,b);if(null!=f)return f;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=null==this.jvxlData.cutoffRange?c+(" with cutoff="+this.jvxlData.cutoff):c+(" with cutoffRange="+JU.Escape.eAF(this.jvxlData.cutoffRange));
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 f=null==c?-2147483648:c.nSets,0==f&&(this.calculateVolumeOrArea(c,!0),f=c.nSets),Integer.$valueOf(-2147483648==f?0:Math.abs(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("output"===a)return null==
c.jvxlData.sbOut&&null==c.jvxlData.jvxlFileTitle?null:c.jvxlData.jvxlFileTitle+"\n"+(null==c.jvxlData.sbOut?"":c.jvxlData.sbOut.toString());if("cutoff"===a)return Float.$valueOf(this.jvxlData.cutoff);if("cutoffRange"===a)return this.jvxlData.cutoffRange;if("minMaxInfo"===a)return w(-1,[this.jvxlData.dataMin,this.jvxlData.dataMax]);if("plane"===a)return this.jvxlData.jvxlPlane;if("contours"===a)return c.getContours();if("pmesh"===a||"pmeshbin"===a)return c.getPmeshData("pmeshbin"===a);if("ply"===a||
"plybin"===a)return c.getPLYData("plybin"===a);if("jvxlDataXml"===a||"jvxlMeshXml"===a){var d=null;this.jvxlData.slabInfo=null;"jvxlMeshXml"===a||this.jvxlData.vertexDataOnly||null!=c.bsSlabDisplay&&null==c.bsSlabGhost?(d=new J.jvxl.data.MeshData,this.fillMeshData(d,1,c),d.polygonColorData=J.shapesurface.Isosurface.getPolygonColorData(d.pc,d.pcs,d.colorsExplicit?d.pis:null,d.bsSlabDisplay)):null!=c.bsSlabGhost&&(this.jvxlData.slabInfo=c.slabOptions.toString());f=new JU.SB;this.getMeshCommand(f,c.index);
c.setJvxlColorMap(!0);null!=c.vertexColorMap&&(this.jvxlData.vertexColorMap=c.copyVertexColorMap());null!=this.jvxlData.vertexColorMap&&(this.jvxlData.nVertexColors=this.jvxlData.vertexColorMap.size());return J.jvxl.data.JvxlCoder.jvxlGetFile(this.jvxlData,d,this.title,"",!0,1,f.toString(),null)}if("jvxlFileInfo"===a)return J.jvxl.data.JvxlCoder.jvxlGetInfo(this.jvxlData);if("command"===a){f=new JU.SB;c=this.getMeshList(0>b?this.previousMeshID:c.thisID,!1);for(d=c.size();0<=--d;)this.getMeshCommand(f,
c.get(d).index);return f.toString()}return"atoms"===a?c.surfaceAtoms:"colorEncoder"===a?c.colorEncoder:"values"===a||"value"===a?c.probeValues:null},"~S,~N");e(d,"getDataRange",function(a){return null==a?null:a.getDataRange()},"J.shapesurface.IsosurfaceMesh");e(d,"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 f=J.jvxl.data.MeshData.calculateVolumeOrArea(c,a.jvxlData.thisSet,b,!1);0>=a.nSets&&(a.nSets=-c.nSets);b?a.calculatedArea=f:a.calculatedVolume=f;return f},"J.shapesurface.IsosurfaceMesh,~B");d.getPolygonColorData=e(d,"getPolygonColorData",function(a,b,c,f){var d=null!=c;if(null==b&&null==c)return null;for(var e=new JU.SB,h=
0,j=0,g=0,k=0,r=!1,n=0;n<a||!0==(r=!0);n++)if(r||null==f||f.get(n))if(r||(d?(k=c[n][4])!=g:b[n]!=j)){0!=h&&e.append(" ").appendI(h).append(" ").appendI(d?g:0==j?0:JU.C.getArgb(j));if(r)break;d?g=k:j=b[n];h=1}else h++;e.append("\n");return e.toString()},"~N,~A,~A,JU.BS");m(d,"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(d,"getMeshCommand",function(a,b){var c=this.meshes[b],f;if(!(null==c||null==
(f=c.scriptCommand))){1<this.ms.mc&&J.shape.Shape.appendCmd(a,"frame "+this.vwr.getModelNumberDotted(c.modelIndex));f=JU.PT.rep(f,";; isosurface map"," map");f=JU.PT.rep(f,"; isosurface map"," map");f.endsWith(" map")&&(f=f.substring(0,f.length-4));f=f.$replace("\t"," ");f=JU.PT.rep(f,";#","; #");var d=f.indexOf("; #");0<=d&&(f=f.substring(0,d));null!=c.connectedAtoms&&(f+=" connect "+JU.Escape.eAI(c.connectedAtoms));f=JU.PT.trim(f,";");if(0<=f.indexOf("cache://")){var e=c.thisID,d="isosurface_"+
e,e="cache://isosurface_"+e,h=this.vwr.fm.cacheGet(e,!1);JU.AU.isAB(h)&&(h=String.instantialize(h));d=" data "+JU.PT.esc(d)+h+"end "+JU.PT.esc(d);f=JU.PT.rep(f,"/*file*/"+JU.PT.esc(e),d)}null!=c.linkedMesh&&(f+=" LINK");"lcaoCartoon"===this.myType&&0<=c.atomIndex&&(f+=" ATOMINDEX "+c.atomIndex);J.shape.Shape.appendCmd(a,f);e=this.myType+" ID "+JU.PT.esc(c.thisID);null!=c.jvxlData.thisSet&&!c.jvxlData.thisSet.isEmpty()&&J.shape.Shape.appendCmd(a,e+(1==c.jvxlData.thisSet.cardinality()?" set "+(c.jvxlData.thisSet.nextSetBit(0)+
1):" subset "+c.jvxlData.thisSet));null!=c.mat4&&!c.isModelConnected&&J.shape.Shape.appendCmd(a,e+" move "+JU.Escape.matrixToScript(c.mat4));0!=c.scale3d&&J.shape.Shape.appendCmd(a,e+" scale3d "+c.scale3d);-2147483648!=c.jvxlData.slabValue&&J.shape.Shape.appendCmd(a,e+" slab "+c.jvxlData.slabValue);null!=c.slabOptions&&J.shape.Shape.appendCmd(a,c.slabOptions.toString());if("#"!=f.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),f=c.isColorSolid&&null!=c.pcs,c.isColorSolid&&0==c.colorType&&!c.colorsExplicit&&!f?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&&c.vertexColorMap!==c.pymolVertexColorMap))for(var j,c=c.vertexColorMap.entrySet().iterator();c.hasNext()&&((j=c.next())||1);)f=j.getValue(),f.isEmpty()||J.shape.Shape.appendCmd(a,"color "+this.myType+" "+JU.Escape.eBond(f)+" "+j.getKey())}},"JU.SB,~N");e(d,"getScriptBitSets",function(a,b){this.script=a;var c;this.iHaveModelIndex=!1;this.modelIndex=-1;if(null!=a&&0<=(c=a.indexOf("MODEL({"))){var f=a.indexOf("})",c);0<
f&&(c=JU.BS.unescape(a.substring(c+3,f+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;f=a.indexOf("})",c);if(0>f)return!1;c=JU.BS.unescape(a.substring(c+2,f+2));null==b?this.sg.setProp("select",c,null):b[0]=c;if(0>(c=a.indexOf("({",f)))return!0;f=a.indexOf("})",c);if(0>f)return!1;c=JU.BS.unescape(a.substring(c+1,f+1));null==b?this.sg.setProp("ignore",c,null):b[1]=c;if((c=a.indexOf("/({",
f))==f+2){if(0>(f=a.indexOf("})",c)))return!1;c=JU.BS.unescape(a.substring(c+3,f+1));null==b?this.ms.setTrajectoryBs(c):b[2]=c}return!0},"~S,~A");e(d,"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(d,"getCapSlabObject",function(a,b){try{if(0==a.indexOf("array")){var c=JU.PT.split(a.substring(6,
a.length-1),",");return JU.GData.getSlabObjectType(1812599299,B(-1,[JU.Escape.uP(c[0]),JU.Escape.uP(c[1]),JU.Escape.uP(c[2]),JU.Escape.uP(c[3])]),b,null)}var f=JU.Escape.uP(a);if(Y(f,"JU.P4"))return JU.GData.getSlabObjectType(134217750,f,b,null)}catch(d){if(!$(d,Exception))throw d;}return null},"~S,~B");e(d,"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(d,"initState",function(){this.associateNormals=!0;this.sg.initState()});e(d,"setMeshI",function(){this.thisMesh.visible=!0;this.thisMesh.modelIndex=0<=(this.thisMesh.atomIndex=
this.atomIndex)?this.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(d,"discardTempData",function(a){a&&(this.title=null,null!=this.thisMesh&&(this.thisMesh.surfaceSet=null))},"~B");e(d,"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(d,"drawLcaoCartoon",function(a,b,c,f,d){var e=this.sg.setLcao(),h=0<=e.indexOf("anti-sp");h&&(e=e.substring(5));var j=c.x+c.y+c.z;this.defaultColix=JU.C.getColix(this.sg.params.colorPos);var g=JU.C.getColix(this.sg.params.colorNeg);d&&(d=g,g=this.defaultColix,this.defaultColix=d);d=new JU.V3;var k=0<e.length&&"-"==e.charAt(0);k&&(e=e.substring(1));k=k?-1:1;d.cross(a,b);if(0!=j){var r=new JU.A4;0!=c.x?r.setVA(b,j):0!=c.y?r.setVA(d,j):r.setVA(a,
j);c=(new JU.M3).setAA(r);c.rotate(b);c.rotate(d);c.rotate(a)}null==this.thisMesh&&0==this.nLCAO&&(this.nLCAO=this.meshCount);c=null==this.thisMesh?(0<f?"lp":"lcao")+ ++this.nLCAO+"_"+e:this.thisMesh.thisID;null==this.thisMesh&&this.allocMesh(c,null);e.equals("px")?(this.thisMesh.thisID+="a",j=this.thisMesh,this.createLcaoLobe(b,k,f),0<f||(this.setProperty("thisID",c+"b",null),this.createLcaoLobe(b,-k,0),this.thisMesh.colix=g,this.linkedMesh=this.thisMesh.linkedMesh=j)):e.equals("py")?(this.thisMesh.thisID+=
"a",j=this.thisMesh,this.createLcaoLobe(d,k,f),0<f||(this.setProperty("thisID",c+"b",null),this.createLcaoLobe(d,-k,0),this.thisMesh.colix=g,this.linkedMesh=this.thisMesh.linkedMesh=j)):(j=this.thisMesh,e.equals("pz")?(j.thisID+="a",this.createLcaoLobe(a,k,f),0<f||(this.setProperty("thisID",c+"b",null),this.createLcaoLobe(a,-k,0),this.thisMesh.colix=g,this.linkedMesh=this.thisMesh.linkedMesh=j)):e.equals("pza")||0==e.indexOf("sp")||0==e.indexOf("d")||0==e.indexOf("lp")?(this.createLcaoLobe(a,k,f),
h&&0==f&&(j.thisID+="a",this.setProperty("thisID",c+"b",null),this.createLcaoLobe(a,-k/2,0),this.thisMesh.colix=g,this.linkedMesh=this.thisMesh.linkedMesh=j)):e.equals("pzb")?this.createLcaoLobe(a,-k,f):e.equals("pxa")?this.createLcaoLobe(b,k,f):e.equals("pxb")?this.createLcaoLobe(b,-k,f):e.equals("pya")?this.createLcaoLobe(d,k,f):e.equals("pyb")?this.createLcaoLobe(d,-k,f):e.equals("spacefill")||e.equals("cpk")?this.createLcaoLobe(null,2*this.ms.at[this.atomIndex].getRadius(),f):this.createLcaoLobe(null,
1,f))},"JU.V3,JU.V3,JU.V3,~N,~B");e(d,"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");m(d,"invalidateTriangles",function(){this.thisMesh.invalidatePolygons()});
m(d,"setOutputChannel",function(a,b){a.setOutputChannel(b)},"javajs.api.GenericBinaryDocument,JU.OC");m(d,"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=ea(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");m(d,"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.oabc=this.sg.getOriginVaVbVc();this.thisMesh.calculatedArea=null;this.thisMesh.calculatedVolume=
null;this.thisMesh.probeValues=this.sg.params.probeValues;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});m(d,"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(d,"setBsVdw",function(){null!=this.sg.bsVdw&&(null==this.thisMesh.bsVdw&&(this.thisMesh.bsVdw=new JU.BS),this.thisMesh.bsVdw.or(this.sg.bsVdw))});m(d,"calculateGeodesicSurface",function(a,b){return this.vwr.calculateSurface(a,b)},"JU.BS,~N");m(d,"getSurfacePointIndexAndFraction",
function(){return 0},"~N,~B,~N,~N,~N,JU.P3i,~N,~N,~N,~N,JU.T3,JU.V3,~B,~A");m(d,"addVertexCopy",function(a,b,c,f){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,f)},"JU.T3,~N,~N,~B");m(d,"addTriangleCheck",function(a,b,c,f,d,e,h){return 0>a||0>b||0>c||e&&!J.jvxl.data.MeshData.checkCutoff(a,b,c,this.thisMesh.vvs)?
-1:this.thisMesh.addTriangleCheck(a,b,c,f,d,h)},"~N,~N,~N,~N,~N,~B,~N");e(d,"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&&(null!=this.oldFileName&&(a=a.$replace(this.oldFileName,this.newFileName))," "==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");m(d,"addRequiredFile",function(a){a=' # /*file*/"'+
a+'"';0>this.scriptAppendix.indexOf(a)&&(this.scriptAppendix+=a)},"~S");m(d,"setRequiredFile",function(a,b){this.oldFileName=a;this.newFileName=b},"~S,~S");e(d,"setJvxlInfo",function(){if(this.sg.jvxlData!==this.jvxlData||this.sg.jvxlData!==this.thisMesh.jvxlData)this.jvxlData=this.thisMesh.jvxlData=this.sg.jvxlData});m(d,"getShapeDetail",function(){for(var a=new JU.Lst,b=0;b<this.meshCount;b++){var c=new java.util.Hashtable,f=this.isomeshes[b];null==f||(null==f.vs||0==f.vc&&0==f.pc)||(this.addMeshInfo(f,
c),a.addLast(c))}return a});e(d,"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");
m(d,"getPlane",function(){return null},"~N");m(d,"getValue",function(){return 0},"~N,~N,~N,~N");m(d,"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.hoverOnPt(a,b,c,this.pickedMesh.thisID,this.pickedPt);return!0},"~N,~N,JU.BS");e(d,"hoverKey",function(a,b){try{var c,f=1-1*(b-this.keyXy[1])/(this.keyXy[3]-
this.keyXy[1]);if(this.thisMesh.showContourLines){var d=this.thisMesh.getContours();if(null==d){if(null==this.thisMesh.jvxlData.contourValues)return;var e=M(Math.floor(f*this.thisMesh.jvxlData.contourValues.length));if(0>e||e>this.thisMesh.jvxlData.contourValues.length)return;c=""+this.thisMesh.jvxlData.contourValues[e]}else{e=M(Math.floor(f*d.length));if(0>e||e>d.length)return;c=""+d[e].get(2).floatValue()}}else{var h=this.thisMesh.colorEncoder.quantize(f,!0),f=this.thisMesh.colorEncoder.quantize(f,
!1);c=""+h+" - "+f}this.vwr.hoverOnPt(a,b,c,null,null)}catch(j){if(!$(j,Exception))throw j;}},"~N,~N");e(d,"findValue",function(a,b,c,f){c=100;this.vwr.gdata.isAntialiased()&&(a<<=1,b<<=1,c<<=1);for(var d=-1,e=null,h=null,j=0;j<this.meshCount;j++)if(h=this.isomeshes[j],this.isPickable(h,f)){var g=h.jvxlData.vContours,k=0>h.firstRealVertex?0:h.firstRealVertex,r=0;if(null!=g&&0<g.length){for(k=0;k<g.length;k++)for(var n=g[k],p=n.size()-1,G=6;G<p;G++){var m=n.get(G),s=this.coordinateInRange(a,b,m,c,
this.ptXY);0<=s&&(c=s,e=n,r=k,this.pickedMesh=h,this.pickedPt=m)}if(null!=e)return e.get(2).toString()+(JU.Logger.debugging?" "+r:"")}else if(null!=h.jvxlData.jvxlPlane&&null!=h.vvs){g=null==h.mat4&&0==h.scale3d?h.vs:h.getOffsetVertices(h.jvxlData.jvxlPlane);for(G=h.vc;--G>=k;)m=g[G],s=this.coordinateInRange(a,b,m,c,this.ptXY),0<=s&&(c=s,d=G,this.pickedMesh=h,this.pickedPt=m);if(-1!=d)break}else if(null!=h.vvs){if(null!=h.bsSlabDisplay)for(G=h.bsSlabDisplay.nextSetBit(0);0<=G;G=h.bsSlabDisplay.nextSetBit(G+
1)){if(g=h.pis[G],null!=g)for(r=0;3>r;r++)m=h.vs[g[r]],s=this.coordinateInRange(a,b,m,c,this.ptXY),0<=s&&(c=s,d=g[r],this.pickedMesh=h,this.pickedPt=m)}else for(G=h.vc;--G>=k;)m=h.vs[G],s=this.coordinateInRange(a,b,m,c,this.ptXY),0<=s&&(c=s,d=G,this.pickedMesh=h,this.pickedPt=m);if(-1!=d)break}}return-1==d?null:(JU.Logger.debugging?"$"+h.thisID+"["+(d+1)+"] "+h.vs[d]+": ":h.thisID+": ")+h.vvs[d]},"~N,~N,~B,JU.BS");e(d,"getCmd",function(a){var b=(new JU.SB).append("\n");this.getMeshCommand(b,a);return b.toString()},
"~N");m(d,"getValues",function(a){return null==a?null:a.getValidValues(null)},"J.shape.Mesh");m(d,"getVertices",function(a){return null==a?null:a.getValidVertices(null)},"J.shape.Mesh")});O("J.jvxl.data");L(null,"J.jvxl.data.JvxlCoder","JU.BS $.Lst $.P3 $.PT $.SB J.api.Interface J.jvxl.data.VolumeData JU.BSUtil $.C $.Escape $.Logger JV.Viewer".split(" "),function(){var d=za(J.jvxl.data,"JvxlCoder",null);d.jvxlGetFile=e(d,"jvxlGetFile",function(a,b,c,f,d,e,h,j){null!=h&&0<=h.indexOf("<jvxl")&&(h="");
J.jvxl.data.JvxlCoder.checkHaveXMLUtil();var g=new JU.SB;if("TRAILERONLY".equals(f))return JU.XmlUtil.closeTag(g,"jvxlSurfaceSet"),JU.XmlUtil.closeTag(g,"jvxl"),g.toString();var k=null!=b,r="HEADERONLY".equals(f);if(d){JU.XmlUtil.openDocument(g);JU.XmlUtil.openTagAttr(g,"jvxl",B(-1,["version","2.4","jmolVersion",a.version,"xmlns","http://jmol.org/jvxl_schema","xmlns:cml","http://www.xml-cml.org/schema"]));JU.XmlUtil.appendCdata(g,"jvxlFileTitle",null,null==a.jvxlFileTitle?"\n":"\n"+a.jvxlFileTitle);
null!=a.moleculeXml&&g.append(a.moleculeXml);var n=k?null:a.jvxlVolumeDataXml;null==n&&(n=(new J.jvxl.data.VolumeData).setVolumetricXml());g.append(n);JU.XmlUtil.openTagAttr(g,"jvxlSurfaceSet",B(-1,["count",""+(0<e?e:1)]));if(r)return g.toString()}e=k?"pmesh":null==a.jvxlPlane?"isosurface":"plane";null!=a.jvxlColorData&&0<a.jvxlColorData.length&&(e="mapped "+e);JU.XmlUtil.openTagAttr(g,"jvxlSurface",B(-1,["type",e]));g.append(J.jvxl.data.JvxlCoder.jvxlGetInfoData(a,k));J.jvxl.data.JvxlCoder.jvxlAppendCommandState(g,
j,h);if(null!=c||null!=f&&0<f.length){h=new JU.SB;null!=f&&0<f.length&&h.append(f).append("\n");if(null!=c)for(f=0;f<c.length;f++)h.append(c[f]).appendC("\n");JU.XmlUtil.appendCdata(g,"jvxlSurfaceTitle",null,h.toString())}h=new JU.SB;JU.XmlUtil.openTagAttr(h,"jvxlSurfaceData",k||null==a.jvxlPlane?null:null==a.mapLattice?B(-1,["plane",JU.Escape.eP4(a.jvxlPlane)]):B(-1,["plane",JU.Escape.eP4(a.jvxlPlane),"maplattice",JU.Escape.eP(a.mapLattice)]));if(k)J.jvxl.data.JvxlCoder.appendXmlVertexOnlyData(h,
a,b,!0);else{if(null==a.jvxlPlane){if(null==a.jvxlEdgeData)return"";J.jvxl.data.JvxlCoder.appendXmlEdgeData(h,a)}J.jvxl.data.JvxlCoder.appendXmlColorData(h,a.jvxlColorData,!0,a.isJvxlPrecisionColor,a.valueMappedToRed,a.valueMappedToBlue)}k||(J.jvxl.data.JvxlCoder.appendEncodedBitSetTag(h,"jvxlInvalidatedVertexData",a.jvxlExcluded[1],-1,null),0<a.excludedVertexCount&&(J.jvxl.data.JvxlCoder.appendEncodedBitSetTag(h,"jvxlExcludedVertexData",a.jvxlExcluded[0],a.excludedVertexCount,null),J.jvxl.data.JvxlCoder.appendEncodedBitSetTag(h,
"jvxlExcludedPlaneData",a.jvxlExcluded[2],-1,null)));J.jvxl.data.JvxlCoder.appendEncodedBitSetTag(h,"jvxlExcludedTriangleData",a.jvxlExcluded[3],a.excludedTriangleCount,null);JU.XmlUtil.closeTag(h,"jvxlSurfaceData");b=h.length();g.appendSB(h);null!=a.vContours&&0<a.vContours.length&&J.jvxl.data.JvxlCoder.jvxlEncodeContourData(a.vContours,g);if(null!=a.vertexColorMap){null==a.baseColor?JU.XmlUtil.openTag(g,"jvxlVertexColorData"):JU.XmlUtil.openTagAttr(g,"jvxlVertexColorData",B(-1,["baseColor",a.baseColor]));
var p;for(c=a.vertexColorMap.entrySet().iterator();c.hasNext()&&((p=c.next())||1);)J.jvxl.data.JvxlCoder.appendEncodedBitSetTag(g,"jvxlColorMap",p.getValue(),-1,B(-1,["color",p.getKey()]));a.vertexColorMap=null;JU.XmlUtil.closeTag(g,"jvxlVertexColorData")}JU.XmlUtil.closeTag(g,"jvxlSurface");d&&(JU.XmlUtil.closeTag(g,"jvxlSurfaceSet"),JU.XmlUtil.closeTag(g,"jvxl"));return J.jvxl.data.JvxlCoder.jvxlSetCompressionRatio(g,a,b)},"J.jvxl.data.JvxlData,J.jvxl.data.MeshData,~A,~S,~B,~N,~S,~S");d.checkHaveXMLUtil=
e(d,"checkHaveXMLUtil",function(){J.jvxl.data.JvxlCoder.haveXMLUtil||(JV.Viewer.isJS&&J.api.Interface.getInterface("JU.XmlUtil",null,"show"),J.jvxl.data.JvxlCoder.haveXMLUtil=!0)});d.appendEncodedBitSetTag=e(d,"appendEncodedBitSetTag",function(a,b,c,f,d){0>f&&(f=JU.BSUtil.cardinalityOf(c));if(0!=f){var e=new JU.SB;e.append("\n ");J.jvxl.data.JvxlCoder.jvxlEncodeBitSetBuffer(c,-1,e);JU.XmlUtil.appendTagObj(a,b,B(-1,[d,"bsEncoding","base90+35","count",""+f,"len",""+c.length()]),J.jvxl.data.JvxlCoder.jvxlCompressString(e.toString(),
!0))}},"JU.SB,~S,JU.BS,~N,~A");d.jvxlSetCompressionRatio=e(d,"jvxlSetCompressionRatio",function(a,b,c){a=a.toString();b=x(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");d.appendXmlEdgeData=e(d,"appendXmlEdgeData",function(a,b){JU.XmlUtil.appendTagObj(a,"jvxlEdgeData",B(-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");d.jvxlAppendCommandState=e(d,"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")):(b=
c.indexOf("color isosurface [{"),0<=b&&(c=c.substring(0,b)),JU.XmlUtil.appendCdata(a,"jvxlIsosurfaceState",null,"\n"+c)))},"JU.SB,~S,~S");d.appendXmlColorData=e(d,"appendXmlColorData",function(a,b,c,f,d,e){var h;if(!(null==b||0>(h=b.length-1)))f&&(h/=2),JU.XmlUtil.appendTagObj(a,"jvxlColorData",B(-1,["count",""+h,"encoding",c?"base90f"+(f?"2":"1"):"none","min",""+d,"max",""+e,"data",J.jvxl.data.JvxlCoder.jvxlCompressString(b,!0)]),null)},"JU.SB,~S,~B,~B,~N,~N");d.jvxlGetInfo=e(d,"jvxlGetInfo",function(a){return J.jvxl.data.JvxlCoder.jvxlGetInfoData(a,
a.vertexDataOnly)},"J.jvxl.data.JvxlData");d.jvxlGetInfoData=e(d,"jvxlGetInfoData",function(a,b){if(null==a.jvxlSurfaceData)return"";J.jvxl.data.JvxlCoder.checkHaveXMLUtil();var c=new JU.Lst,f=a.nSurfaceInts,d=b?0:a.jvxlEdgeData.length-1,e=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",null==a.cutoffRange?""+a.cutoff:a.cutoffRange[0]+" "+a.cutoffRange[1]);J.jvxl.data.JvxlCoder.addAttrib(c,
"\n  isCutoffAbsolute",""+a.isCutoffAbsolute);J.jvxl.data.JvxlCoder.addAttrib(c,"\n  pointsPerAngstrom",""+a.pointsPerAngstrom);var h=a.jvxlSurfaceData.length+d+e+1;0<h&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  nBytesData",""+h);J.jvxl.data.JvxlCoder.addAttrib(c,"\n  isXLowToHigh",""+a.isXLowToHigh);null==a.jvxlPlane&&(J.jvxl.data.JvxlCoder.addAttrib(c,"\n  nSurfaceInts",""+f),J.jvxl.data.JvxlCoder.addAttrib(c,"\n  nBytesUncompressedEdgeData",""+d));0<e&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  nBytesUncompressedColorData",
""+e)}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);h=JU.BSUtil.cardinalityOf(a.jvxlExcluded[1]);0<h&&J.jvxl.data.JvxlCoder.addAttrib(c,"\n  nInvalidatedVertexes",""+h);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<e&&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<e&&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);null!=a.thisSet&&(f=J.jvxl.data.JvxlCoder.subsetString(a.thisSet),f.startsWith("[")?J.jvxl.data.JvxlCoder.addAttrib(c,"\n  subset",f):J.jvxl.data.JvxlCoder.addAttrib(c,"\n  set",
f));-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);f=3.4028235E38==a.mappedDataMin?0:a.mappedDataMin;d=a.isColorReversed?a.valueMappedToRed:a.valueMappedToBlue;e=a.isColorReversed?a.valueMappedToBlue:a.valueMappedToRed;null!=a.jvxlColorData&&(0<a.jvxlColorData.length&&!a.isBicolorMap)&&(J.jvxl.data.JvxlCoder.addAttrib(c,
"\n  dataMinimum",""+f),J.jvxl.data.JvxlCoder.addAttrib(c,"\n  dataMaximum",""+a.mappedDataMax),J.jvxl.data.JvxlCoder.addAttrib(c,"\n  valueMappedToRed",""+e),J.jvxl.data.JvxlCoder.addAttrib(c,"\n  valueMappedToBlue",""+d));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  jmolVersion",a.version);f=new JU.SB;JU.XmlUtil.openTagAttr(f,"jvxlSurfaceInfo",c.toArray(Array(c.size())));JU.XmlUtil.closeTag(f,"jvxlSurfaceInfo");return f.toString()},"J.jvxl.data.JvxlData,~B");d.subsetString=e(d,
"subsetString",function(a){if(1<a.cardinality()){for(var b="[ ",c=a.nextSetBit(0);0<=c;c=a.nextSetBit(c))b+=++c+" ";return b+"]"}return""+(a.nextSetBit(0)+1)},"JU.BS");d.addAttrib=e(d,"addAttrib",function(a,b,c){a.addLast(B(-1,[b,c]))},"JU.Lst,~S,~S");d.jvxlEncodeContourData=e(d,"jvxlEncodeContourData",function(a,b){JU.XmlUtil.openTagAttr(b,"jvxlContourData",B(-1,["count",""+a.length]));for(var c=0;c<a.length;c++)if(!(6>a[c].size())){var f=a[c].get(0).intValue(),d=new JU.SB;d.append("\n");var e=a[c].get(1);
J.jvxl.data.JvxlCoder.jvxlEncodeBitSetBuffer(e,f,d);JU.XmlUtil.appendTagObj(b,"jvxlContour",B(-1,["index",""+c,"value",""+a[c].get(2),"color",JU.Escape.escapeColor(a[c].get(4)[0]),"count",""+e.length(),"encoding","base90iff1","bsEncoding","base90+35c","data",J.jvxl.data.JvxlCoder.jvxlCompressString(a[c].get(5).toString(),!0)]),J.jvxl.data.JvxlCoder.jvxlCompressString(d.toString(),!0))}JU.XmlUtil.closeTag(b,"jvxlContourData")},"~A,JU.SB");d.set3dContourVector=e(d,"set3dContourVector",function(a,b,
c){if(!(6>a.size()))for(var f=a.get(5),d=a.get(1),e=0,h=f.length(),j=0,g=" ",k=" ",r=d.nextSetBit(0);0<=r;r=d.nextSetBit(r+1)){for(var n=b[r];e<h&&!JU.PT.isDigit(g=f.charAt(e++)););for(j=g.charCodeAt(0)-48;e<h&&JU.PT.isWhitespace(g=f.charAt(e++)););for(;e<h&&JU.PT.isWhitespace(k=f.charAt(e++)););var p=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(g.charCodeAt(0),35,90,0),m=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(k.charCodeAt(0),35,90,0),s,w;0==(j&1)?(s=n[1],w=j=n[2],n=n[0]):(s=n[0],w=n[1],
0!=(j&2)?(j=w,n=n[2]):(j=n[2],n=s));a.addLast(J.jvxl.data.JvxlCoder.getContourPoint(c,s,w,p));a.addLast(J.jvxl.data.JvxlCoder.getContourPoint(c,j,n,m))}},"JU.Lst,~A,~A");d.getContourPoint=e(d,"getContourPoint",function(a,b,c,f){var d=new JU.P3;d.sub2(a[c],a[b]);d.scaleAdd2(f,d,a[b]);return d},"~A,~N,~N,~N");d.appendContourTriangleIntersection=e(d,"appendContourTriangleIntersection",function(a,b,c,f){f.appendI(a);f.appendC(J.jvxl.data.JvxlCoder.jvxlFractionAsCharacter(b));f.appendC(J.jvxl.data.JvxlCoder.jvxlFractionAsCharacter(c))},
"~N,~N,~N,JU.SB");d.jvxlCreateColorData=e(d,"jvxlCreateColorData",function(a,b){if(null==b)a.jvxlColorData="";else{var c=a.colorFractionBase,f=a.colorFractionRange;(0<a.saveVertexCount?a.saveVertexCount:a.vertexCount)>b.length&&System.out.println("JVXLCODER ERROR");var d=a.isJvxlPrecisionColor;a.jvxlColorData=J.jvxl.data.JvxlCoder.jvxlEncodeColorData(b,d?a.mappedDataMin:a.valueMappedToRed,d?a.mappedDataMax:a.valueMappedToBlue,c,f,a.isTruncated,d)}},"J.jvxl.data.JvxlData,~A");d.jvxlEncodeColorData=
e(d,"jvxlEncodeColorData",function(a,b,c,f,d,e,h){for(var j=new JU.SB,g=new JU.SB,k=0,r=a.length;k<r;k++){var n=a[k];Float.isNaN(n)&&(n=b);e&&(n=0<n?0.999:-0.999);h?J.jvxl.data.JvxlCoder.jvxlAppendCharacter2(n,b,c,f,d,j,g):j.appendC(J.jvxl.data.JvxlCoder.jvxlValueAsCharacter(n,b,c,f,d))}return j.appendSB(g).appendC("\n").toString()},"~A,~N,~N,~N,~N,~B,~B");d.appendXmlVertexOnlyData=e(d,"appendXmlVertexOnlyData",function(a,b,c,f){var d=s(c.vc,0);J.jvxl.data.JvxlCoder.appendXmlTriangleData(a,c.pis,
c.pc,c.bsSlabDisplay,d,f)&&J.jvxl.data.JvxlCoder.appendXmlVertexData(a,b,d,c.vs,c.vvs,c.vc,c.polygonColorData,c.pc,c.bsSlabDisplay,b.vertexColors,0<b.jvxlColorData.length,f)},"JU.SB,J.jvxl.data.JvxlData,J.jvxl.data.MeshData,~B");d.appendXmlTriangleData=e(d,"appendXmlTriangleData",function(a,b,c,f,d,e){for(var h=new JU.SB,j=new JU.SB,g=1,k=0,r=0,n=!1,p=0,m=null!=f,s=0;s<c;)if(null==b[s]||m&&!f.get(s))s++;else{var w=b[s][k],w=0<d[w]?d[w]:d[w]=++r,x=w-g,g=w;0==x?(h.appendC("!"),n=!1):32<x?(n&&h.appendC("+"),
h.appendI(x),n=!0):-32>x?(h.appendI(x),n=!0):(h.appendC(String.fromCharCode(92+x)),n=!1);0==++k%3&&(j.appendI(b[s][3]),k=0,s++,p++)}if(0==h.length())return!0;JU.XmlUtil.appendTagObj(a,"jvxlTriangleData",B(-1,["count",""+p,"encoding","jvxltdiff","data",J.jvxl.data.JvxlCoder.jvxlCompressString(h.toString(),e)]),null);JU.XmlUtil.appendTagObj(a,"jvxlTriangleEdgeData",B(-1,["count",""+p,"encoding","jvxlsc","data",J.jvxl.data.JvxlCoder.jvxlCompressString(j.toString(),e)]),null);return!0},"JU.SB,~A,~N,JU.BS,~A,~B");
d.appendXmlVertexData=e(d,"appendXmlVertexData",function(a,b,c,f,d,e,h,j,g,k,r,n){var p=b.colorFractionBase,m=b.colorFractionRange,w,x=b.boundingBox[0],C=b.boundingBox[1],z=new JU.SB,L=new JU.SB,M=null,O=null!=g;if(0<j){O&&(j=g.cardinality());for(var O=!1,M=s(e,0),I=0;I<e;I++)0<c[I]&&(M[c[I]-1]=I)}for(I=c=0;I<e;I++)if(!O||g.get(I))c++,w=f[0==j?I:M[I]],J.jvxl.data.JvxlCoder.jvxlAppendCharacter2(w.x,x.x,C.x,p,m,z,L),J.jvxl.data.JvxlCoder.jvxlAppendCharacter2(w.y,x.y,C.y,p,m,z,L),J.jvxl.data.JvxlCoder.jvxlAppendCharacter2(w.z,
x.z,C.z,p,m,z,L);z.appendSB(L);JU.XmlUtil.appendTagObj(a,"jvxlVertexData",B(-1,["count",""+c,"min",JU.Escape.eP(x),"max",JU.Escape.eP(C),"encoding","base90xyz2","data",J.jvxl.data.JvxlCoder.jvxlCompressString(z.toString(),n)]),null);null!=h&&JU.XmlUtil.appendTagObj(a,"jvxlPolygonColorData",B(-1,["encoding","jvxlnc","count",""+j]),"\n"+h);if(r){z=new JU.SB;L=new JU.SB;if(null==k)for(I=0;I<e;I++){if(!O||g.get(I))J.jvxl.data.JvxlCoder.jvxlAppendCharacter2(d[0==j?I:M[I]],b.mappedDataMin,b.mappedDataMax,
p,m,z,L)}else{f=0;z.appendI(c).append(" ");for(I=0;I<e;I++)if(!O||g.get(I))d=k[0==j?I:M[I]],d==f?d=0:f=d,z.appendI(d),z.append(" ")}J.jvxl.data.JvxlCoder.appendXmlColorData(a,z.appendSB(L).append("\n").toString(),null==k,!0,b.valueMappedToRed,b.valueMappedToBlue)}},"JU.SB,J.jvxl.data.JvxlData,~A,~A,~A,~N,~S,~N,JU.BS,~A,~B,~B");d.jvxlFractionAsCharacter=e(d,"jvxlFractionAsCharacter",function(a){return J.jvxl.data.JvxlCoder.jvxlFractionAsCharacterRange(a,35,90)},"~N");d.jvxlFractionAsCharacterRange=
e(d,"jvxlFractionAsCharacterRange",function(a,b,c){0.9999<a?a=0.9999:Float.isNaN(a)&&(a=1.0001);a=M(Math.floor(a*c+b));return a<b?String.fromCharCode(b):92==a?"!":String.fromCharCode(a)},"~N,~N,~N");d.jvxlAppendCharacter2=e(d,"jvxlAppendCharacter2",function(a,b,c,f,d,e,h){a=b==c?a:(a-b)/(c-b);b=J.jvxl.data.JvxlCoder.jvxlFractionAsCharacterRange(a,f,d);e.appendC(b);a-=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(b.charCodeAt(0),f,d,0);h.appendC(J.jvxl.data.JvxlCoder.jvxlFractionAsCharacterRange(a*
d,f,d))},"~N,~N,~N,~N,~N,JU.SB,JU.SB");d.jvxlFractionFromCharacter=e(d,"jvxlFractionFromCharacter",function(a,b,c,f){if(a==b+c)return NaN;a<b&&(a=92);a=(a-b+f)/c;return 0>a?0:1<a?0.999999:a},"~N,~N,~N,~N");d.jvxlFractionFromCharacter2=e(d,"jvxlFractionFromCharacter2",function(a,b,c,f){a=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(a,c,f,0);b=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(b,c,f,0.5);return a+b/f},"~N,~N,~N,~N");d.jvxlValueAsCharacter=e(d,"jvxlValueAsCharacter",function(a,b,c,f,
d){return J.jvxl.data.JvxlCoder.jvxlFractionAsCharacterRange(b==c?a:(a-b)/(c-b),f,d)},"~N,~N,~N,~N,~N");d.jvxlValueFromCharacter2=e(d,"jvxlValueFromCharacter2",function(a,b,c,f,d,e){a=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter2(a,b,d,e);return f==c?a:c+a*(f-c)},"~N,~N,~N,~N,~N,~N");d.jvxlEncodeBitSet0=e(d,"jvxlEncodeBitSet0",function(a,b,c){var f=0,d=-1,e=0;0>b&&(b=a.length());for(var h=0,j=!1,g=b-1,k=0;k<b;++k)j==a.get(k)?f++:(f==d&&k!=g?e++:(0<e&&(c.appendC(" ").appendI(-e),e=0,h++),c.appendC(" ").appendI(f),
h++,d=f),f=1,j=!j);c.appendC(" ").appendI(f).appendC("\n");return h},"JU.BS,~N,JU.SB");d.jvxlEncodeBitSet=e(d,"jvxlEncodeBitSet",function(a){var b=new JU.SB;J.jvxl.data.JvxlCoder.jvxlEncodeBitSetBuffer(a,-1,b);return b.toString()},"JU.BS");d.jvxlEncodeBitSetBuffer=e(d,"jvxlEncodeBitSetBuffer",function(a,b,c){var f=0,d=0,e=!1;0>b&&(b=a.length());if(0==b)return 0;c.append("-");for(var h=0;h<b;++h)e==a.get(h)?f++:(J.jvxl.data.JvxlCoder.jvxlAppendEncodedNumber(c,f,35,90),d++,f=1,e=!e);J.jvxl.data.JvxlCoder.jvxlAppendEncodedNumber(c,
f,35,90);c.appendC("\n");return d},"JU.BS,~N,JU.SB");d.jvxlAppendEncodedNumber=e(d,"jvxlAppendEncodedNumber",function(a,b,c,f){var d=b<f;for(0==b?a.appendC(String.fromCharCode(c)):d||a.appendC(String.fromCharCode(c+f));0<b;){var e=M(b/f);b=c+b-e*f;92==b&&(b=33);a.appendC(String.fromCharCode(b));b=e}d||a.append(" ")},"JU.SB,~N,~N,~N");d.jvxlDecodeBitSetRange=e(d,"jvxlDecodeBitSetRange",function(a,b,c){for(var f=new JU.BS,d=0,e=0,h=!1,j=s(1,0);-2147483648!=(d=J.jvxl.data.JvxlCoder.jvxlParseEncodedInt(a,
b,c,j));)h&&f.setBits(e,e+d),e+=d,h=!h;return f},"~S,~N,~N");d.jvxlParseEncodedInt=e(d,"jvxlParseEncodedInt",function(a,b,c,f){var d=!1,e=0,h=f[0],j=a.length;if(0>h)return-2147483648;for(;h<j&&JU.PT.isWhitespace(a.charAt(h));)++h;if(h>=j)return-2147483648;var g=1,k=a.charAt(h).charCodeAt(0)==b+c;for(k&&h++;h<j&&!JU.PT.isWhitespace(a.charAt(h));){d=a.charAt(h).charCodeAt(0);d<b&&(d=92);e+=(d-b)*g;d=!0;++h;if(!k)break;g*=c}d||(e=-2147483648);f[0]=h;return e},"~S,~N,~N,~A");d.jvxlDecodeBitSet=e(d,"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,f=0,d=0,e=0,h=!1,g=s(1,0);;){c=0>d++?c:JU.PT.parseIntNext(a,g);if(-2147483648==c)break;0>c?(d=c,c=f):(h&&b.setBits(e,e+c),e+=c,f=c,h=!h)}return b},"~S");d.jvxlCompressString=e(d,"jvxlCompressString",function(a,b){if(0<=a.indexOf("~"))return a;for(var c=new JU.SB,f="\x00",d=!1,e=!1,h=0,g=a.length,u=0;u<=g;u++){var k=u==g?"\x00":
a.charAt(u);switch(k.charCodeAt(0)){case 10:case 13:continue;case 38:case 60:d=b;break;default:d=!1}if(k==f)++h,k="\x00";else if(0<h||e){if(4>h&&!e||" "==f||"\t"==f)for(;0<=--h;)c.appendC(f);else e?e=!1:c.appendC("~"),c.appendI(h),c.appendC(" ");h=0}"\x00"!=k&&(d?(e=!0,c.appendC("~"),f=k,k=String.fromCharCode(k.charCodeAt(0)-1)):f=k,c.appendC(k))}return c.toString()},"~S,~B");d.jvxlDecompressString=e(d,"jvxlDecompressString",function(a){if(0>a.indexOf("~"))return a;for(var b=new JU.SB,c="\x00",f=
s(1,0),d=0;d<a.length;d++){var e=a.charAt(d);if("~"==e)switch(f[0]=++d,(e=a.charAt(d)).charCodeAt(0)){case 59:case 37:f[0]++,b.appendC(c=String.fromCharCode(e.charCodeAt(0)+1));case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:d=JU.PT.parseIntNext(a,f);for(e=0;e<d;e++)b.appendC(c);d=f[0];continue;case 126:--d;break;default:JU.Logger.error("Error uncompressing string "+a.substring(0,d)+"?")}b.appendC(e);c=e}return b.toString()},"~S");d.jvxlCreateHeaderWithoutTitleOrAtoms=e(d,
"jvxlCreateHeaderWithoutTitleOrAtoms",function(a,b){J.jvxl.data.JvxlCoder.jvxlCreateHeader(a,b)},"J.jvxl.data.VolumeData,JU.SB");d.jvxlCreateHeader=e(d,"jvxlCreateHeader",function(a,b){a.setVolumetricXml();0==b.length()&&b.append("Line 1\nLine 2\n")},"J.jvxl.data.VolumeData,JU.SB");d.haveXMLUtil=!1});O("J.jvxl.data");L(["JU.M3","$.P3","$.V3"],"J.jvxl.data.VolumeData",["java.util.Hashtable","JU.SB","JU.Escape","$.Logger"],function(){var d=z(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.oabc=null;this.isSquared=this.isPeriodic=!1;this.ptTemp=this.edgeVector=
null;C(this,arguments)},J.jvxl.data,"VolumeData",null);da(d,function(){this.volumetricOrigin=new JU.P3;this.origin=w(3,0);this.volumetricVectors=Array(3);this.voxelCounts=s(3,0);this.volumetricVectorLengths=w(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});Z(d,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(d,"getVoxelData",function(){return this.voxelData});e(d,"setVoxelDataAsArray",function(a){this.voxelData=a;null!=a&&(this.sr=null)},"~A");e(d,"hasPlane",function(){return null!=this.thePlane});e(d,"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(d,"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(d,"setVolumetricOrigin",function(a,b,c){this.volumetricOrigin.set(a,b,c)},"~N,~N,~N");e(d,"getOriginFloat",function(){return this.origin});e(d,"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(d,"getVolumetricVectorLengths",function(){return this.volumetricVectorLengths});e(d,"setVolumetricVector",function(a,b,c,f){this.volumetricVectors[a].x=b;this.volumetricVectors[a].y=c;this.volumetricVectors[a].z=f;this.setUnitVectors()},
"~N,~N,~N,~N");e(d,"getVoxelCounts",function(){return this.voxelCounts});e(d,"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(d,"getVoxelDataAt",function(a){var b=M(a/this.yzCount);a-=b*this.yzCount;var c=M(a/this.voxelCounts[2]);return this.voxelData[b][c][a-c*this.voxelCounts[2]]},"~N");e(d,"getPointIndex",function(a,b,c){return a*this.yzCount+b*this.voxelCounts[2]+c},"~N,~N,~N");e(d,"getPoint",function(a,b){var c=M(a/
this.yzCount);a-=c*this.yzCount;var f=M(a/this.voxelCounts[2]);this.voxelPtToXYZ(c,f,a-f*this.voxelCounts[2],b)},"~N,JU.P3");e(d,"setVoxelData",function(a,b){var c=M(a/this.yzCount);a-=c*this.yzCount;var f=M(a/this.voxelCounts[2]);this.voxelData[c][f][a-f*this.voxelCounts[2]]=b},"~N,~N");e(d,"setVoxelMap",function(){this.voxelMap=new java.util.Hashtable;this.getYzCount()});e(d,"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($(b,
Exception))return JU.Logger.error("VolumeData error setting matrix -- bad unit vectors? "),!1;throw b;}return!0});e(d,"transform",function(a,b){this.volumetricMatrix.rotate2(a,b)},"JU.V3,JU.V3");e(d,"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(d,"calcVoxelPlaneDistance",function(a,b,c){this.voxelPtToXYZ(a,b,c,this.ptXyzTemp);return this.distancePointToPlane(this.ptXyzTemp)},"~N,~N,~N");e(d,"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(d,"isNearPlane",function(a,b,c,f){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<f},"~N,~N,~N,~N");e(d,"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(d,"voxelPtToXYZ",function(a,
b,c,f){f.scaleAdd2(a,this.volumetricVectors[0],this.volumetricOrigin);f.scaleAdd2(b,this.volumetricVectors[1],f);f.scaleAdd2(c,this.volumetricVectors[2],f)},"~N,~N,~N,JU.T3");e(d,"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.oabc=Array(4);this.oabc[0]=JU.V3.newV(this.volumetricOrigin);for(a=0;3>a;a++)b=this.oabc[a+1]=new JU.V3,b.scaleAdd2(this.voxelCounts[a]-1,this.volumetricVectors[a],b);return this.setMatrix()});e(d,"xyzToVoxelPt",function(a,b,c,f){this.ptXyzTemp.set(a,b,c);this.ptXyzTemp.sub(this.volumetricOrigin);this.inverseMatrix.rotate(this.ptXyzTemp);f.set(Math.round(this.ptXyzTemp.x),
Math.round(this.ptXyzTemp.y),Math.round(this.ptXyzTemp.z))},"~N,~N,~N,JU.T3i");e(d,"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 f,d=this.indexLower(this.ptXyzTemp.x,f=this.voxelCounts[0]-1),e=this.indexUpper(this.ptXyzTemp.x,d,f),h=this.indexLower(this.ptXyzTemp.y,
f=this.voxelCounts[1]-1),g=this.indexUpper(this.ptXyzTemp.y,h,f),c=this.indexLower(this.ptXyzTemp.z,f=this.voxelCounts[2]-1),u=this.indexUpper(this.ptXyzTemp.z,c,f);f=J.jvxl.data.VolumeData.getFractional2DValue(this.mantissa(this.ptXyzTemp.x-d),this.mantissa(this.ptXyzTemp.y-h),this.getVoxelValue(d,h,c),this.getVoxelValue(e,h,c),this.getVoxelValue(d,g,c),this.getVoxelValue(e,g,c));d=J.jvxl.data.VolumeData.getFractional2DValue(this.mantissa(this.ptXyzTemp.x-d),this.mantissa(this.ptXyzTemp.y-h),this.getVoxelValue(d,
h,u),this.getVoxelValue(e,h,u),this.getVoxelValue(d,g,u),this.getVoxelValue(e,g,u));return f+this.mantissa(this.ptXyzTemp.z-c)*(d-f)},"JU.T3,~B");e(d,"mantissa",function(a){return this.isPeriodic?a-Math.floor(a):a},"~N");e(d,"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");d.getFractional2DValue=e(d,"getFractional2DValue",function(a,b,c,f,d,e){c+=a*(f-
c);return c+b*(d+a*(e-d)-c)},"~N,~N,~N,~N,~N,~N");e(d,"indexLower",function(a,b){if(this.isPeriodic&&0<b){for(;0>a;)a+=b;for(;a>=b;)a-=b;return M(Math.floor(a))}if(0>a)return 0;var c=M(Math.floor(a));return c>b?b:c},"~N,~N");e(d,"indexUpper",function(a,b,c){return!this.isPeriodic&&0>a||b==c?b:b+1},"~N,~N,~N");e(d,"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(d,"setDataDistanceToPlane",function(a){this.setPlaneParameters(a);a=this.voxelCounts[0];var b=this.voxelCounts[1],c=this.voxelCounts[2];this.voxelData=w(a,b,c,0);for(var f=0;f<a;f++)for(var d=0;d<b;d++)for(var e=0;e<c;e++)this.voxelData[f][d][e]=this.calcVoxelPlaneDistance(f,d,e)},"JU.P4");e(d,"filterData",function(a,b){var c=!Float.isNaN(b);if(null!=this.sr)this.isSquared=a;else{var f=this.voxelCounts[0],d=this.voxelCounts[1],
e=this.voxelCounts[2];if(a)for(var h=0;h<f;h++)for(var g=0;g<d;g++)for(var u=0;u<e;u++)this.voxelData[h][g][u]*=this.voxelData[h][g][u];if(c)for(h=0;h<f;h++)for(g=0;g<d;g++)for(u=0;u<e;u++)this.voxelData[h][g][u]=b-this.voxelData[h][g][u]}},"~B,~N");e(d,"capData",function(a,b){if(null!=this.voxelData){var c=this.voxelCounts[0],f=this.voxelCounts[1],d=this.voxelCounts[2],e=JU.V3.new3(a.x,a.y,a.z);e.normalize();for(var h=0;h<c;h++)for(var g=0;g<f;g++)for(var u=0;u<d;u++){var k=this.voxelData[h][g][u]-
b;this.voxelPtToXYZ(h,g,u,this.ptXyzTemp);var r=(this.ptXyzTemp.x*e.x+this.ptXyzTemp.y*e.y+this.ptXyzTemp.z*e.z+a.w-b)/1;if(0<=r||r>k)this.voxelData[h][g][u]=r}}},"JU.P4,~N");e(d,"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(d,"setVoxelMapValue",function(a,b,c,f){null!=this.voxelMap&&this.voxelMap.put(Integer.$valueOf(this.getPointIndex(a,b,c)),Float.$valueOf(f))},"~N,~N,~N,~N");e(d,"calculateFractionalPoint",function(a,b,c,f,d,e){var h=d-f,g=(a-f)/h;this.edgeVector.sub2(c,b);e.scaleAdd2(g,this.edgeVector,b);if(null==this.sr||!this.doIterate||d==f||0.01>g||0.99<g||0.01>this.edgeVector.length())return a;b=0;this.ptTemp.setT(e);
c=this.lookupInterpolatedVoxelValue(this.ptTemp,!1);for(d=NaN;10>++b;){var u=(c-f)/h;if(0>u||1<u)break;u=(a-c)/h/2;g+=u;if(0>g||1<g)break;e.setT(this.ptTemp);d=c;if(0.005>Math.abs(u))break;this.ptTemp.scaleAdd2(u,this.edgeVector,e);c=this.lookupInterpolatedVoxelValue(this.ptTemp,!1)}return d},"~N,JU.P3,JU.P3,~N,~N,JU.P3")});O("J.jvxl.data");L(null,"J.jvxl.data.JvxlData",["JU.SB","J.jvxl.data.JvxlCoder"],function(){var d=z(function(){this.msg="";this.wasCubic=this.wasJvxl=!1;this.jvxlPlane=this.jvxlExcluded=
this.jvxlVolumeDataXml=this.jvxlColorData=this.jvxlEdgeData=this.jvxlSurfaceData=this.jvxlFileMessage=this.jvxlFileTitle=this.jvxlFileSource=null;this.isColorReversed=this.jvxlDataIsColorDensity=this.jvxlDataIs2dContour=this.jvxlDataIsColorMapped=this.isJvxlPrecisionColor=!1;this.thisSet=null;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.cutoff=this.valueMappedToBlue=this.valueMappedToRed=this.mappedDataMax=this.mappedDataMin=0;this.cutoffRange=null;this.vertexCount=this.nSurfaceInts=this.nEdges=this.nContours=this.nBytes=this.nPointsZ=this.nPointsY=this.nPointsX=this.pointsPerAngstrom=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;this.sbOut=null;C(this,arguments)},J.jvxl.data,"JvxlData",null);da(d,function(){this.jvxlExcluded=Array(4)});Z(d,function(){});e(d,"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.slabValue=-2147483648;this.rendering=this.thisSet=null;this.thisContour=-1;this.translucency=0;this.vertexColors=this.vertexColorMap=this.vContours=null;this.voxelVolume=0});e(d,"setSurfaceInfo",function(a,b,c,f){this.jvxlSurfaceData=f;this.jvxlPlane=a;this.mapLattice=b;this.nSurfaceInts=c},"JU.P4,JU.P3,~N,~S");e(d,"setSurfaceInfoFromBitSet",function(a,b){this.setSurfaceInfoFromBitSetPts(a,
b,null)},"JU.BS,JU.P4");e(d,"setSurfaceInfoFromBitSetPts",function(a,b,c){var f=new JU.SB;a=null!=b?0:J.jvxl.data.JvxlCoder.jvxlEncodeBitSetBuffer(a,this.nPointsX*this.nPointsY*this.nPointsZ,f);this.setSurfaceInfo(b,c,a,f.toString())},"JU.BS,JU.P4,JU.P3");e(d,"jvxlUpdateInfo",function(a,b){this.title=a;this.nBytes=b},"~A,~N");d.updateSurfaceData=e(d,"updateSurfaceData",function(a,b,c,f,d){if(0==a.length)return"";a=a.toCharArray();for(var e=0,h=0;e<c;e+=f,h++)Float.isNaN(b[e])&&(a[h]=d);return String.copyValueOf(a)},
"~S,~A,~N,~N,~S")});O("J.jvxl.data");L(["JU.MeshSurface"],"J.jvxl.data.MeshData",["java.util.Arrays","JU.AU","$.BS","$.V3","JU.BSUtil"],function(){var d=z(function(){this.setsSuccessful=!1;this.vertexIncrement=1;this.polygonColorData=null;na("J.jvxl.data.MeshData.SSet")||J.jvxl.data.MeshData.$MeshData$SSet$();na("J.jvxl.data.MeshData.SortSet")||J.jvxl.data.MeshData.$MeshData$SortSet$();C(this,arguments)},J.jvxl.data,"MeshData",JU.MeshSurface);e(d,"addVertexCopy",function(a,b,c,f){0>c&&(this.vertexIncrement=
-c);return this.addVCVal(a,b,f)},"JU.T3,~N,~N,~B");e(d,"getSurfaceSet",function(){return null==this.surfaceSet?this.getSurfaceSetForLevel(0):this.surfaceSet});e(d,"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],f=this.findSet(c[0]),d=this.findSet(c[1]),e=this.findSet(c[2]);0>f&&0>d&&0>e?this.createSet(c[0],c[1],c[2]):f==
d&&d==e||(0<=f?(this.surfaceSet[f].set(c[1]),this.surfaceSet[f].set(c[2]),0<=d&&d!=f&&this.mergeSets(f,d),0<=e&&(e!=f&&e!=d)&&this.mergeSets(f,e)):0<=d?(this.surfaceSet[d].set(c[0]),this.surfaceSet[d].set(c[2]),0<=e&&e!=d&&this.mergeSets(d,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++;f=Array(this.surfaceSet.length);for(b=c=0;b<this.nSets;b++)null!=this.surfaceSet[b]&&(f[c++]=this.surfaceSet[b]);this.nSets=c;this.surfaceSet=
f;!this.setsSuccessful&&2>a&&this.getSurfaceSetForLevel(a+1);if(0==a){a=Array(this.nSets);for(b=0;b<this.nSets;b++)a[b]=wa(J.jvxl.data.MeshData.SSet,this,null,this.surfaceSet[b]);java.util.Arrays.sort(a,wa(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(d,"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 f=c=0;c<this.nSets;c++)null!=this.surfaceSet[c]&&(a[f++]=this.surfaceSet[c]);this.surfaceSet=a;this.nSets-=b}else if(a)return;this.vertexSets=s(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(d,"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(d,"createSet",function(a,b,c){var f;for(f=0;f<this.nSets&&null!=this.surfaceSet[f];f++);f==this.surfaceSet.length&&(this.surfaceSet=JU.AU.ensureLength(this.surfaceSet,this.surfaceSet.length+100));this.surfaceSet[f]=new JU.BS;this.surfaceSet[f].set(a);this.surfaceSet[f].set(b);this.surfaceSet[f].set(c);f==this.nSets&&this.nSets++},"~N,~N,~N");e(d,"mergeSets",function(a,b){this.surfaceSet[a].or(this.surfaceSet[b]);this.surfaceSet[b]=null},"~N,~N");e(d,"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");d.checkCutoff=e(d,"checkCutoff",function(a,b,c,f){if(0>a||0>b||0>c)return!1;a=f[a];b=f[b];c=f[c];return 0<=a&&0<=b&&0<=c||0>=a&&0>=b&&0>=c},"~N,~N,~N,~A");d.calculateVolumeOrArea=e(d,"calculateVolumeOrArea",function(a,b,c,f){(f||0>=a.nSets)&&a.getSurfaceSet();var d=null!=b&&1==b.cardinality(),e=d||0>=a.nSets?1:a.nSets;f=Ka(e,0);for(var h=new JU.V3,g=new JU.V3,u=new JU.V3,k=a.pc;0<=
--k;)if(null!=a.setABC(k)){var r=0>=a.nSets?0:a.vertexSets[a.iA];if(null==b||b.get(r))c?(h.sub2(a.vs[a.iB],a.vs[a.iA]),g.sub2(a.vs[a.iC],a.vs[a.iA]),u.cross(h,g),f[d?0:r]+=u.length()):(h.setT(a.vs[a.iB]),g.setT(a.vs[a.iC]),u.cross(h,g),g.setT(a.vs[a.iA]),f[d?0:r]+=g.dot(u))}a=c?2:6;for(k=0;k<e;k++)f[k]/=a;if(d)return Float.$valueOf(f[0]);if(null!=b){b.and(JU.BSUtil.newBitSet2(0,f.length));a=Ka(b.cardinality(),0);c=0;for(k=b.nextSetBit(0);0<=k;k=b.nextSetBit(k+1))a[c++]=f[k];f=a}return f},"J.jvxl.data.MeshData,JU.BS,~B,~B");
e(d,"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(d,"invalidateVertices",function(a){for(var b=a.nextSetBit(0);0<=b;b=a.nextSetBit(b+1))this.vvs[b]=NaN},"JU.BS");d.$MeshData$SSet$=function(){var a=z(function(){oa(this,arguments);this.bs=null;this.n=0;C(this,arguments)},J.jvxl.data.MeshData,"SSet",null);Z(a,function(a){this.bs=a;this.n=a.cardinality()},"JU.BS")};d.$MeshData$SortSet$=function(){var a=
z(function(){oa(this,arguments);C(this,arguments)},J.jvxl.data.MeshData,"SortSet",null,java.util.Comparator);m(a,"compare",function(a,c){return a.n>c.n?-1:a.n<c.n?1:0},"J.jvxl.data.MeshData.SSet,J.jvxl.data.MeshData.SSet")}});O("J.jvxl.readers");L(null,"J.jvxl.readers.XmlReader",["JU.P3","$.PT","$.SB","JU.Escape"],function(){var d=z(function(){this.line=this.br=null;C(this,arguments)},J.jvxl.readers,"XmlReader",null);Z(d,function(a){this.br=a},"java.io.BufferedReader");e(d,"getLine",function(){return this.line});
e(d,"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(d,"skipTag",function(a){this.skipTo("</"+a+">")},"~S");e(d,"getXmlData",function(a,b,c,f){return this.getXmlDataLF(a,b,c,f,!1,null)},"~S,~S,~B,~B");e(d,"getXmlDataLF",function(a,b,c,f,d,e){var h="</"+a+">";a="<"+a;if(null==b){b=new JU.SB;null==this.line&&
(this.line=this.br.readLine());for(;null!=this.line&&0>this.line.indexOf(a);)this.line=this.br.readLine();if(null==this.line)return null;b.append(this.line);d&&b.append("\n");var g=!1,u=this.line.indexOf("/>"),k=this.line.indexOf(">");if(0>k||u==k-1)g=f;for(;0>this.line.indexOf(h)&&(!g||0>this.line.indexOf("/>"));)b.append(this.line=this.br.readLine()),d&&b.append("\n");b=b.toString()}return J.jvxl.readers.XmlReader.extractTag(b,a,h,c,e)},"~S,~S,~B,~B,~B,~A");d.extractTagOnly=e(d,"extractTagOnly",
function(a,b){return J.jvxl.readers.XmlReader.extractTag(a,"<"+b+">","</"+b+">",!1,null)},"~S,~S");d.extractTag=e(d,"extractTag",function(a,b,c,f,d){b=a.indexOf(b,null==d?0:d[0]);null!=d&&(d[0]=a.length);if(0>b)return"";var e=a.indexOf(c,b);0>e&&(e=a.indexOf("/>",b),c="/>");if(0>e)return"";if(f)return e+=c.length,null!=d&&(d[0]=e),a.substring(b,e);for(c=!1;b<e;b++)if('"'==(f=a.charAt(b)))c=!c;else if(c&&"\\"==f)b++;else if(!c&&(">"==f||"/"==f))break;if(b>=e)return"";for(;JU.PT.isWhitespace(a.charAt(++b)););
null!=d&&(d[0]=e);return J.jvxl.readers.XmlReader.unwrapCdata(a.substring(b,e))},"~S,~S,~S,~B,~A");d.unwrapCdata=e(d,"unwrapCdata",function(a){return a.startsWith("<![CDATA[")&&a.endsWith("]]\x3e")?JU.PT.rep(a.substring(9,a.length-3),"]]]]\x3e<![CDATA[>","]]\x3e"):a},"~S");d.getXmlAttrib=e(d,"getXmlAttrib",function(a,b){var c=s(1,0),f=J.jvxl.readers.XmlReader.setNext(a,b,c,1);if(2>f||2>(f=J.jvxl.readers.XmlReader.setNext(a,'"',c,0)))return"";c=J.jvxl.readers.XmlReader.setNext(a,'"',c,-1);return 0>=
c?"":a.substring(f,c)},"~S,~S");e(d,"getXmlPoint",function(a,b){var c=J.jvxl.readers.XmlReader.getXmlAttrib(a,b).$replace("(","{").$replace(")","}"),c=JU.Escape.uP(c);return Y(c,"JU.P3")?c:new JU.P3},"~S,~S");d.setNext=e(d,"setNext",function(a,b,c,f){var d=c[0];if(0>d||0>(d=a.indexOf(b,c[0])))return-1;d+=b.length;c[0]=d+f;return 0<f&&d<a.length&&"="!=a.charAt(d)?J.jvxl.readers.XmlReader.setNext(a,b,c,f):c[0]},"~S,~S,~A,~N");e(d,"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(d,"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")});O("J.jvxl.readers");L(["JU.P3","$.V3"],"J.jvxl.readers.SurfaceGenerator","JU.AU $.BS $.Measure $.P4 $.PT $.Rdr $.SB J.jvxl.data.JvxlCoder $.JvxlData $.MeshData $.VolumeData J.jvxl.readers.Parameters $.SurfaceReader JU.Logger JV.FileManager".split(" "),
function(){var d=z(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;C(this,arguments)},J.jvxl.readers,"SurfaceGenerator",null);da(d,function(){this.vAB=new JU.V3;this.vNorm=new JU.V3;this.ptRef=JU.P3.new3(0,0,1E15)});Z(d,function(a,b,c,f){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==f?new J.jvxl.data.JvxlData:f;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(d,"setJvxlData",function(a){this.jvxlData=a;null!=a&&(a.version=this.version)},"J.jvxl.data.JvxlData");e(d,"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(),Y(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=B(-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 f=0;f<this.params.title.length;f++)0<this.params.title[f].length&&JU.Logger.info(this.params.title[f]);return!0}if("sigma"===a)return this.params.cutoff=this.params.sigma=b.floatValue(),this.params.cutoffRange=null,this.params.cutoffAutomatic=!1,!0;if("cutoff"===a)return this.params.cutoff=b.floatValue(),this.params.cutoffRange=null,this.params.isPositiveOnly=!1,this.params.cutoffAutomatic=!1,!0;if("cutoffPositive"===
a)return this.params.cutoff=b.floatValue(),this.params.cutoffRange=null,this.params.isPositiveOnly=!0,this.params.isCutoffAbsolute=!1,this.params.cutoffAutomatic=!1,!0;if("cutoffRange"===a)return this.params.cutoffRange=b,this.params.cutoff=this.params.cutoffRange[0],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("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=
!this.params.isPositiveOnly,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(Y(b,"JU.P3")){var c=this.params.contourIncrements=b,f=c.x,d=c.y,e=c.z;0>=e&&(e=1);for(var c=0,h=f;h<=d+e/10;h+=e,c++);this.params.contoursDiscrete=w(c,0);h=f;for(f=0;f<c;f++,h+=e)this.params.contoursDiscrete[f]=h;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=1208,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(Y(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=w(-1,[3,2,0,15,0]),this.surfaceReader=this.newReader("IsoShapeReader"),this.generateSurface(),!0;if("rad"===
a)return this.params.setRadical(b),this.readerData=w(-1,[3,2,0,15,0]),this.surfaceReader=this.newReader("IsoShapeReader"),this.generateSurface(),!0;if("lobe"===a)return this.params.setLobe(b),this.readerData=w(-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=w(-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,f=null,Y(b,Integer)?c=b.intValue():f=b,this.params.setMO(c,f),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("filesData"===a)return this.params.filesData=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(d,"newReader",function(a){a=J.jvxl.readers.SurfaceGenerator.getInterface(a);null!=a&&a.init(this);return a},"~S");e(d,"newReaderBr",function(a,b){var c=J.jvxl.readers.SurfaceGenerator.getInterface(a);null!=c&&c.init2(this,b);return c},"~S,java.io.BufferedReader");
d.getInterface=e(d,"getInterface",function(a){try{var b=ib._4Name("J.jvxl.readers."+a);return null==b?null:b.newInstance()}catch(c){if($(c,Exception))return JU.Logger.error("Interface.java Error creating instance for "+a+": \n"+c.toString()),null;throw c;}},"~S");e(d,"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(d,"processState",
function(){1==this.params.state&&null!=this.params.thePlane&&this.params.state++;2<=this.params.state?this.mapSurface():this.generateSurface()});e(d,"setReader",function(){this.readerData=null;if(null!=this.surfaceReader)return!this.surfaceReader.vertexDataOnly;switch(this.params.dataType){case 1207:this.surfaceReader=this.newReader("IsoPlaneReader");break;case 1208: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 1334:this.surfaceReader=this.newReader("IsoIntersectFileReader");break;case 1333:this.surfaceReader=this.newReader("IsoIntersectAtomReader");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(d,"generateSurface",function(){if(2==++this.params.state){this.setReader();null==this.params.sbOut&&(this.params.sbOut=new JU.SB);this.jvxlData.sbOut=this.params.sbOut;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)){if(null!=this.params.probes)for(var b=this.params.probeValues.length;0<=--b;)this.params.probeValues[b]=this.surfaceReader.getValueAtPoint(this.params.probes[b],!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);null!=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.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.params.cutoffRange=
null,this.surfaceReader.closeReader()}});e(d,"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.params.cutoffRange=null;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(1207==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(d,"colorIsosurface",function(){this.surfaceReader.colorIsosurface();this.surfaceReader.jvxlUpdateInfo();this.surfaceReader.updateTriangles();this.surfaceReader.discardTempData(!0);null!=this.meshDataServer&&this.meshDataServer.notifySurfaceMappingCompleted()});e(d,"getProperty",function(a,b){return"jvxlFileData"===a?J.jvxl.data.JvxlCoder.jvxlGetFile(this.jvxlData,
null,this.params.title,"",!0,b,null,null):"jvxlFileInfo"===a?J.jvxl.data.JvxlCoder.jvxlGetInfo(this.jvxlData):null},"~S,~N");e(d,"setFileData",function(a,b){var c=this.fileType;this.fileType=null;if(Y(b,"java.util.Map")){var f=b;if(f.containsKey("__pymolSurfaceData__"))return this.readerData=f,this.newReaderBr("PyMOLMeshReader",null);b=f.get("volumeData")}if(Y(b,"J.jvxl.data.VolumeData"))return this.volumeDataTemp=b,this.newReader("VolumeDataReader");f=null;"string"==typeof b&&(f=b,b=JU.Rdr.getBR(b));
if(Y(b,Array)){for(var f=b[0],d=Array(f.length),e=0;e<f.length;e++)this.fileType=c,d[e]=this.setFileData(a,f[e]);b[0]=d;this.readerData=b;return this.newReader("IsoIntersectGridReader")}d=b;null==c&&(c=JV.FileManager.determineSurfaceFileType(d));if(null!=c&&c.startsWith("UPPSALA")){e=this.params.fileName;e=e.substring(0,e.indexOf("/",10));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{d=JU.Rdr.getBufferedReader(b,null)}catch(h){if(!$(h,Exception))throw h;}c=JV.FileManager.determineSurfaceFileType(d)}null==c&&(c="UNKNOWN");JU.Logger.info("data file type was determined to be "+c);if(c.equals("Jvxl+"))return this.newReaderBr("JvxlReader",d);this.readerData=B(-1,[this.params.fileName,f]);0<="MRC DELPHI DSN6".indexOf(c.toUpperCase())&&(c+="Binary");return this.newReaderBr(c+"Reader",d)},"JV.Viewer,~O");e(d,"getReaderData",function(){var a=this.readerData;this.readerData=
null;return a});e(d,"initializeIsosurface",function(){this.params.initialize();this.colorPtr=0;this.marchingSquares=this.surfaceReader=null;this.initState()});e(d,"initState",function(){this.params.state=1;this.params.dataType=this.params.surfaceType=0});e(d,"setLcao",function(){this.params.colorPos=this.params.colorPosLCAO;this.params.colorNeg=this.params.colorNegLCAO;return this.params.lcaoType});e(d,"getFunctionZfromXY",function(){for(var a=this.params.functionInfo.get(1),b=s(3,0),c=s(3,0),f=Array(3),
d=0;3>d;d++){var e=this.params.functionInfo.get(d+2);b[d]=Math.abs(x(e.x));f[d]=JU.V3.new3(e.y,e.z,e.w)}for(var e=b[0],b=b[1],h=new JU.P3,g=new JU.P3,u=new JU.P3,k=new JU.P3,r=this.params.functionInfo.get(5),n=w(e,b,0),p,d=0;d<e;d++)for(var m=0;m<b;m++){h.scaleAdd2(d,f[0],a);h.scaleAdd2(m,f[1],h);var z=J.jvxl.readers.SurfaceGenerator.findNearestThreePoints(h.x,h.y,r,c);g.set((p=r[c[0]])[0],p[1],p[2]);1E-5>z?h.z=p[2]:(u.set((p=r[c[1]])[0],p[1],p[2]),k.set((p=r[c[2]])[0],p[1],p[2]),h.z=this.distanceVerticalToPlane(h.x,
h.y,g,u,k));n[d][m]=h.z}this.params.functionInfo.set(5,n)});e(d,"distanceVerticalToPlane",function(a,b,c,f,d){c=JU.Measure.getDirectedNormalThroughPoints(c,f,d,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");d.findNearestThreePoints=e(d,"findNearestThreePoints",function(a,b,c,f){var d,e,h,g,u,k,r;u=k=r=-1;e=h=g=3.4028235E38;for(var n=c.length;0<=--n;)d=(d=c[n][0]-a)*d+(d=c[n][1]-b)*d,d<e?(g=h,h=e,e=d,r=k,k=u,u=n):d<h?(g=h,h=d,r=k,k=
n):d<g&&(g=d,r=n);f[0]=u;f[1]=k;f[2]=r;return e},"~N,~N,~A,~A");e(d,"addRequiredFile",function(a){null!=this.meshDataServer&&this.meshDataServer.addRequiredFile(a)},"~S");e(d,"setRequiredFile",function(a,b){null!=this.meshDataServer&&this.meshDataServer.setRequiredFile(a,b)},"~S,~S");e(d,"log",function(a){null==this.atomDataServer?System.out.println(a):this.atomDataServer.log(a)},"~S");e(d,"setOutputChannel",function(a,b){null!=this.meshDataServer&&this.meshDataServer.setOutputChannel(a,b)},"javajs.api.GenericBinaryDocument,JU.OC");
e(d,"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(d,"getOriginVaVbVc",function(){return null==this.surfaceReader.volumeData?null:this.surfaceReader.volumeData.oabc})});O("J.jvxl.readers");L(null,"J.jvxl.readers.Parameters","java.util.Hashtable JU.A4 $.Lst $.M3 $.P3 $.P4 $.V3 JU.Escape $.Logger".split(" "),function(){var d=z(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.cutoff=3.4028235E38;this.cutoffRange=null;this.sigma=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.probes=null;this.isModelConnected=!1;this.sbOut=this.probeValues=this.filesData=this.surfaceAtoms=null;C(this,arguments)},J.jvxl.readers,"Parameters",null);da(d,function(){this.anisotropy=w(3,0)});e(d,"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.filesData=null;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.probeValues=this.probes=null;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(d,"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(d,"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(d,"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 f=JU.V3.new3(0,0,1);b.add(f);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(d,"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(d,"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(d,"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(d,"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(d,"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(d,"getScriptParams",function(){return" center "+JU.Escape.eP(this.center)+(Float.isNaN(this.scale)?"":" scale "+this.scale)});e(d,"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(d,"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(d,"setLcao",function(a,b){this.lcaoType=a;1==b&&(this.colorPosLCAO=this.colorNegLCAO);this.isSilent=!this.logMessages},
"~S,~N");e(d,"setSolvent",function(a,b){this.isEccentric=this.isAnisotropic=!1;this.solventRadius=Math.abs(b);this.dataType=null!=this.intersection?1333:"nomap"===a?1207:"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 1207:this.calculationType="unmapped plane";break;case 1203:this.calculationType=
"molecular surface with radius "+this.solventRadius;0==this.minSet&&(this.minSet=50);break;case 1195:this.calculationType="solvent-excluded surface with radius "+this.solventRadius;0==this.minSet&&(this.minSet=50);break;case 1196:this.calculationType="solvent-accessible surface with radius "+this.solventRadius,0==this.minSet&&(this.minSet=50)}switch(this.dataType){case 1207: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(d,"setFunctionXY",function(a){this.dataType=8;this.functionInfo=a;this.cutoff=1.4E-45;this.isEccentric=this.isAnisotropic=!1},"JU.Lst");e(d,"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(d,"setAtomicOrbital",function(a){this.dataType=1294;this.setEccentricity(JU.P4.new4(0,0,1,1));this.psi_n=x(a[0]);this.psi_l=x(a[1]);this.psi_m=x(a[2]);this.psi_Znuc=a[3];this.psi_monteCarloCount=x(a[4]);this.distance=a[5];if(0!=this.distance||null!=this.thePlane)this.allowVolumeRender=!1;this.randomSeed=x(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(d,"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(d,"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=
w(-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(d,"setMO",function(a,b){this.isModelConnected=!0;this.qm_moLinearCombination=b;this.qm_moNumber=null==b?Math.abs(a):x(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=B(-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(d,"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(d,"addSlabInfo",function(a){null==this.slabInfo&&(this.slabInfo=new JU.Lst);this.slabInfo.addLast(a)},"~A");e(d,"isInsideOut",function(){return this.insideOut!=this.dataXYReversed});e(d,"isFullyLit",function(){return null!=this.thePlane||this.fullyLit})});O("J.jvxl.readers");L(["J.jvxl.api.VertexDataServer","JU.P3"],"J.jvxl.readers.SurfaceReader","JU.AU $.BS J.jvxl.calc.MarchingCubes $.MarchingSquares J.jvxl.data.JvxlCoder $.MeshData JU.BoxInfo $.C $.ColorEncoder $.Escape $.Logger".split(" "),
function(){var d=z(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.jvxlCutoff=0;this.jvxlCutoffRange=null;this.jvxlNSurfaceInts=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;C(this,arguments)},J.jvxl.readers,"SurfaceReader",null,J.jvxl.api.VertexDataServer);da(d,function(){this.ptTemp=new JU.P3});Z(d,function(){});e(d,"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(d,"setOutputChannel",function(){},"JU.OC");e(d,"newVoxelDataCube",function(){this.volumeData.setVoxelDataAsArray(this.voxelData=w(this.nPointsX,this.nPointsY,this.nPointsZ,0))});e(d,"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(d,"jvxlUpdateInfo",function(){this.jvxlData.jvxlUpdateInfo(this.params.title,this.nBytes)});e(d,"readAndSetVolumeParameters",function(a){return!this.readVolumeParameters(a)?!1:this.vertexDataOnly?!0:this.volumeData.setUnitVectors()},"~B");e(d,"createIsosurface",function(a){this.resetIsosurface();this.params.showTiming&&JU.Logger.startTimer("isosurface creation");this.jvxlData.cutoff=
NaN;this.jvxlData.cutoffRange=null;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)this.jvxlData.jvxlFileTitle="",this.jvxlData.jvxlFileSource=null,this.jvxlData.jvxlFileMessage=null;else{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);this.jvxlData.jvxlFileSource=this.params.fileName}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=B(-1,[this.xyzMin,this.xyzMax]);this.jvxlData.dataMin=this.dataMin;this.jvxlData.dataMax=this.dataMax;this.jvxlData.cutoffRange=this.isJvxl?this.jvxlCutoffRange:this.params.cutoffRange;this.jvxlData.cutoff=null!=this.jvxlCutoffRange?this.jvxlData.cutoffRange[0]:
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(d,"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(d,"discardTempData",function(a){this.discardTempDataSR(a)},"~B");e(d,"discardTempDataSR",function(a){a&&(this.voxelData=null,this.marchingCubes=this.sg.marchingSquares=this.marchingSquares=
null)},"~B");e(d,"initializeVolumetricData",function(){this.nPointsX=this.voxelCounts[0];this.nPointsY=this.voxelCounts[1];this.nPointsZ=this.voxelCounts[2];this.setVolumeDataV(this.volumeData)});e(d,"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($(b,Exception))return JU.Logger.error(b.toString()),!1;throw b;
}return!0},"~B");e(d,"gotoData",function(){},"~N,~N");e(d,"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=ea(a,0);if(null==c||c.length<a)this.meshData.vvs=w(a,0);for(c=0;c<a;c++)b[c]=JU.C.getColix(this.jvxlData.vertexColors[c]);return"-"});m(d,"getPlane",function(a){return this.getPlaneSR(a)},"~N");e(d,"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(d,"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]=w(this.yzCount,0);this.yzPlanes[1]=w(this.yzCount,0)});m(d,"getValue",function(a,b,c,f){return this.getValue2(a,b,c,f)},"~N,~N,~N,~N");e(d,"getValue2",function(a,b,c,f){return null==this.yzPlanes?this.voxelData[a][b][c]:
this.yzPlanes[a%2][f]},"~N,~N,~N,~N");e(d,"generateSurfaceData",function(){this.edgeData="";if(this.vertexDataOnly)try{this.readSurfaceData(!1)}catch(a){if($(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(d,"postProcessVertices",function(){});m(d,"getSurfacePointIndexAndFraction",function(a,b,c,f,d,e,h,g,u,k,r,n,p,m){b=this.getSurfacePointAndFraction(a,b,u,k,r,n,c,f,d,h,g,m,this.ptTemp);if(null!=this.marchingSquares&&this.params.isContoured)return this.marchingSquares.addContourVertex(this.ptTemp,a);a=0<this.assocCutoff?m[0]<
this.assocCutoff?h:m[0]>1-this.assocCutoff?g:-1:-1;0<=a&&(a=this.marchingCubes.getLinearOffset(c,f,d,a));a=this.addVertexCopy(this.ptTemp,b,a,!0);0<=a&&this.params.iAddGridPoints&&(this.marchingCubes.calcVertexPoint(c,f,d,g,this.ptTemp),this.addVertexCopy(u<k?r:this.ptTemp,Math.min(u,k),-3,!0),this.addVertexCopy(u<k?this.ptTemp:r,Math.max(u,k),-3,!0));return a},"~N,~B,~N,~N,~N,JU.P3i,~N,~N,~N,~N,JU.T3,JU.V3,~B,~A");e(d,"getSurfacePointAndFraction",function(a,b,c,f,d,e,h,g,u,k,r,n,p){return this.getSPF(a,
b,c,f,d,e,h,g,u,k,r,n,p)},"~N,~B,~N,~N,JU.T3,JU.V3,~N,~N,~N,~N,~N,~A,JU.T3");e(d,"getSPF",function(a,b,c,f,d,e,h,g,u,k,r,n,p){f-=c;h=(a-c)/f;if(b&&(0>h||1<h))h=(-a-c)/f;if(0>h||1<h)h=NaN;n[0]=h;p.scaleAdd2(h,e,d);return c+h*f},"~N,~B,~N,~N,JU.T3,JU.V3,~N,~N,~N,~N,~N,~A,JU.T3");e(d,"addVertexCopy",function(a,b,c,f){return this.addVC(a,b,c,f)},"JU.T3,~N,~N,~B");e(d,"addVC",function(a,b,c,f){return Float.isNaN(b)&&-3!=c?-1:null==this.meshDataServer?this.meshData.addVertexCopy(a,b,c,f):this.meshDataServer.addVertexCopy(a,
b,c,f)},"JU.T3,~N,~N,~B");e(d,"addTriangleCheck",function(a,b,c,f,d,e,h){if(null!=this.marchingSquares&&this.params.isContoured){if(0==h)return this.marchingSquares.addTriangle(a,b,c,f,d);h=0}return null!=this.meshDataServer?this.meshDataServer.addTriangleCheck(a,b,c,f,d,e,h):e&&!J.jvxl.data.MeshData.checkCutoff(a,b,c,this.meshData.vvs)?-1:this.meshData.addTriangleCheck(a,b,c,f,d,h)},"~N,~N,~N,~N,~N,~B,~N");e(d,"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(d,"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=ea(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=s(this.meshData.vc,0));var b=3.4028235E38,c=-3.4028235E38,f;this.initializeMapping();for(var d=this.meshData.vc;--d>=this.meshData.mergeVertexCount0;){if(this.params.colorBySets)f=this.meshData.vertexSets[d];else if(this.params.colorByPhase)f=this.getPhase(this.meshData.vs[d]);else{var e=this.haveSurfaceAtoms;f=this.volumeData.lookupInterpolatedVoxelValue(this.meshData.vs[d],e);e&&(this.meshData.vertexSource[d]=
this.getSurfaceAtomIndex())}f<b&&(b=f);f>c&&3.4028235E38!=f&&(c=f);this.meshData.vvs[d]=f}this.params.rangeSelected&&null==this.minMax&&(this.minMax=w(-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(d,"colorData",function(){var a=this.meshData.vvs,b=this.meshData.vcs;this.meshData.pcs=null;var c=this.jvxlData.valueMappedToBlue,f=this.jvxlData.valueMappedToRed,d=this.jvxlData.minColorIndex,
e=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 h=this.meshData.vc;0<=--h;){var g=a[h];0<=d?0>=g?b[h]=d:0<g&&(b[h]=e):(g<=f&&(g=f),g>=c&&(g=c),b[h]=this.params.colorEncoder.getColorIndex(g))}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=ea(a,0);d=this.jvxlData.contourValues;null==d&&(d=this.jvxlData.contourValuesUsed);null==this.jvxlData.contourValuesUsed&&(this.jvxlData.contourValuesUsed=null==d?w(a,0):d);c=(c-f)/(a+1);this.params.colorEncoder.setRange(this.params.valueMappedToRed,this.params.valueMappedToBlue,this.params.isColorReversed);for(h=0;h<a;h++)e=null==d?f+(h+1)*c:d[h],this.jvxlData.contourValuesUsed[h]=
e,b[h]=JU.C.getColixTranslucent(this.params.colorEncoder.getArgb(e));this.jvxlData.contourColors=JU.C.getHexCodes(b)}});d.getColorPhaseIndex=e(d,"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(d,"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(d,"getMinMaxMappedValues",function(a){if(null!=this.minMax&&3.4028235E38!=this.minMax[0])return this.minMax;if(this.params.colorBySets)return this.minMax=w(-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 f=this.params.theProperty[a];Float.isNaN(f)||(f<b&&(b=f),f>c&&(c=f))}return this.minMax=w(-1,[b,c])}var f=0<this.contourVertexCount?this.contourVertexCount:this.meshData.vc,d=this.meshData.vs,e=a||this.jvxlDataIs2dContour||this.vertexDataOnly||this.params.colorDensity;for(a=this.meshData.mergeVertexCount0;a<f;a++){var h;h=e?this.meshData.vvs[a]:this.volumeData.lookupInterpolatedVoxelValue(d[a],!1);h<b&&(b=h);h>c&&3.4028235E38!=
h&&(c=h)}return this.minMax=w(-1,[b,c])},"~B");e(d,"updateTriangles",function(){null==this.meshDataServer?this.meshData.invalidatePolygons():this.meshDataServer.invalidateTriangles()});e(d,"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(d,"selectPocket",function(){},"~B");e(d,"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(d,"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(d,"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(d,
"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(d,"setVectorAnisotropy",function(a){this.haveSetAnisotropy=!0;a.x*=this.anisotropy[0];a.y*=this.anisotropy[1];a.z*=this.anisotropy[2]},"JU.T3");e(d,"setVolumetricAnisotropy",function(){this.haveSetAnisotropy||(this.setVolumetricOriginAnisotropy(),this.setVectorAnisotropy(this.volumetricVectors[0]),this.setVectorAnisotropy(this.volumetricVectors[1]),this.setVectorAnisotropy(this.volumetricVectors[2]))});
e(d,"setVolumetricOriginAnisotropy",function(){this.volumetricOrigin.setT(this.center)});e(d,"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(d,"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(d,"getValueAtPoint",function(){return 0},"JU.T3,~B");e(d,"initializeMapping",function(){});e(d,"finalizeMapping",function(){});e(d,"getSurfaceAtomIndex",function(){return-1});d.colorPhases=B(-1,"_orb x y z xy yz xz x2-y2 z2".split(" "))});O("J.jvxl.calc");L(["JU.TriangleData","JU.BS","$.P3","$.SB","$.V3"],"J.jvxl.calc.MarchingCubes",["J.jvxl.data.JvxlCoder"],function(){var d=z(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.isDensityRange=!1;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;C(this,arguments)},J.jvxl.calc,"MarchingCubes",JU.TriangleData);da(d,function(){this.edgeData=new JU.SB;this.vertexValues=w(8,0);this.voxelVertexVectors=Array(8);this.edgeVectors=Array(12);for(var a=12;0<=--a;)this.edgeVectors[a]=new JU.V3;this.edgePointIndexes=s(12,0);this.bsValues=new JU.BS;this.pt0=
new JU.P3;this.pointA=new JU.P3;this.fReturn=w(1,0);this.linearOffsets=s(8,0)});Z(d,function(){ia(this,J.jvxl.calc.MarchingCubes,[])});Z(d,function(a,b,c,f){ia(this,J.jvxl.calc.MarchingCubes,[]);this.excludePartialCubes=!0;this.surfaceReader=a;this.bsVoxels=f;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!=
f?2:3;this.setParameters(b,c)},"J.jvxl.api.VertexDataServer,J.jvxl.data.VolumeData,J.jvxl.readers.Parameters,JU.BS");e(d,"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.isDensityRange=null!=b.cutoffRange;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=s(2,this.yzCount,3,0);this.yzPlanes=3==this.mode?w(2,this.yzCount,0):null;this.setLinearOffsets();this.calcVoxelVertexVectors()},"J.jvxl.data.VolumeData,J.jvxl.readers.Parameters");e(d,"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(d,"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(d,"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,f,d,e;this.isXLowToHigh?(a=0,this.colorDensity?(b=
this.cubeCountX+1,e=this.yzCount-1):(b=this.cubeCountX,e=this.yzCount-1-this.nZ-1),c=1,f=this.yzCount):(this.colorDensity?(a=this.cubeCountX,e=(this.cubeCountX+1)*this.yzCount-1):(a=this.cubeCountX-1,e=this.cubeCountX*this.yzCount-1-this.nZ-1),c=b=-1,f=-this.yzCount);d=e;this.resetIndexPlane(this.isoPointIndexPlanes[1]);this.voxelData=null;var h=this.cubeCountY+(this.colorDensity?1:0),g=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 u=this.colorDensity&&0==this.cutoff,k=0;a!=b;a+=c,e+=f,d=e)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 r=h;0<=--r;)for(var n=g;0<=--n;d--)k=this.getValue(a,r,n,d,0),(u||this.$isInside)&&this.addVertex(a,r,n,d,k);else{r=this.isoPointIndexPlanes[0];this.isoPointIndexPlanes[0]=
this.isoPointIndexPlanes[1];this.isoPointIndexPlanes[1]=this.resetIndexPlane(r);for(var p=!0,r=h;0<=--r;d--)for(n=g;0<=--n;d--){for(var m=0,s=8;0<=--s;)k=this.getValue(a,r,n,d,s),this.$isInside&&(m|=JU.TriangleData.Pwr2[s]);p&&!Float.isNaN(k)&&(p=!1);0!=m&&255!=m&&this.processOneCubical(m,a,r,n,d)&&(!this.isContoured&&!this.colorDensity)&&this.processTriangles(m)}p&&this.bsExcludedPlanes.set(a)}return this.edgeData.toString()});e(d,"getValue",function(a,b,c,f,d){this.offset=JU.TriangleData.cubeVertexOffsets[d];
f+=this.linearOffsets[d];switch(this.mode){case 3:a=this.vertexValues[d]=this.getValueArray(a+this.offset.x,b+this.offset.y,c+this.offset.z,f,this.yzPlanes[J.jvxl.calc.MarchingCubes.yzPlanePts[d]]);this.$isInside=this.allInside||this.bsVoxels.get(f);break;case 2:this.$isInside=this.allInside||this.bsVoxels.get(f);a=this.vertexValues[d]=(this.isDensityRange?!this.$isInside:this.bsExcludedVertices.get(f))?NaN:this.$isInside?1:0;break;default:case 1:null==this.mappingPlane?a=this.vertexValues[d]=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[d]=this.volumeData.distanceToMappingPlane(this.pt0)),this.isSquared&&(this.vertexValues[d]*=this.vertexValues[d]),(this.$isInside=this.allInside?!0:J.jvxl.calc.MarchingCubes.isInside(this.vertexValues[d],this.cutoff,this.isCutoffAbsolute))&&this.bsVoxels.set(f)}return a},"~N,~N,~N,~N,~N");e(d,"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(d,"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(d,"addVertex",function(a,b,c,f,d){this.volumeData.voxelPtToXYZ(a,b,c,this.pt0);0>this.surfaceReader.addVertexCopy(this.pt0,d,-4,!0)&&this.bsExcludedVertices.set(f)},"~N,~N,~N,~N,~N");e(d,"addTriangle",function(a,b,c,f){!this.bsExcludedTriangles.get(this.nTriangles)&&
0>this.surfaceReader.addTriangleCheck(this.edgePointIndexes[a],this.edgePointIndexes[b],this.edgePointIndexes[c],f,0,this.isCutoffAbsolute,0)&&this.bsExcludedTriangles.set(this.nTriangles);this.nTriangles++},"~N,~N,~N,~N");e(d,"getValueArray",function(a,b,c,f,d){var e=f%this.yzCount;this.bsValues.set(f);a=this.surfaceReader.getValue(a,b,c,e);this.isSquared&&(a*=a);d[e]=a;J.jvxl.calc.MarchingCubes.isInside(a,this.cutoff,this.isCutoffAbsolute)&&this.bsVoxels.set(f);return a},"~N,~N,~N,~N,~A");d.isInside=
e(d,"isInside",function(a,b,c){return 0<b&&(c?Math.abs(a):a)>=b||0>=b&&a<=b},"~N,~N,~B");e(d,"processOneCubical",function(a,b,c,f,d){a=J.jvxl.calc.MarchingCubes.insideMaskTable[a];for(var e=!1,h=12;0<=--h;)if(0!=(a&JU.TriangleData.Pwr2[h])){var g=this.edgeVertexPlanes[h],u=(d+this.linearOffsets[this.edgeVertexPointers[h]])%this.yzCount,k=J.jvxl.calc.MarchingCubes.edgeTypeTable[h],r=this.edgePointIndexes[h]=this.isoPointIndexPlanes[g][u][k];if(-2147483648!=r)-1==r&&(e=this.excludePartialCubes);else{var r=
JU.TriangleData.edgeVertexes[h<<1],n=JU.TriangleData.edgeVertexes[(h<<1)+1],p=this.vertexValues[r],m=this.vertexValues[n];this.calcVertexPoint(b,c,f,r,this.pointA);this.edgeCount++;g=this.edgePointIndexes[h]=this.isoPointIndexPlanes[g][u][k]=this.surfaceReader.getSurfacePointIndexAndFraction(this.cutoff,this.isCutoffAbsolute,b,c,f,JU.TriangleData.cubeVertexOffsets[r],r,n,p,m,this.pointA,this.edgeVectors[h],k==this.contourType,this.fReturn);this.addEdgeData(0>g?NaN:this.fReturn[0]);if(Float.isNaN(this.fReturn[0])||
0>g)e=this.excludePartialCubes}}return!e},"~N,~N,~N,~N,~N");e(d,"addEdgeData",function(a){a=J.jvxl.data.JvxlCoder.jvxlFractionAsCharacter(a);this.edgeData.appendC(a)},"~N");e(d,"calcVertexPoint",function(a,b,c,f,d){this.volumeData.voxelPtToXYZ(a,b,c,this.pt0);d.add2(this.pt0,this.voxelVertexVectors[f])},"~N,~N,~N,~N,JU.P3");e(d,"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(d,"getLinearOffset",function(a,b,c,f){return a*this.yzCount+b*this.nZ+c+this.linearOffsets[f]},"~N,~N,~N,~N");d.yzPlanePts=s(-1,[0,1,1,0,0,1,1,0]);d.edgeVertexPointersLowToHigh=s(-1,[1,1,2,0,5,5,6,4,0,1,2,3]);d.edgeVertexPointersHighToLow=s(-1,[0,1,3,0,4,5,7,4,0,1,2,3]);d.edgeVertexPlanesLowToHigh=s(-1,[1,1,1,0,1,1,1,0,0,1,1,0]);d.edgeVertexPlanesHighToLow=s(-1,[1,0,
1,1,1,0,1,1,1,0,0,1]);d.cubeVertexVectors=B(-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)]);d.edgeTypeTable=s(-1,[0,2,0,2,0,2,0,2,1,1,1,1]);d.insideMaskTable=ea(-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])});O("J.jvxl.calc");L(["JU.P3",
"java.util.Hashtable"],"J.jvxl.calc.MarchingSquares",["JU.AU","JU.Logger"],function(){var d=z(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;na("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;na("J.jvxl.calc.MarchingSquares.Triangle")||J.jvxl.calc.MarchingSquares.$MarchingSquares$Triangle$();C(this,arguments)},J.jvxl.calc,"MarchingSquares",null);da(d,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});Z(d,function(a,b,c,f,d,e,h){this.surfaceReader=
a;this.volumeData=b;this.thisContour=e;this.contoursDiscrete=f;this.contourFromZero=h;null==f?(this.nContourSegments=(0==d?9:d)+0,100<this.nContourSegments&&(this.nContourSegments=100)):(this.nContourSegments=d=f.length,this.contourFromZero=!1)},"J.jvxl.api.VertexDataServer,J.jvxl.data.VolumeData,JU.P4,~A,~N,~N,~B");e(d,"setMinMax",function(a,b){this.valueMin=a;this.valueMax=b},"~N,~N");e(d,"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++]=wa(J.jvxl.calc.MarchingSquares.ContourVertex,this,null,a);return c},"JU.P3,~N");e(d,"setContourData",function(a,b){this.contourVertexes[a].setValue(b)},"~N,~N");e(d,"calcContourPoint",function(a,b,c,f){return this.volumeData.calculateFractionalPoint(a,this.pointA,this.pointB,b,c,f)},"~N,~N,~N,JU.P3");e(d,"addTriangle",function(a,b,c,f,d){this.triangleCount==this.triangles.length&&
(this.triangles=JU.AU.doubleLength(this.triangles));this.triangles[this.triangleCount++]=wa(J.jvxl.calc.MarchingSquares.Triangle,this,null,a,b,c,f,d);return 0},"~N,~N,~N,~N,~N");e(d,"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(d,"getVertexValues",function(a){this.contourPlaneMinimumValue=3.4028235E38;
this.contourPlaneMaximumValue=-3.4028235E38;for(var b=0;b<this.contourVertexCount;b++){var c=this.contourVertexes[b],f;a?f=c.value:(f=this.volumeData.lookupInterpolatedVoxelValue(c,!1),c.setValue(f));f<this.contourPlaneMinimumValue&&(this.contourPlaneMinimumValue=f);f>this.contourPlaneMaximumValue&&(this.contourPlaneMaximumValue=f)}},"~B");e(d,"createContours",function(a,b,c){b-=a;this.contourValuesUsed=w(this.nContourSegments,0);for(var f=this.triangleCount;0<=--f;)this.triangles[f].check=0;for(var d=
-3.4028235E38,f=0;f<this.nContourSegments;f++){d=null!=this.contoursDiscrete?this.contoursDiscrete[f]:this.contourFromZero?a+1*f/this.nContourSegments*b:0==f?-3.4028235E38:f==this.nContourSegments-1?3.4028235E38:a+1*(f-1)/(this.nContourSegments-1)*b;null==this.contoursDiscrete&&Math.abs(d)<c&&(d=0>d?-c:c);this.contourValuesUsed[f]=d;JU.Logger.info("#contour "+(f+1)+" "+d+" "+this.triangleCount);this.htPts.clear();for(var e=this.triangleCount;0<=--e;)this.triangles[e].isValid&&this.checkContour(this.triangles[e],
f,d)}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(d,"intercept",function(a,b,c){var f=a.pts[b];a=a.pts[(b+1)%3];if(2147483647==f||2147483647==a)return-1;b=f<a?f+"_"+a:a+"_"+f;if(this.htPts.containsKey(b))return this.htPts.get(b).intValue();var d=this.contourVertexes[f].value,e=this.contourVertexes[a].value,h=-1;if(d!=e){var g=(c-d)/(e-d);if(0<=g&&1>=g&&(this.pointA.setT(this.contourVertexes[f]),
this.pointB.setT(this.contourVertexes[a]),c=this.calcContourPoint(c,d,e,this.ptTemp),!Float.isNaN(c))){h=this.addContourVertex(this.ptTemp,c);if(0>h)return-1;this.contourVertexes[h].setValue(c)}}this.htPts.put(b,Integer.$valueOf(h));return h},"J.jvxl.calc.MarchingSquares.Triangle,~N,~N");e(d,"checkContour",function(a,b,c){if(!(0<this.thisContour&&b+1!=this.thisContour)){var f=this.intercept(a,0,c),d=this.intercept(a,1,c);c=this.intercept(a,2,c);var e=a.pts,h=0;0<=f&&(h+=1);0<=d&&(h+=2);0<=c&&(h+=
4);switch(h){case 3:this.addTriangle(e[0],f,d,2|a.check&1,b);this.addTriangle(f,e[1],d,4|a.check&3,b);this.addTriangle(e[0],d,e[2],a.check&6,b);break;case 5:this.addTriangle(e[0],f,c,2|a.check&5,b);this.addTriangle(f,e[1],c,4|a.check&1,b);this.addTriangle(c,e[1],e[2],a.check&6,b);break;case 6:this.addTriangle(e[0],e[1],c,a.check&5,b);this.addTriangle(c,e[1],d,4|a.check&2,b);this.addTriangle(c,d,e[2],1|a.check&6,b);break;default:return}a.isValid=!1}},"J.jvxl.calc.MarchingSquares.Triangle,~N,~N");e(d,
"getMinMax",function(){return w(-1,[this.valueMin,this.valueMax])});e(d,"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)}});d.$MarchingSquares$ContourVertex$=function(){var a=z(function(){oa(this,arguments);this.value=0;C(this,arguments)},J.jvxl.calc.MarchingSquares,"ContourVertex",JU.P3);Z(a,function(a){ia(this,J.jvxl.calc.MarchingSquares.ContourVertex,
[]);this.setT(a)},"JU.P3");e(a,"setValue",function(a){this.value=a},"~N");m(a,"toString",function(){return this.value+" "+this.x+" "+this.y+" "+this.z})};d.$MarchingSquares$Triangle$=function(){var a=z(function(){oa(this,arguments);this.pts=null;this.check=0;this.isValid=!0;this.contourIndex=0;C(this,arguments)},J.jvxl.calc.MarchingSquares,"Triangle",null);Z(a,function(a,c,f,d,e){this.pts=s(-1,[a,c,f]);this.check=d;this.contourIndex=e},"~N,~N,~N,~N,~N")}});O("J.shapesurface");L(["J.shape.Mesh"],"J.shapesurface.IsosurfaceMesh",
"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.BSUtil $.C $.ColorEncoder $.Logger $.SimpleUnitCell JV.Viewer".split(" "),function(){var d=z(function(){this.jvxlData=null;this.vertexIncrement=1;this.firstRealVertex=-1;this.dataType=0;this.hasGridPoints=!1;this.colorEncoder=this.contourColixes=this.contourValues=this.info=this.calculatedVolume=this.calculatedArea=this.vertexColorMap=null;this.colorPhased=!1;this.assocGridPointNormals=
this.assocGridPointMap=this.bsVdw=this.pymolVertexColorMap=this.probeValues=null;this.mergeAssociatedNormalCount=0;this.centers=null;C(this,arguments)},J.shapesurface,"IsosurfaceMesh",J.shape.Mesh);Z(d,function(a,b,c,f){ia(this,J.shapesurface.IsosurfaceMesh,[]);this.mesh1(a,b,c,f);this.jvxlData=new J.jvxl.data.JvxlData;this.checkByteCount=2;this.jvxlData.version=JV.Viewer.getJmolVersion()},"JV.Viewer,~S,~N,~N");m(d,"getResolution",function(){return 1/this.jvxlData.pointsPerAngstrom});e(d,"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(d,"allocVertexColixes",
function(){if(null==this.vcs){this.vcs=ea(this.vc,0);for(var a=this.vc;0<=--a;)this.vcs[a]=this.colix}this.isColorSolid=!1});e(d,"addVertexCopy",function(a,b,c,f,d){a=this.addVCVal(a,b,d);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),f&&(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");m(d,"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(d,"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");m(d,"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,f=this.assocGridPointMap.entrySet().iterator();f.hasNext()&&((c=f.next())||1);){var d=c.getValue();this.assocGridPointNormals.containsKey(d)||this.assocGridPointNormals.put(d,JU.V3.new3(0,0,0));this.assocGridPointNormals.get(d).add(b[c.getKey().intValue()])}for(f=
this.assocGridPointMap.entrySet().iterator();f.hasNext()&&((c=f.next())||1);)b[c.getKey().intValue()]=this.assocGridPointNormals.get(c.getValue())}},"~A,~A");e(d,"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(d,"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 f=(this.jvxlData.valueMappedToBlue-this.jvxlData.valueMappedToRed)/(a+1),c=0;c<a;c++){var d=this.jvxlData.valueMappedToRed+(c+
1)*f;J.shapesurface.IsosurfaceMesh.get3dContour(this,b[c],d,this.jvxlData.contourColixes[c])}JU.Logger.info(a+" contour lines; separation = "+f)}else for(c=0;c<a;c++)d=this.jvxlData.contourValuesUsed[c],J.shapesurface.IsosurfaceMesh.get3dContour(this,b[c],d,this.jvxlData.contourColixes[c]);this.jvxlData.contourColixes=ea(a,0);this.jvxlData.contourValues=w(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});e(d,"getPmeshData",function(a){return J.api.Interface.getInterface("J.shapesurface.PMeshWriter",this.vwr,"script").write(this,a)},"~B");e(d,"getPLYData",function(a){return J.api.Interface.getInterface("J.shapesurface.PLYWriter",this.vwr,"script").write(this,a)},"~B");d.get3dContour=e(d,"get3dContour",function(a,b,c,f){var d=JU.BS.newN(a.pc),e=new JU.SB,h=JU.C.getArgb(f);J.shapesurface.IsosurfaceMesh.setContourVector(b,a.pc,d,c,f,h,e);for(f=0;f<a.pc;f++)null!=a.setABC(f)&&J.shapesurface.IsosurfaceMesh.addContourPoints(b,
d,f,e,a.vs,a.vvs,a.iA,a.iB,a.iC,c)},"J.shapesurface.IsosurfaceMesh,JU.Lst,~N,~N");d.setContourVector=e(d,"setContourVector",function(a,b,c,f,d,e,h){a.add(0,Integer.$valueOf(b));a.add(1,c);a.add(2,Float.$valueOf(f));a.add(3,ea(-1,[d]));a.add(4,s(-1,[e]));a.add(5,h)},"JU.Lst,~N,JU.BS,~N,~N,~N,JU.SB");d.addContourPoints=e(d,"addContourPoints",function(a,b,c,f,d,e,h,g,u,k){var r=null,n=null,p=0,m=J.shapesurface.IsosurfaceMesh.checkPt(e,h,g,k);Float.isNaN(m)||(r=J.shapesurface.IsosurfaceMesh.getContourPoint(d,
h,g,m),p|=1);var s=1==m?NaN:J.shapesurface.IsosurfaceMesh.checkPt(e,g,u,k);Float.isNaN(s)||(n=J.shapesurface.IsosurfaceMesh.getContourPoint(d,g,u,s),0==p&&(r=n,m=s),p|=2);switch(p){case 0:return;case 1:if(0==m)return;case 2:s=1==s?NaN:J.shapesurface.IsosurfaceMesh.checkPt(e,u,h,k),Float.isNaN(s)||(n=J.shapesurface.IsosurfaceMesh.getContourPoint(d,u,h,s),p|=4)}switch(p){case 3:case 5:case 6:break;default:return}b.set(c);J.jvxl.data.JvxlCoder.appendContourTriangleIntersection(p,m,s,f);a.addLast(r);
a.addLast(n)},"JU.Lst,JU.BS,~N,JU.SB,~A,~A,~N,~N,~N,~N");d.checkPt=e(d,"checkPt",function(a,b,c,f){var d,e;return f==(d=a[b])?0:f==(e=a[c])?1:d<f==f<e?(f-d)/(e-d):NaN},"~A,~N,~N,~N");d.getContourPoint=e(d,"getContourPoint",function(a,b,c,f){var d=new JU.P3;d.sub2(a[c],a[b]);d.scaleAdd2(f,d,a[b]);return d},"~A,~N,~N,~N");e(d,"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,f=a[c-1];this.colorCommand=null;var d=null!=b&&0<b.length;this.isColorSolid=d&&null!=this.jvxlData.jvxlPlane;if(null!=this.jvxlData.vContours){if(d)for(var e=0;e<this.jvxlData.vContours.length;e++)c=b[e%b.length],this.jvxlData.vContours[e].get(3)[0]=c,this.jvxlData.vContours[e].get(4)[0]=JU.C.getArgb(c)}else{this.pcs=
ea(this.pc,0);this.colorsExplicit=!1;for(e=0;e<this.pc;e++){var h=this.pis[e];if(null!=h){this.pcs[e]=0;for(var h=(this.vvs[h[0]]+this.vvs[h[1]]+this.vvs[h[2]])/3,g=c;0<=--g;)if(h>=a[g]&&h<f){this.pcs[e]=d?b[g%b.length]:0;break}}}}}},"~A,~A");e(d,"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(d,"deleteContours",function(){this.jvxlData.contourValuesUsed=null;this.jvxlData.contourValues=null;this.jvxlData.contourColixes=null;this.jvxlData.vContours=null});e(d,"setPymolVertexColixesForAtoms",function(a,b,c){this.checkAllocColixes();var f=b[0],d=null,e=b[1];b=null==e?null:ea(e.length,0);if(null!=f){for(var h=0;h<f.length;h++){var g=f[h];f[h]=g;d=null==e?0:e[h];0.01<d&&(b[h]=JU.C.getColixTranslucent3(g,!0,d))}d=s(c.length(),0);g=0;for(h=c.nextSetBit(0);0<=
h;h=c.nextSetBit(h+1),g++)d[h]=g}this.jvxlData.vertexColors=s(this.vc,0);this.jvxlData.nVertexColors=this.vc;e=a.ms.at;a=a.gdata;for(var u=JU.C.isTransparent(this.colix),h=this.mergeVertexCount0;h<this.vc;h++){var k=this.vertexSource[h];if(!(0>k)&&c.get(k)){this.jvxlData.vertexColors[h]=a.getColorArgbOrGray(this.vcs[h]=JU.C.copyColixTranslucency(this.colix,e[k].colixAtom));var g=null==f?0:f[d[k]],r=null==b?-1:b[d[k]];0==g&&(g=e[k].colixAtom);this.vcs[h]=u?JU.C.copyColixTranslucency(this.colix,g):
0==r?g:JU.C.copyColixTranslucency(r,g)}}this.setPymolColors()},"JV.Viewer,~A,JU.BS");e(d,"setPymolColors",function(){this.pymolVertexColorMap=this.vertexColorMap=new java.util.Hashtable;for(var a=-999,b=null,c=this.vc;0<=--c;){var f=this.vcs[c];if(f!=a){var d=J.shapesurface.IsosurfaceMesh.getVertexColorString(a=f);JU.C.isColixTranslucent(f)&&(this.hasTranslucentVertices=!0);b=this.vertexColorMap.get(d);null==b&&this.vertexColorMap.put(d,b=new JU.BS)}b.set(c)}});d.getVertexColorString=e(d,"getVertexColorString",
function(a){var b=JU.C.getHexCode(a);JU.C.isColixTranslucent(a)&&(b+=" translucent "+JU.C.getColixTranslucencyFractional(a));return b},"~N");e(d,"colorVertices",function(a,b,c){if(null!=this.vertexSource){JU.C.isColixTranslucent(a)?this.hasTranslucentVertices=!0:a=JU.C.copyColixTranslucency(this.colix,a);var f=c?new JU.BS:b;this.checkAllocColixes();if(c)for(c=0;c<this.vc;c++){var d=this.vertexSource[c];0<=d&&b.get(d)&&(this.vcs[c]=a,null!=f&&f.set(c))}else for(c=0;c<this.vc;c++)f.get(c)&&(this.vcs[c]=
a);a=J.shapesurface.IsosurfaceMesh.getVertexColorString(a);null==this.vertexColorMap&&(this.vertexColorMap=new java.util.Hashtable);J.shapesurface.IsosurfaceMesh.addColorToMap(this.vertexColorMap,a,b)}},"~N,JU.BS,~B");e(d,"checkAllocColixes",function(){(null==this.vcs||null==this.vertexColorMap&&this.isColorSolid)&&this.allocVertexColixes();this.isColorSolid=!1});d.addColorToMap=e(d,"addColorToMap",function(a,b,c){for(var f=null,d=new JU.Lst,e,h=a.entrySet().iterator();h.hasNext()&&((e=h.next())||
1);){var g=e.getKey();if(g===b)f=e.getValue(),f.or(c);else{var u=e.getValue();u.andNot(c);u.isEmpty()&&d.addLast(g)}}for(;!d.isEmpty();)a.remove(d.removeItemAt(0));null==f&&a.put(b,c)},"java.util.Map,~S,JU.BS");e(d,"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 f=b.getKey(),d=new JU.BS,e=0;e<this.vc;e++)c.get(this.vertexSource[e])&&d.set(e);J.shapesurface.IsosurfaceMesh.addColorToMap(this.jvxlData.vertexColorMap,f,d)}}this.jvxlData.nVertexColors=this.jvxlData.vertexColorMap.size();0==this.jvxlData.vertexColorMap.size()&&(this.jvxlData.vertexColorMap=null)}},"~B");e(d,"setColorCommand",function(){if("inherit".equals(this.jvxlData.colorScheme))this.colorCommand="#inherit;";else 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(d,"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);var b=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&&("inherit".equals(this.jvxlData.colorScheme)||null==this.jvxlData.vertexColorMap))return!1;if(null==this.jvxlData.vertexColorMap){if(null!=this.jvxlData.colorScheme){var c=this.jvxlData.colorScheme;if(a=c.startsWith("translucent "))c=c.substring(12),b=NaN;this.colorEncoder.setColorScheme(c,a);this.remapColors(null,null,b)}}else{if(null!=this.jvxlData.baseColor)for(a=this.vc;0<=--a;)this.vcs[a]=this.colix;for(b=this.jvxlData.vertexColorMap.entrySet().iterator();b.hasNext()&&
((c=b.next())||1);){var f=c.getValue(),d=c.getKey(),e=d.indexOf(" translucent"),h=(a=0<=e)?JU.PT.parseFloat(d.substring(e+12)):-1;Float.isNaN(h)?(System.out.println("Isourface error reading JVXL file translucent vertex color:"+d),a=!1):a&&(d=d.substring(0,e),this.hasTranslucentVertices=!0);d=JU.C.getColixS(d);d=a?JU.C.getColixTranslucent3(d,!0,h):JU.C.copyColixTranslucency(this.colix,d);for(a=f.nextSetBit(0);0<=a;a=f.nextSetBit(a+1))this.vcs[a]=d}}return!0},"~N");e(d,"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(d,"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 f=b.lo,d=b.hi,e=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(),e){this.jvxlData.vertexColors=s(this.vc,0);this.jvxlData.nVertexColors=this.vc;b=a.ms.at;c=a.gdata;for(a=this.mergeVertexCount0;a<this.vc;a++)f=this.vertexSource[a],0<=f&&f<b.length&&(this.jvxlData.vertexColors[a]=c.getColorArgbOrGray(this.vcs[a]=JU.C.copyColixTranslucency(this.colix,
b[f].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!=d&&(this.jvxlData.valueMappedToRed=f,this.jvxlData.valueMappedToBlue=d);b.setRange(this.jvxlData.valueMappedToRed,this.jvxlData.valueMappedToBlue,this.jvxlData.isColorReversed);
f=JU.C.isColixTranslucent(this.colix);b.isTranslucent&&(f||(this.colix=JU.C.getColixTranslucent3(this.colix,!0,0.5)),f=!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(f,c);this.colorEncoder=b;c=this.getContours();if(null!=c)for(a=c.length;0<=--a;)f=c[a].get(2).floatValue(),d=c[a].get(3),d[0]=b.getColorIndex(f),c[a].get(4)[0]=JU.C.getArgb(d[0]);if(null!=this.contourValues){this.contourColixes=
ea(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(d,"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");m(d,"getBoundingBox",function(){return this.jvxlData.boundingBox});m(d,"setBoundingBox",function(a){this.jvxlData.boundingBox=a},"~A");e(d,"merge",function(a){var b=this.vc+(null==a?0:a.vc);null==this.pis&&(this.pis=s(0,0,0));null!=a&&null==a.pis&&(a.pis=s(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 f=null!=this.vertexSource&&(null==a||null!=a.vertexSource);this.vertexSource=JU.AU.ensureLengthI(this.vertexSource,b);var d=JU.AU.newInt2(c),e=J.shapesurface.IsosurfaceMesh.mergePolygons(this,0,0,d);if(null!=a){J.shapesurface.IsosurfaceMesh.mergePolygons(a,e,this.vc,d);for(e=0;e<a.vc;e++,this.vc++)this.vs[this.vc]=a.vs[e],this.vvs[this.vc]=a.vvs[e],f&&(this.vertexSource[this.vc]=a.vertexSource[e])}this.pc=this.polygonCount0=
c;this.vc=this.vertexCount0=b;0<c&&this.resetSlab();this.pis=d},"J.jvxl.data.MeshData");d.mergePolygons=e(d,"mergePolygons",function(a,b,c,f){for(var d,e=0;e<a.pc;e++)if(!(null==(d=a.pis[e])||null!=a.bsSlabDisplay&&!a.bsSlabDisplay.get(e)))if(f[b++]=a.pis[e],0<c)for(var h=0;3>h;h++)d[h]+=c;return b},"JU.MeshSurface,~N,~N,~A");m(d,"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.oabc&&null!=(this.unitCell=this.vwr.getSymTemp().getUnitCell(this.oabc,!0,null))?this.unitCell:null});e(d,"fixLattice",function(){if(null!=this.getUnitCell()){var a=new JU.P3i,b=JU.P3i.new3(x(this.lattice.x),x(this.lattice.y),x(this.lattice.z));this.jvxlData.fixedLattice=this.lattice;this.lattice=null;JU.SimpleUnitCell.setMinMaxLatticeParameters(x(this.unitCell.getUnitCellInfoType(6)),a,b,0);var c=(b.x-a.x)*(b.y-a.y)*(b.z-a.z),f=new JU.P3,d=this.vc,e=c*this.vc;this.vs=JU.AU.arrayCopyPt(this.vs,
e);this.vvs=null==this.vvs?null:JU.AU.ensureLengthA(this.vvs,e);var h=this.pc;this.pis=JU.AU.arrayCopyII(this.pis,c*this.pc);c=0;this.normixes=JU.AU.arrayCopyShort(this.normixes,e);for(e=a.x;e<b.x;e++)for(var g=a.y;g<b.y;g++)for(var u=a.z;u<b.z;u++)if(!(0==e&&0==g&&0==u)){f.set(e,g,u);this.unitCell.toCartesian(f,!1);for(var k=0;k<d;k++){this.normixes[this.vc]=this.normixes[k];var r=JU.P3.newP(this.vs[k]);r.add(f);this.addVCVal(r,this.vvs[k],!1)}c+=d;for(k=0;k<h;k++)r=JU.AU.arrayCopyI(this.pis[k],
-1),r[0]+=c,r[1]+=c,r[2]+=c,this.addPolygon(r,null)}a=new JU.P3;b=new JU.P3;this.setBox(a,b);this.jvxlData.boundingBox=B(-1,[a,b])}});m(d,"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});m(d,"getVisibleVertexBitSet",function(){var a=this.getVisibleVBS();if(null!=this.jvxlData.thisSet)for(var b=0;b<this.vc;b++)this.jvxlData.thisSet.get(this.vertexSets[b])||
a.clear(b);return a});e(d,"updateCoordinates",function(a,b){var c=null==b||this.isModelConnected;if(!c)for(var f=0;f<this.connectedAtoms.length;f++)if(0<=this.connectedAtoms[f]&&b.get(this.connectedAtoms[f])){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(d,"getDataMinMax",function(){for(var a=3.4028235E38,b=-3.4028235E38,c=this.vvs.length;0<=
--c;){var f=this.vvs[c];f<a&&(a=f);f>b&&(b=f)}return w(-1,[a,b])});e(d,"getDataRange",function(){return"inherit".equals(this.jvxlData.colorScheme)||null!=this.jvxlData.jvxlPlane&&null==this.colorEncoder?null:w(-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])});e(d,"getInfo",function(a){var b=Ja(this,J.shapesurface.IsosurfaceMesh,
"getInfo",[a]);null!=this.vertexColorMap&&b.put("vertexColorMap",this.vertexColorMap);if(a){a=new JU.BS;var c=this.getValidVertices(a);null!=c&&(b.put("allVertices",b.get("vertices")),b.put("vertices",c),c=b.get("vertexValues"),null!=c&&(a=this.getValidValues(a),b.put("allValues",c),b.put("vertexValues",a)))}return b},"~B");e(d,"getValidValues",function(a){null==a&&this.getInvalidBS(a=new JU.BS);for(var b=this.vc-a.cardinality(),b=w(b,0),c=0,f=a.nextClearBit(0);0<=f&&f<this.vc;f=a.nextClearBit(f+
1))b[c++]=this.vvs[f];return b},"JU.BS");e(d,"getValidVertices",function(a){var b=null!=a;null==a&&(a=new JU.BS);this.getInvalidBS(a);var c=this.vc-a.cardinality();if(c==this.vc&&b)return null;for(var b=Array(c),f=0,d=a.nextClearBit(0);0<=d&&f<c;d=a.nextClearBit(d+1))b[f++]=this.vs[d];return b},"JU.BS");e(d,"getInvalidBS",function(a){var b=this.jvxlData.jvxlExcluded[1],c=this.jvxlData.thisSet;null!=b&&a.or(b);if(null!=c)for(b=this.vc;0<=--b;)c.get(this.vertexSets[b])||a.set(b)},"JU.BS");e(d,"copyVertexColorMap",
function(){if(null==this.vertexColorMap)return null;for(var a=new java.util.Hashtable,b,c=this.vertexColorMap.entrySet().iterator();c.hasNext()&&((b=c.next())||1);)a.put(b.getKey(),JU.BSUtil.copy(b.getValue()));return a});e(d,"setPropertyColor",function(a){this.colorsExplicit=!1;this.vertexSource=this.colorEncoder=null;this.jvxlData.baseColor=a;this.jvxlData.nVertexColors=0;this.jvxlData.jvxlColorData=null;this.jvxlData.vertexColorMap=this.pymolVertexColorMap=this.vertexColorMap=null;this.hasTranslucentVertices=
!1;this.pcs=this.vcs=null;this.isColorSolid=!0},"~S");e(d,"setPropertyColorPhase",function(a,b,c){this.colorPhased=!0;this.colix=this.jvxlData.minColorIndex=a;this.jvxlData.maxColorIndex=b;this.jvxlData.isBicolorMap=!0;this.isColorSolid=this.jvxlData.colorDensity=!1;this.remapColors(this.vwr,null,c)},"~N,~N,~N")});O("J.jvxl.readers");L(["J.jvxl.readers.SurfaceReader"],"J.jvxl.readers.VolumeDataReader",["JU.AU","$.SB","J.jvxl.data.JvxlCoder","JU.Logger"],function(){var d=z(function(){this.dataType=
0;this.allowMapData=this.precalculateVoxelData=!1;this.point=null;this.maxGrid=this.ptsPerAngstrom=0;this.useOriginStepsPoints=!1;C(this,arguments)},J.jvxl.readers,"VolumeDataReader",J.jvxl.readers.SurfaceReader);Z(d,function(){ia(this,J.jvxl.readers.VolumeDataReader,[])});m(d,"init",function(a){this.initVDR(a)},"J.jvxl.readers.SurfaceGenerator");e(d,"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(d,"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");m(d,"readVolumeParameters",function(a){this.setup(a);this.initializeVolumetricData();return!0},"~B");m(d,"readVolumeData",function(a){try{this.readSurfaceData(a)}catch(b){if($(b,Exception))return System.out.println(b.toString()),
!1;throw b;}return!0},"~B");e(d,"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]=w(this.nPointsZ,0),g=0;g<this.nPointsZ;++g,++c)e[g]=this.getValue(a,d,g,c)}}},"~B");e(d,"setVolumeData",function(){});e(d,"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]=x(this.params.points.x);this.voxelCounts[1]=x(this.params.points.y);this.voxelCounts[2]=x(this.params.points.z);if(1>this.voxelCounts[0]||1>this.voxelCounts[1]||
1>this.voxelCounts[2])return!1;this.showGridInfo();return!0});e(d,"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(d,"setVoxelRange",function(a,b,c,d,e,g){-1E-4<=b-c&&(b=-10,c=10);var h=c-b,j=this.params.resolution;3.4028235E38!=j&&(d=j,g=0);c=M(Math.floor(h*d))+1;c>e&&(0<(this.dataType&256)?3.4028235E38==j?(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==j&&(c=e));1==c&&(c=2);d=(c-1)/h;d<g&&(c=M(Math.floor(g*h+1)),d=(c-1)/h);e=this.volumeData.volumetricVectorLengths[a]=
1/d;this.voxelCounts[a]=c;null!=this.params.sbOut&&this.params.sbOut.append("isosurface resolution for axis "+(a+1)+" set to "+d+" points/Angstrom; "+this.voxelCounts[a]+" voxels\n");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),null!=this.params.sbOut&&this.params.sbOut.append(this.voxelCounts[0]*this.voxelCounts[1]*this.voxelCounts[2]+" voxels total\n")}this.isEccentric&&this.eccentricityMatrix.rotate(this.volumetricVectors[a]);return this.voxelCounts[a]},"~N,~N,~N,~N,~N,~N");m(d,"readSurfaceData",function(a){this.readSurfaceDataVDR(a)},"~B");e(d,"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(d,"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")});m(d,"closeReader",function(){})});O("J.jvxl.readers");
L(["J.jvxl.readers.VolumeDataReader","JU.BS","$.P3","$.P3i","J.atomdata.AtomData"],"J.jvxl.readers.AtomDataReader","java.util.Date JU.AU $.SB $.V3 J.atomdata.RadiusData J.c.VDW J.jvxl.data.JvxlCoder JU.BSUtil $.Logger".split(" "),function(){var d=z(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;C(this,arguments)},J.jvxl.readers,"AtomDataReader",
J.jvxl.readers.VolumeDataReader);da(d,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});Z(d,function(){ia(this,J.jvxl.readers.AtomDataReader,[])});e(d,"initADR",function(a){this.initVDR(a);this.precalculateVoxelData=!0},"J.jvxl.readers.SurfaceGenerator");m(d,"setup",function(){this.setup2()},"~B");e(d,"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(d,"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(d,"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(d,"getAtoms",
function(a,b,c,d,e,g,h,j,u){g&&(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;null!=u&&this.atomData.transformXYZ(u,a);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,j)))continue;this.bsMySelected.set(d);e=!this.havePlane}if(c&&(g||e))this.atomData.atomRadius[d]=
this.getWorkingRadius(d,j)}e=c&&b?this.getWorkingRadius(-1,j):0;this.myAtomCount=JU.BSUtil.cardinalityOf(this.bsMySelected);j=JU.BSUtil.copy(this.bsMySelected);h=0;this.atomProp=null;this.theProperty=3.4028235E38;this.haveOneProperty=!1;a=this.params.theProperty;if(0<this.myAtomCount){u=null;if(b){this.atomData.bsSelected=j;this.sg.atomDataServer.fillAtomData(this.atomData,8);u=Array(h=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;)u[--h]=this.atomData.hAtoms[d][b];h=u.length;JU.Logger.info(h+" attached hydrogens added")}b=h+this.myAtomCount;c&&(this.atomRadius=w(b,0));this.atomXyzTruncated=Array(b);null!=this.params.theProperty&&(this.atomProp=w(b,0));this.atomNo=s(b,0);this.atomIndex=s(b,0);this.myIndex=s(this.ac,0);for(d=0;d<h;d++)c&&(this.atomRadius[d]=e),this.atomXyzTruncated[d]=u[d],this.atomNo[d]=-1,null!=this.atomProp&&this.addAtomProp(d,NaN);this.myAtomCount=h;for(d=j.nextSetBit(0);0<=
d;d=j.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");
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)||(b=JU.V3.newVsub(this.xyzMax,this.xyzMin),b.scale(0.5),this.xyzMin.add(b),b.scale(this.params.scale),this.xyzMax.add2(this.xyzMin,b),this.xyzMin.sub(b));if(g&&0!=this.myAtomCount){g=new JU.P3;this.bsNearby=new JU.BS;for(d=0;d<this.ac;d++)!j.get(d)&&!this.bsMyIgnored.get(d)&&
(b=this.atomData.atomRadius[d],null!=this.params.thePlane&&Math.abs(this.volumeData.distancePointToPlane(this.atomData.xyz[d]))>2*b||(null!=this.params.theProperty&&(b+=this.maxDistance),g=this.atomData.xyz[d],g.x+b>this.xyzMin.x&&(g.x-b<this.xyzMax.x&&g.y+b>this.xyzMin.y&&g.y-b<this.xyzMax.y&&g.z+b>this.xyzMin.z&&g.z-b<this.xyzMax.z)&&(this.bsNearby.set(d),this.nearbyAtomCount++)));g=this.myAtomCount;if(0!=this.nearbyAtomCount){g+=this.nearbyAtomCount;this.atomRadius=JU.AU.arrayCopyF(this.atomRadius,
g);this.atomXyzTruncated=JU.AU.arrayCopyObject(this.atomXyzTruncated,g);null!=this.atomIndex&&(this.atomIndex=JU.AU.arrayCopyI(this.atomIndex,g));null!=a&&(this.atomProp=JU.AU.arrayCopyF(this.atomProp,g));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(d,"setRadii",function(){if(null==this.rs){this.maxRS=0;this.rs=w(this.myAtomCount,0);this.rs2=w(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(d,"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(d,"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(d,"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(d,"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");m(d,"setVolumeData",function(){this.setVolumeDataADR()});e(d,"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(d,"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(d,"resetPlane",function(a){for(var b=
0;b<this.yzCount;b++)this.thisPlane[b]=a},"~N");e(d,"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(d,"getVoxel",function(a,b,c,d){return this.isProgressive?this.thisPlane[d%this.yzCount]:this.voxelData[a][b][c]},"~N,~N,~N,~N");e(d,"unsetVoxelData",function(){this.unsetVoxelData2()});e(d,"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(d,"setGridLimitsForAtom",function(a,b,c,d){b+=this.margin;this.volumeData.xyzToVoxelPt(a.x,a.y,a.z,c);a=M(Math.floor(b/this.volumeData.volumetricVectorLengths[0]));var e=M(Math.floor(b/this.volumeData.volumetricVectorLengths[1]));b=M(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(d,"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(d,"markSphereVoxels",function(a,b){for(var c=3.4028235E38!=b&&null!=this.point,d=this.volumetricVectors[0],e=this.volumetricVectors[1],g=this.volumetricVectors[2],h=this.thisAtomSet.nextSetBit(0);0<=h;h=this.thisAtomSet.nextSetBit(h+1))if(this.havePlane||null==this.validSpheres||this.validSpheres.get(h)){var j=null!=this.noFaceSpheres&&this.noFaceSpheres.get(h),u=h>=this.firstNearbyAtom,k=this.atomXyzTruncated[h],r=this.atomRadius[h];if(!(c&&k.distance(this.point)>b+r+0.5)){var n=r+
a;this.setGridLimitsForAtom(k,n,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 p=this.pt0.x;p<this.pt1.x;p++,this.ptV.add2(d,this.ptY0)){this.ptY0.setT(this.ptV);for(var m=this.pt0.y;m<this.pt1.y;m++,this.ptV.add2(e,this.ptZ0)){this.ptZ0.setT(this.ptV);for(var s=this.pt0.z;s<this.pt1.z;s++,this.ptV.add(g)){var w=this.ptV.distance(k)-r,x=this.volumeData.getPointIndex(p,m,s);if((0==
a||w<=n)&&w<this.getVoxel(p,m,s,x)){if(u||c&&this.ptV.distance(this.point)>b)w=NaN;this.setVoxel(p,m,s,x,w);Float.isNaN(w)||(null!=this.voxelSource&&(this.voxelSource[x]=h+1),0>w&&j&&this.bsSurfaceVoxels.set(x))}}}}}}},"~N,~N");e(d,"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")});O("J.jvxl.readers");L(["JU.P3","J.jvxl.readers.AtomDataReader","JU.P4","$.V3"],"J.jvxl.readers.IsoSolventReader","java.util.Hashtable JU.BS $.Lst $.Measure J.jvxl.data.MeshData JU.BSUtil $.GData $.Logger $.MeshSurface".split(" "),
function(){var d=z(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;na("J.jvxl.readers.IsoSolventReader.Edge")||J.jvxl.readers.IsoSolventReader.$IsoSolventReader$Edge$();na("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;C(this,arguments)},J.jvxl.readers,"IsoSolventReader",J.jvxl.readers.AtomDataReader);da(d,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});Z(d,function(){ia(this,J.jvxl.readers.IsoSolventReader,[])});m(d,"init",function(a){this.initADR(a)},"J.jvxl.readers.SurfaceGenerator");
m(d,"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=s(this.volumeData.nPoints,0));return!0},"~B");m(d,"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){var b=Math.max(this.params.solventExtendedAtomRadius,this.params.solventRadius),b=1<=b?1.5/b:0;0<b&&System.out.println("IsoSolventReader.minPtsPerAng="+b);this.setRanges(this.params.solvent_ptsPerAngstrom,this.params.solvent_gridMax,b);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");m(d,"generateCube",function(){if(!(this.isCavity&&null!=this.params.theProperty)){this.isCavity&&1207!=this.dataType&&1208!=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=s(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()&&Y(a.get(b)[0],"JU.P4")&&(this.volumeData.capData(a.get(b)[0],this.params.cutoff),a.removeItemAt(b--))}});
m(d,"getSurfacePointAndFraction",function(a,b,c,d,e,g,h,j,u,k,m,n,p){k=this.marchingCubes.getLinearOffset(h,j,u,k);m=this.marchingCubes.getLinearOffset(h,j,u,m);this.isSurfacePoint=null!=this.bsSurfaceVoxels&&(this.bsSurfaceVoxels.get(k)||this.bsSurfaceVoxels.get(m));if(null!=this.voxelSource){var s=Math.abs(Float.isNaN(d)||c<d?this.voxelSource[k]:this.voxelSource[m]);0<s&&(this.iAtomSurface=this.atomIndex[s-1])}if(J.jvxl.readers.IsoSolventReader.testLinear||null==this.voxelSource||0==this.voxelSource[k]||
this.voxelSource[k]!=this.voxelSource[m])return this.getSPF(a,b,c,d,e,g,h,j,u,k,m,n,p);a=n[0]=JU.MeshSurface.getSphericalInterpolationFraction(0>this.voxelSource[k]?this.sr:this.atomRadius[this.voxelSource[k]-1],c,d,g.length());p.scaleAdd2(a,g,e);return c+a*(d-c)},"~N,~B,~N,~N,JU.T3,JU.V3,~N,~N,~N,~N,~N,~A,JU.T3");m(d,"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");m(d,"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,g=0;g<c;g++)for(var h=0;h<e;h++)this.dots[h].distance(b[g])<this.envelopeRadius&&(d[g]=NaN);this.meshData.getSurfaceSet();b=this.meshData.nSets;c=JU.BS.newN(b);for(g=0;g<b;g++)if(null!=(d=this.meshData.surfaceSet[g]))for(h=d.nextSetBit(0);0<=h;h=d.nextSetBit(h+
1))if(Float.isNaN(this.meshData.vvs[h])){c.set(g);break}for(g=0;g<b;g++)null!=this.meshData.surfaceSet[g]&&c.get(g)==a&&this.meshData.invalidateSurfaceSet(g);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");m(d,"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,null,!1,!1),e=this.isCavity?4.71238898038469*Math.pow(this.sr,3):0,g=0,h=!1;if(null!=d&&!this.isCavity)for(var j=0;j<this.meshData.nSets;j++){var u=d[j];Math.abs(u)>g&&(g=Math.abs(u),h=0>u)}g=h?-1:1;for(j=0;j<this.meshData.nSets;j++)if(h=b[j],h.intersects(this.bsSurfacePoints)&&(null==d||d[j]*g>e)&&null!=this.params.vertexSource){u=new JU.BS;null==c&&(c=Array(b.length));for(var k=h.nextSetBit(0);0<=k;k=h.nextSetBit(k+
1)){var m=this.params.vertexSource[k];if(!(0>m)){if(a.get(m)){this.meshData.invalidateSurfaceSet(j);break}u.set(m)}}a.or(u)}else this.meshData.invalidateSurfaceSet(j);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.GData.getSlabWithinRange(-100,0))});e(d,"generateSolventCavity",function(){for(var a=JU.BS.newN(this.nPointsX*
this.nPointsY*this.nPointsZ),b=0,c=this.dots.length,d=0,e,g=this.envelopeRadius,h=0;h<this.nPointsX;++h)for(var j=0;j<this.nPointsY;++j){var m=0;a:for(;m<this.nPointsZ;++m,++b)if(3.4028235E38>(e=this.voxelData[h][j][m])&&e>=this.cavityRadius){this.volumeData.voxelPtToXYZ(h,j,m,this.ptV);for(var k=0;k<c;k++)if(this.dots[k].distance(this.ptV)<g)continue a;a.set(b);d++}}JU.Logger.info("cavities include "+d+" voxel points");this.atomRadius=w(d,0);this.atomXyzTruncated=Array(d);for(c=b=h=0;h<this.nPointsX;++h)for(j=
0;j<this.nPointsY;++j)for(m=0;m<this.nPointsZ;++m)a.get(b++)&&(this.volumeData.voxelPtToXYZ(h,j,m,this.atomXyzTruncated[c]=new JU.P3),this.atomRadius[c++]=this.voxelData[h][j][m]);this.myAtomCount=this.firstNearbyAtom=d;this.thisAtomSet=JU.BSUtil.setAll(this.myAtomCount);this.rs=null;this.setRadii()});e(d,"generateSolventCube",function(){1207!=this.dataType&&(this.params.vertexSource=s(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(d,"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],g=b.distance(this.atomXyzTruncated[d]);g>=c+e||(e=wa(J.jvxl.readers.IsoSolventReader.Edge,this,null,this,a,d,g),this.vEdges.addLast(e),this.bsLocale[a].set(d),this.bsLocale[d].set(a),this.htEdges.put(e.toString(),e))}}}});e(d,"findEdge",function(a,b){return this.htEdges.get(a<b?a+"_"+b:b+"_"+a)},"~N,~N");e(d,"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 g=a.nextSetBit(e+1);0<=g;g=a.nextSetBit(g+1))if(this.getSolventPoints(c,d,e,g)){var h,j=!1;if(null!=(h=this.validateFace(d,e,g,c,this.ptS1)))this.vFaces.addLast(h),j=!0;if(null!=(h=this.validateFace(d,e,g,c,this.ptS2)))this.vFaces.addLast(h),
j=!0;j&&(this.noFaceSpheres.clear(d),this.noFaceSpheres.clear(e),this.noFaceSpheres.clear(g))}}});e(d,"validateFace",function(a,b,c,d,e){this.sg.atomDataServer.setIteratorForPoint(this.iter,this.modelIndex,e,this.maxRS);for(var g=!0;this.iter.hasNext();){var h=this.iter.next(),j=this.myIndex[h];if(!(j==a||j==b||j==c)&&this.atomData.atoms[h].distance(e)<this.atomData.atomRadius[h]+this.sr){g=!1;break}}h=this.findEdge(b,c);j=this.findEdge(a,c);e=g?wa(J.jvxl.readers.IsoSolventReader.Face,this,null,a,
b,c,e):null;d.addFace(e);h.addFace(e);j.addFace(e);if(!g)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(d,"markFaceVoxels",function(a){for(var b=new JU.BS,c=this.volumetricVectors[0],d=this.volumetricVectors[1],e=this.volumetricVectors[2],g=this.vFaces.size();0<=--g;){var h=this.vFaces.get(g),j=this.atomXyzTruncated[h.ia],m=this.atomXyzTruncated[h.ib],k=this.atomXyzTruncated[h.ic],r=h.pS;this.setGridLimitsForAtom(r,
this.sr,this.pt0,this.pt1);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(c,this.ptY0)){this.ptY0.setT(this.ptV);for(var p=this.pt0.y;p<this.pt1.y;p++,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 w=this.sr-this.ptV.distance(r),x=this.voxelData[n][p][s],z=this.volumeData.getPointIndex(n,p,s);a&&0<w&&this.bsSurfaceDone.set(z);if(JU.Measure.isInTetrahedron(this.ptV,
j,m,k,r,this.plane,this.vTemp,this.vTemp2,!1)&&(!a?!this.bsSurfaceDone.get(z)&&0>w&&w>1.8*-this.volumeData.maxGrid&&w>x==b.get(z):0<w&&(0>x||3.4028235E38==x||w>x==b.get(z))))b.set(z),this.setVoxel(n,p,s,z,w),null!=this.voxelSource&&(this.voxelSource[z]=-1-h.ia),0<w&&this.bsSurfaceVoxels.set(z)}}}}},"~B");e(d,"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 g=
e.ia,h=e.ib,j=this.atomXyzTruncated[g],m=this.atomXyzTruncated[h];this.rAS=this.rs[g];this.rBS=this.rs[h];this.rAS2=this.rs2[g];this.rBS2=this.rs2[h];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(h=this.pt0.y;h<this.pt1.y;h++,this.ptV.add2(b,this.ptZ0)){this.ptZ0.setT(this.ptV);
for(var k=this.pt0.z;k<this.pt1.z;k++,this.ptV.add(c)){var r=this.checkSpecialVoxel(j,m,this.ptV);if(!Float.isNaN(r)&&(r=this.sr-r,r<this.voxelData[e][h][k])){var n=this.volumeData.getPointIndex(e,h,k);this.setVoxel(e,h,k,n,r);null!=this.voxelSource&&(this.voxelSource[n]=-1-g)}}}}}}});m(d,"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(d,"getSolventPoints",function(a,b,c,d){var e=this.rs[b],g=a.v;a=(a.d2+this.rs2[b]-this.rs2[c])/(2*a.d*e);c=Math.acos(a);this.p.scaleAdd2(a*e,g,this.atomXyzTruncated[b]);JU.Measure.getPlaneThroughPoint(this.p,g,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,g,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(g,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(d,"checkSpecialVoxel",function(a,b,c){var d=a.distance(c),e=a.distanceSquared(c),g=this.rAS/d;if(1<g)return this.p.set(a.x+(c.x-a.x)*g,a.y+
(c.y-a.y)*g,a.z+(c.z-a.z)*g),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<(g=this.rBS/d)?(this.p.set(b.x+(c.x-b.x)*g,b.y+(c.y-b.y)*g,b.z+(c.z-b.z)*g),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(d,"solventDistance",function(a,b,c,d,e,g){g=Math.acos((e+this.dAB2-g)/(2*d*this.dAB));c=Math.acos((b+this.dAB2-c)/(2*a*this.dAB));
e=b+e-2*a*d*Math.cos(c-g);c=Math.sqrt(e);return this.ecosASB2<(b+e-d*d)/(c*a)?c:NaN},"~N,~N,~N,~N,~N,~N");e(d,"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(d,"dumpLine2",function(a,b,c,d,e,g){var h=new JU.V3;h.setT(b);h.sub(a);h.normalize();h.scale(d);h.add(a);this.sg.log('draw ID "'+c+this.nTest++ +'" '+JU.P3.newP(a)+" "+JU.P3.newP(h)+" color "+e);this.sg.log('draw ID "'+c+this.nTest++ +'"'+JU.P3.newP(h)+
" "+JU.P3.newP(b)+" color "+g+'"'+c+'"')},"JU.P3,JU.P3,~S,~N,~S,~S");e(d,"dumpPoint",function(a,b,c){this.sg.log('draw ID "'+b+this.nTest++ +'"'+JU.P3.newP(a)+" color "+c)},"JU.P3,~S,~S");m(d,"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");m(d,"discardTempData",
function(a){this.rs2=this.rs=null;this.discardTempDataSR(a)},"~B");m(d,"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");d.$IsoSolventReader$Edge$=function(){var a=z(function(){oa(this,
arguments);this.cosASB2=this.maxr=this.d2=this.d=this.nInvalid=this.nFaces=this.ib=this.ia=0;this.v=null;C(this,arguments)},J.jvxl.readers.IsoSolventReader,"Edge",JU.P3);jb(a,function(a,c,d,e){this.ia=Math.min(c,d);this.ib=Math.max(c,d);this.d=e;this.d2=e*e;this.maxr=Math.sqrt(this.d2/4+Math.max(a.rs2[c],a.rs2[d]));this.ave(a.atomXyzTruncated[c],a.atomXyzTruncated[d]);this.cosASB2=(a.rs2[c]+a.rs2[d]-this.d2)/(a.rs[d]*a.rs[c]);this.v=JU.V3.newVsub(a.atomXyzTruncated[d],a.atomXyzTruncated[c]);this.v.normalize()},
"J.jvxl.readers.IsoSolventReader,~N,~N,~N");e(a,"addFace",function(a){this.nFaces++;null==a&&this.nInvalid++},"J.jvxl.readers.IsoSolventReader.Face");e(a,"isValid",function(){return 0==this.nFaces||this.nInvalid!=this.nFaces});m(a,"toString",function(){return this.ia+"_"+this.ib})};d.$IsoSolventReader$Face$=function(){var a=z(function(){oa(this,arguments);this.ic=this.ib=this.ia=0;this.pS=null;C(this,arguments)},J.jvxl.readers.IsoSolventReader,"Face",null);Z(a,function(a,c,d,e){this.ia=a;this.ib=
c;this.ic=d;this.pS=JU.P3.newP(e)},"~N,~N,~N,JU.P3");m(a,"toString",function(){return this.ia+"_"+this.ib+"_"+this.ic+"_"+this.pS})};d.testLinear=!1});O("J.jvxl.readers");L(["J.jvxl.readers.SurfaceReader"],"J.jvxl.readers.SurfaceFileReader",["JU.PT","$.Rdr","J.api.Interface"],function(){var d=z(function(){this.next=this.line=this.out=this.binarydoc=this.br=null;C(this,arguments)},J.jvxl.readers,"SurfaceFileReader",J.jvxl.readers.SurfaceReader);da(d,function(){this.next=s(1,0)});Z(d,function(){ia(this,
J.jvxl.readers.SurfaceFileReader,[])});e(d,"setStream",function(a,b){if(null==a)this.binarydoc.setStream(null,b);else try{if(Y(this.br,"JU.Rdr.StreamReader")){var c=this.br.getStream();c.reset();this.binarydoc.setStream(c,!0)}}catch(d){if($(d,Exception))System.out.println("BCifDensityReader "+d),this.binarydoc.setStream(this.sg.atomDataServer.getBufferedInputStream(a),b);else throw d;}},"~S,~B");m(d,"init",function(a){this.initSR(a)},"J.jvxl.readers.SurfaceGenerator");e(d,"init2",function(a,b){this.init2SFR(a,
b)},"J.jvxl.readers.SurfaceGenerator,java.io.BufferedReader");e(d,"init2SFR",function(a,b){this.br=b;this.init(a)},"J.jvxl.readers.SurfaceGenerator,java.io.BufferedReader");e(d,"newBinaryDocument",function(){return J.api.Interface.getInterface("JU.BinaryDocument",this.sg.atomDataServer,"file")});m(d,"setOutputChannel",function(a){null==this.binarydoc?this.out=a:this.sg.setOutputChannel(this.binarydoc,a)},"JU.OC");m(d,"closeReader",function(){this.closeReaderSFR()});e(d,"closeReaderSFR",function(){if(null!=
this.br)try{this.br.close()}catch(a){if(!$(a,"java.io.IOException"))throw a;}null!=this.out&&this.out.closeChannel();null!=this.binarydoc&&this.binarydoc.close()});m(d,"discardTempData",function(a){this.closeReader();this.discardTempDataSR(a)},"~B");e(d,"getTokens",function(){return JU.PT.getTokensAt(this.line,0)});e(d,"parseFloat",function(){return JU.PT.parseFloatNext(this.line,this.next)});e(d,"parseFloatStr",function(a){this.next[0]=0;return JU.PT.parseFloatNext(a,this.next)},"~S");e(d,"parseFloatRange",
function(a,b,c){this.next[0]=b;return JU.PT.parseFloatRange(a,c,this.next)},"~S,~N,~N");e(d,"parseInt",function(){return JU.PT.parseIntNext(this.line,this.next)});e(d,"parseIntStr",function(a){this.next[0]=0;return JU.PT.parseIntNext(a,this.next)},"~S");e(d,"parseIntNext",function(a){return JU.PT.parseIntNext(a,this.next)},"~S");e(d,"parseFloatArrayStr",function(a){this.next[0]=0;return JU.PT.parseFloatArrayNext(a,this.next,null,null,null)},"~S");e(d,"parseFloatArray",function(a,b,c){return JU.PT.parseFloatArrayNext(this.line,
this.next,a,b,c)},"~A,~S,~S");e(d,"getQuotedStringNext",function(){return JU.PT.getQuotedStringNext(this.line,this.next)});e(d,"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(d,"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})});O("J.jvxl.readers");L(["J.jvxl.readers.SurfaceFileReader"],
"J.jvxl.readers.VolumeFileReader","JU.AU $.PT $.SB J.api.Interface J.atomdata.AtomData JU.Logger".split(" "),function(){var d=z(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;C(this,arguments)},J.jvxl.readers,
"VolumeFileReader",J.jvxl.readers.SurfaceFileReader);Z(d,function(){ia(this,J.jvxl.readers.VolumeFileReader,[])});m(d,"init2",function(a,b){this.init2VFR(a,b)},"J.jvxl.readers.SurfaceGenerator,java.io.BufferedReader");e(d,"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(d,"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");m(d,"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)))});m(d,"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");m(d,"readVolumeData",function(a){return this.readVolumeDataVFR(a)},"~B");e(d,"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(d,"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=s(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,
JU.Logger.info("voxel grid count/vector:"+this.line);this.scaleIsosurface(this.params.scale);this.volumeData.setVolumetricXml();return this.nSurfaces}catch(e){if($(e,Exception))return JU.Logger.error(e.toString()),0;throw e;}});e(d,"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(d,"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(d,"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:this.getJVXLCutoff());this.nDataPoints=0;this.next[0]=0;this.line="";this.jvxlNSurfaceInts=0});e(d,"getJVXLCutoff",
function(){return 0.5});m(d,"readSurfaceData",function(a){this.readSurfaceDataVFR(a)},"~B");e(d,"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=
w(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");m(d,"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(d,"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=w(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(d,"getPlaneVFR",function(a,b){try{for(var c=0,d=0;c<this.nPointsY;++c){for(var e=0;e<this.nPointsZ;++e){var g=this.getNextVoxelValue();b&&this.recordData(g);a[d++]=g;0!=this.nSkipX&&this.skipVoxels(this.nSkipX)}0!=this.nSkipY&&this.skipVoxels(this.nSkipY)}0!=this.nSkipZ&&this.skipVoxels(this.nSkipZ)}catch(h){if(!$(h,Exception))throw h;}},"~A,~B");m(d,"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(d,"skipVoxels",function(a){for(;0<=--a;)this.getNextVoxelValue()},"~N");e(d,"getVoxelBitSet",function(){return null},"~N");e(d,"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(d,"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});m(d,"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(d,"skipData",function(a){this.skipDataVFR(a)},"~N");e(d,"skipDataVFR",function(a){for(var b=0;b<a;)b+=this.countData(this.rd())},"~N");e(d,"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");d.checkAtomLine=e(d,"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 g=""+c;d=d.substring(d.indexOf(g)+g.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");m(d,"getSurfacePointAndFraction",function(a,b,c,d,e,g,h,j,m,k,r,n,p){return this.getSPFv(a,b,c,d,e,g,h,j,m,k,r,n,p)},"~N,~B,~N,~N,JU.T3,JU.V3,~N,~N,~N,~N,~N,~A,JU.T3");e(d,"getSPFv",function(a,b,c,d,e,g,h,j,m,k,r,n,p){a=this.getSPF(a,b,c,d,e,g,h,j,m,k,r,n,p);if(null==this.qpc||Float.isNaN(a)||!this.hasColorData)return a;k=this.marchingCubes.getLinearOffset(h,j,m,k);r=this.marchingCubes.getLinearOffset(h,j,m,r);return this.qpc.process(k,r,n[0])},"~N,~B,~N,~N,JU.T3,JU.V3,~N,~N,~N,~N,~N,~A,JU.T3");
e(d,"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(d,"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})});O("J.jvxl.readers");L(["J.jvxl.readers.VolumeFileReader"],"J.jvxl.readers.JvxlXmlReader","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(){var d=z(function(){this.JVXL_VERSION="2.4";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;
C(this,arguments)},J.jvxl.readers,"JvxlXmlReader",J.jvxl.readers.VolumeFileReader);Z(d,function(){ia(this,J.jvxl.readers.JvxlXmlReader,[])});m(d,"init2",function(a,b){this.init2JXR(a,b)},"J.jvxl.readers.SurfaceGenerator,java.io.BufferedReader");e(d,"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");m(d,"readVolumeData",function(a){if(!this.readVolumeDataVFR(a))return!1;
this.strFractionTemp=this.jvxlEdgeDataRead;this.fractionPtr=0;return!0},"~B");m(d,"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));this.getVertexColorData()}catch(b){if($(b,Exception))return JU.Logger.error(b.toString()),
!1;throw b;}return!0},"~B");e(d,"getVertexColorData",function(){if(this.jvxlDataIsColorMapped&&0<this.jvxlData.nVertexColors){var a=this.xr.getXmlData("jvxlVertexColorData",null,!0,!1);if(null==a)this.jvxlData.nVertexColors=0,this.jvxlDataIsColorMapped=!1;else{this.jvxlData.vertexColorMap=new java.util.Hashtable;var b=J.jvxl.readers.XmlReader.getXmlAttrib(a,"baseColor");this.jvxlData.baseColor=0<b.length?b:null;for(var b=s(1,0),c=0;c<this.jvxlData.nVertexColors;c++){var d=this.xr.getXmlDataLF("jvxlColorMap",
a,!0,!1,!1,b),e=J.jvxl.readers.XmlReader.getXmlAttrib(d,"color"),d=J.jvxl.data.JvxlCoder.jvxlDecodeBitSet(this.xr.getXmlData("jvxlColorMap",d,!1,!1));this.jvxlData.vertexColorMap.put(e,d)}}}});m(d,"readParameters",function(){var a=this.xr.getXmlDataLF("jvxlFileTitle",null,!1,!1,!0,null);this.jvxlFileHeaderBuffer=JU.SB.newS(null==a?"":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)});m(d,"getJVXLCutoff",function(){return this.params.cutoff});
e(d,"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");m(d,"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(d,"jvxlSkipData",function(){this.rd();this.xr.skipTag("jvxlSurface")},"~N,~B");e(d,"jvxlReadSurfaceInfo",function(){var a=this.xr.getXmlData("jvxlSurfaceInfo",null,!0,!0);this.isXLowToHigh=J.jvxl.readers.XmlReader.getXmlAttrib(a,"isXLowToHigh").equals("true");var b=J.jvxl.readers.XmlReader.getXmlAttrib(a,
"cutoff");0>b.indexOf(" ")?(this.jvxlCutoff=this.parseFloatStr(b),Double.isNaN(this.jvxlCutoff)||JU.Logger.info("JVXL read: cutoff "+this.jvxlCutoff)):(this.jvxlCutoffRange=this.parseFloatArrayStr(b),this.jvxlCutoff=this.jvxlCutoffRange[0],JU.Logger.info("JVXL read: cutoff "+JU.Escape.eAF(this.jvxlCutoffRange)));this.params.cutoff=this.jvxlCutoff;var c=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"nContourData"));this.haveContourData=0<c;this.params.isContoured=this.jvxlData.isModelConnected=
J.jvxl.readers.XmlReader.getXmlAttrib(a,"contoured").equals("true");this.params.isModelConnected=J.jvxl.readers.XmlReader.getXmlAttrib(a,"isModelConnected").equals("true");if(this.params.isContoured){var d=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"nContours"));0>=d?d=0:(0>this.params.thisContour&&(this.params.thisContour=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"thisContour"))),b=J.jvxl.readers.XmlReader.getXmlAttrib(a,"contourValues"),0<b.length&&(b=b.$replace("[",
" ").$replace("]"," "),this.jvxlData.contourValues=this.params.contoursDiscrete=this.parseFloatArrayStr(b),JU.Logger.info("JVXL read: contourValues "+JU.Escape.eAF(this.jvxlData.contourValues))),b=J.jvxl.readers.XmlReader.getXmlAttrib(a,"contourColors"),0<b.length&&(this.jvxlData.contourColixes=this.params.contourColixes=JU.C.getColixArray(b),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(a,"contourFromZero").equals("true"));this.params.nContours=this.haveContourData?c:d}this.jvxlData.nVertexColors=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"nVertexColors"));this.params.isBicolorMap=J.jvxl.readers.XmlReader.getXmlAttrib(a,"bicolorMap").equals("true");this.params.isBicolorMap&&(b=J.jvxl.readers.XmlReader.getXmlAttrib(a,"colorPositive"),0<b.length&&(-2147483648==this.params.colorRgb&&-16776961==this.params.colorPos)&&
(this.params.colorPos=JU.CU.getArgbFromString(b)),b=J.jvxl.readers.XmlReader.getXmlAttrib(a,"colorNegative"),0<b.length&&(-2147483648==this.params.colorRgb&&-65536==this.params.colorNeg)&&(this.params.colorNeg=JU.CU.getArgbFromString(b)));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(a,"colorMapped").equals("true"));
this.jvxlData.isJvxlPrecisionColor=J.jvxl.readers.XmlReader.getXmlAttrib(a,"precisionColor").equals("true");this.jvxlData.jvxlDataIsColorDensity=this.params.colorDensity=-2147483648==this.params.colorRgb&&J.jvxl.readers.XmlReader.getXmlAttrib(a,"colorDensity").equals("true");this.jvxlData.jvxlDataIsColorDensity&&Float.isNaN(this.params.pointSize)&&(b=J.jvxl.readers.XmlReader.getXmlAttrib(a,"pointSize"),0<b.length&&(this.jvxlData.pointSize=this.params.pointSize=this.parseFloatStr(b)));b=J.jvxl.readers.XmlReader.getXmlAttrib(a,
"allowVolumeRender");this.jvxlData.allowVolumeRender=this.params.allowVolumeRender=0==b.length||b.equalsIgnoreCase("true");b=J.jvxl.readers.XmlReader.getXmlAttrib(a,"plane");if(0<=b.indexOf("{")){this.params.thePlane=null;this.params.mapLattice=null;try{this.params.thePlane=JU.Escape.uP(b),b=J.jvxl.readers.XmlReader.getXmlAttrib(a,"maplattice"),JU.Logger.info("JVXL read: plane "+this.params.thePlane),0<=b.indexOf("{")&&(this.params.mapLattice=JU.Escape.uP(b),JU.Logger.info("JVXL read: mapLattice "+
this.params.mapLattice)),0==this.params.scale3d&&(this.params.scale3d=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"scale3d"))),Float.isNaN(this.params.scale3d)&&(this.params.scale3d=0)}catch(e){if($(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(a,"nSurfaceInts")),this.edgeDataCount=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"nBytesUncompressedEdgeData")),b=J.jvxl.readers.XmlReader.getXmlAttrib(a,"fixedLattice"),0<=b.indexOf("{")&&(this.jvxlData.fixedLattice=JU.Escape.uP(b));this.excludedVertexCount=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"nExcludedVertexes"));this.excludedTriangleCount=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,
"nExcludedTriangles"));this.invalidatedVertexCount=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"nInvalidatedVertexes"));b=J.jvxl.readers.XmlReader.getXmlAttrib(a,"slabInfo");0<b.length&&(this.jvxlData.slabInfo=b);this.colorDataCount=Math.max(0,this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"nBytesUncompressedColorData")));this.jvxlDataIs2dContour=null!=this.params.thePlane&&this.jvxlDataIsColorMapped;this.jvxlData.color=J.jvxl.readers.XmlReader.getXmlAttrib(a,"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(a,"translucency"));Float.isNaN(this.jvxlData.translucency)&&(this.jvxlData.translucency=0);b=J.jvxl.readers.XmlReader.getXmlAttrib(a,"meshColor");0<b.length&&(this.jvxlData.meshColor=b);b=J.jvxl.readers.XmlReader.getXmlAttrib(a,"rendering");0<b.length&&(this.jvxlData.rendering=b);this.jvxlData.colorScheme=J.jvxl.readers.XmlReader.getXmlAttrib(a,
"colorScheme");0==this.jvxlData.colorScheme.length&&(this.jvxlData.colorScheme=this.jvxlDataIsColorMapped?"roygb":null);b="inherit".equals(this.jvxlData.colorScheme);if(null==this.jvxlData.thisSet&&(c=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"set")),0<c&&(this.jvxlData.thisSet=new JU.BS,this.jvxlData.thisSet.set(c-1)),c=J.jvxl.readers.XmlReader.getXmlAttrib(a,"subset"),null!=c&&2<c.length&&(c=c.$replace("["," ").$replace("]"," ").trim().$plit(" "),0<c.length))){this.jvxlData.thisSet=
new JU.BS;for(d=c.length;0<=--d;)this.jvxlData.thisSet.set(JU.PT.parseInt(c[d])-1)}this.jvxlData.slabValue=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"slabValue"));this.jvxlData.isSlabbable=J.jvxl.readers.XmlReader.getXmlAttrib(a,"slabbable").equalsIgnoreCase("true");this.jvxlData.diameter=this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"diameter"));-2147483648==this.jvxlData.diameter&&(this.jvxlData.diameter=0);this.jvxlDataIs2dContour&&(this.params.isContoured=!0);if(!b){this.params.colorBySign&&
(this.params.isBicolorMap=!0);var b=J.jvxl.readers.XmlReader.getXmlAttrib(a,"insideOut").equals("true"),g=d=c=NaN,h=NaN;this.jvxlDataIsColorMapped&&(c=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"dataMinimum")),d=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"dataMaximum")),g=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"valueMappedToRed")),h=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"valueMappedToBlue")),Float.isNaN(c)&&(c=g=-1,d=h=1));this.jvxlSetColorRanges(c,
d,g,h,b)}});e(d,"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");m(d,"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(d,"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(d,"readSurfaceDataJXR",function(){this.readSurfaceDataVFR(!1);this.volumeData.setMappingPlane(null)});e(d,"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($(d,Exception))throw JU.Logger.error("Error reading "+a+" data "+d),new NullPointerException;throw d;}return b},"~S,~N");m(d,"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");m(d,"getSurfacePointAndFraction",function(a,b,c,d,e,g,h,j,m,k,r,n,p){if(0>=this.edgeDataCount)return this.getSPFv(a,b,c,d,e,g,h,
j,m,k,r,n,p);p.scaleAdd2(n[0]=this.jvxlGetNextFraction(this.edgeFractionBase,this.edgeFractionRange,0.5),g,e);Float.isNaN(this.valueMin)&&this.setValueMinMax();return 0==this.valueCount||this.includeValueNaN&&Float.isNaN(n[0])?n[0]:this.getNextValue()},"~N,~B,~N,~N,JU.T3,JU.V3,~N,~N,~N,~N,~N,~A,JU.T3");e(d,"getNextValue",function(){for(var a=NaN;this.colorPtr<this.valueCount&&Float.isNaN(a);){a=this.jvxlData.isJvxlPrecisionColor?J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter2(this.jvxlColorDataRead.charAt(this.colorPtr).charCodeAt(0),
this.jvxlColorDataRead.charAt(this.colorPtr++ +this.valueCount).charCodeAt(0),this.colorFractionBase,this.colorFractionRange):J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter(this.jvxlColorDataRead.charAt(this.colorPtr++).charCodeAt(0),this.colorFractionBase,this.colorFractionRange,0.5);break}return this.valueMin+a*this.valueRange});e(d,"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(d,"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.charAt(this.fractionPtr++).charCodeAt(0),a,b,c)},"~N,~N,~N");m(d,"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=s(a,0);for(var d=s(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,g=this.jvxlData.translucency,h=0,d=0;d<c;d++)try{var j=J.jvxl.readers.JvxlXmlReader.getColor(a[d]);0==j?j=h:h=j;b[d]=JU.C.getColixTranslucent(this.jvxlData.vertexColors[d]=j);JU.C.isColixTranslucent(b[d])?e=!0:0!=g&&(b[d]=JU.C.getColixTranslucent3(b[d],!0,g))}catch(m){if($(m,Exception))JU.Logger.info("JvxlXmlReader: Cannot interpret color code: "+a[d]);else throw m;}e&&0==g&&(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);"inherit".equals(this.jvxlData.colorScheme)||
JU.Logger.info("mapping red--\x3eblue for "+this.params.valueMappedToRed+" to "+this.params.valueMappedToBlue+" colorPrecision:"+this.jvxlData.isJvxlPrecisionColor);var k=Float.isNaN(this.valueMin);k&&this.setValueMinMax();var r=3.4028235E38,n=-3.4028235E38;if(null==b||b.length<a)this.meshData.vcs=b=ea(a,0);e=j=0;this.params.colorBySign&&(e=JU.C.getColix(this.params.isColorReversed?this.params.colorNeg:this.params.colorPos),j=JU.C.getColix(this.params.isColorReversed?this.params.colorPos:this.params.colorNeg));
for(var g=this.meshData.vertexIncrement,p=3.4028235E38==this.params.mappedDataMin,d=0;d<a;d+=g)h=k?c[d]=this.getNextValue():c[d],p&&(h<r&&(r=h),h>n&&(n=h));p&&(this.params.mappedDataMin=r,this.params.mappedDataMax=n);if(null!=this.jvxlData.colorScheme){k=null!=this.marchingSquares&&this.params.isContoured;for(d=0;d<a;d+=g)h=c[d],k?this.marchingSquares.setContourData(d,h):(h=!this.params.colorBySign?this.params.colorEncoder.getColorIndex(h):(this.params.isColorReversed?0<h:0>=h)?j:e,b[d]=JU.C.getColixTranslucent3(h,
!0,this.jvxlData.translucency))}return this.jvxlColorDataRead+"\n"});d.getColor=e(d,"getColor",function(a){var b=0;try{switch(a.charAt(0).charCodeAt(0)){case 91:b=JU.CU.getArgbFromString(a);break;case 48:if(1==a.length)break;b=JU.PT.parseIntRadix(a.substring(2),16);break;default:b=JU.PT.parseIntRadix(a,10)}}catch(c){if(!$(c,Exception))throw c;}return b},"~S");e(d,"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));this.getVertexColorData()});e(d,"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");d.getEncoding=e(d,"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(d,"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,g,h=J.jvxl.readers.XmlReader.getXmlAttrib(a,"data"),j=J.jvxl.readers.JvxlXmlReader.getEncoding(a);if("none".equals(j)){0==h.length&&(h=this.xr.getXmlData("jvxlVertexData",
a,!1,!1));d=JU.PT.parseFloatArray(h);d[0]!=3*c&&JU.Logger.info("JvxlXmlReader: vertexData count="+x(d[0])+"; expected "+3*c);h=0;for(j=1;h<c;h++){var m=JU.P3.new3(d[j++],d[j++],d[j++]);b?e[h]=m:this.addVertexCopy(m,0,h,!1)}}else{var k=this.xr.getXmlPoint(a,"min"),r=this.xr.getXmlPoint(a,"max");r.sub(k);var n=this.jvxlData.colorFractionBase,p=this.jvxlData.colorFractionRange,s=J.jvxl.data.JvxlCoder.jvxlDecompressString(h);0==s.length&&(s=this.xr.getXmlData("jvxlVertexData",a,!1,!1));h=0;for(j=-1;h<
c;h++)m=new JU.P3,g=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter2(s.charAt(++j).charCodeAt(0),s.charAt(j+d).charCodeAt(0),n,p),m.x=k.x+g*r.x,g=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter2(s.charAt(++j).charCodeAt(0),s.charAt(j+d).charCodeAt(0),n,p),m.y=k.y+g*r.y,g=J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter2(s.charAt(++j).charCodeAt(0),s.charAt(j+d).charCodeAt(0),n,p),m.z=k.z+g*r.z,b?e[h]=m:this.addVertexCopy(m,0,h,!1)}return e},"~S,~B");e(d,"jvxlDecodeTriangleData",function(a,b,c){var d=
this.parseIntStr(J.jvxl.readers.XmlReader.getXmlAttrib(a,"count"));if(!(0>d)){var e=s(1,0),g=null==c?-1:1,h=0;JU.Logger.info("Reading "+d+" triangles");var j=J.jvxl.readers.JvxlXmlReader.getEncoding(a);a=this.getData(a,"jvxlTriangleData");b=this.getData(b,"jvxlTriangleEdgeData");var m=s(3,0),k=s(1,0),r=null,n=7,p=!"none".equals(j);if(p)a=J.jvxl.data.JvxlCoder.jvxlDecompressString(a),b=J.jvxl.data.JvxlCoder.jvxlDecompressString(b).trim(),j=b.length==d;else{var w=JU.PT.parseIntNext(a,k);(j=0<b.length)?
(r=s(1,0),JU.PT.parseIntNext(b,r)):0<w&&JU.Logger.info("JvxlXmlReader: jvxlTriangleEdgeData count="+w+"; expected "+d)}for(var x=w=0,z=0,C=-1;w<d;){if(p){var B=a.charAt(++C);switch(B.charCodeAt(0)){case 33:B=0;break;case 43:case 46:case 32:case 10:case 13:case 9:case 44:continue;case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:k[0]=C;B=JU.PT.parseIntNext(a,k);C=k[0]-1;break;default:B=B.charCodeAt(0)-92}x+=B}else x=JU.PT.parseIntNext(a,k)-1;m[z]=x;if(3==++z){z=
0;if(j&&(n=null==r?b.charAt(w).charCodeAt(0)-48:JU.PT.parseIntNext(b,r),0>n||7<n))n=7;0==--g&&(g=JU.PT.parseIntNext(c,e),B=JU.PT.parseIntNext(c,e),-2147483648==B?g=0:h=B|4278190080);this.addTriangleCheck(m[0],m[1],m[2],n,h,!1,h);w++}}}},"~S,~S,~S");e(d,"jvxlDecodeContourData",function(a,b){var c=new JU.Lst,d=new JU.SB,e=new JU.SB,g=-1;a.vContours=null;if(null!=b){for(;0<=(g=b.indexOf("<jvxlContour",g+1));){var h=new JU.Lst,j=this.xr.getXmlData("jvxlContour",b.substring(g),!0,!1),m=this.parseFloatStr(J.jvxl.readers.XmlReader.getXmlAttrib(j,
"value"));d.append(" ").appendF(m);var k=J.jvxl.readers.JvxlXmlReader.getColor(J.jvxl.readers.XmlReader.getXmlAttrib(j,"color")),r=JU.C.getColix(k);e.append(" ").append(JU.Escape.escapeColor(k));var n=J.jvxl.data.JvxlCoder.jvxlDecompressString(J.jvxl.readers.XmlReader.getXmlAttrib(j,"data")),p=J.jvxl.data.JvxlCoder.jvxlDecodeBitSet(this.xr.getXmlData("jvxlContour",j,!1,!1)),j=p.length();J.shapesurface.IsosurfaceMesh.setContourVector(h,j,p,m,r,k,JU.SB.newS(n));c.addLast(h)}j=c.size();if(0<j){a.vContours=
JU.AU.createArrayOfArrayList(j);a.contourColixes=this.params.contourColixes=ea(j,0);a.contourValues=this.params.contoursDiscrete=w(j,0);for(g=0;g<j;g++)a.vContours[g]=c.get(g),a.contourValues[g]=a.vContours[g].get(2).floatValue(),a.contourColixes[g]=a.vContours[g].get(3)[0];a.contourColors=JU.C.getHexCodes(a.contourColixes);JU.Logger.info("JVXL read: "+j+" discrete contours");JU.Logger.info("JVXL read: contour values: "+d);JU.Logger.info("JVXL read: contour colors: "+e)}}},"J.jvxl.data.JvxlData,~S");
m(d,"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())})});O("J.rendersurface");L(["J.render.MeshRenderer"],"J.rendersurface.IsosurfaceRenderer",["JU.V3","JU.C","$.Normix"],function(){var d=z(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;C(this,arguments)},J.rendersurface,"IsosurfaceRenderer",J.render.MeshRenderer);m(d,"render",function(){return this.renderIso()});e(d,"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(d,"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(603979866)?Boolean.TRUE:null;this.isosurface.keyXy=null;this.meshScale=-1;this.globalSlabValue=this.vwr.gdata.slab;this.mySlabValue=this.isNavigationMode?x(this.tm.getNavigationOffset().z):2147483647});e(d,"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 g=this.antialias?2:1,h=this.vwr.getScreenHeight()*g,j=M(M(h/2)/(d-1)),h=3*M(h/4)-j,m=10*g,k=20*g;this.isosurface.keyXy=s(-1,[M(m/g),0,M((m+k)/g),M((h+j)/g),M(j/g)]);for(var r=0;r<d;r++,h-=j){switch(e){case 0:if(!this.g3d.setC(b[r]))return;
break;case 1:if(!this.g3d.setC(c[r].get(3)[0]))return;break;case 2:this.vwr.gdata.setColor(a[r])}this.g3d.fillTextRect(m,h,5,-2147483648,k,j)}this.isosurface.keyXy[1]=M((h+j)/g)}}});e(d,"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(1111490588);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});m(d,"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(d,"renderLonePair",function(a){this.pt2f.setT(this.vertices[1]);this.tm.transformPt3f(this.pt2f,this.pt2f);var b=x(this.vwr.tm.scaleToScreen(x(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);if(this.pt2f.z>this.pt1f.z&&
0>this.pt1f.z-this.pt2f.z+Math.sqrt((this.pt1f.x-this.pt2f.x)*(this.pt1f.x-this.pt2f.x)+(this.pt1f.y-this.pt2f.y)*(this.pt1f.y-this.pt2f.y)))return;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(x(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)-110);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)-110);this.g3d.fillSphereI(b,this.screens[1])},"~B");e(d,"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(),g=6;g<d;g++){var h=
c.get(g),j=c.get(++g);if(Float.isNaN(h.x)||Float.isNaN(j.x))break;this.tm.transformPtScrT3(h,this.pt1f);this.tm.transformPtScrT3(j,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)}}}}});m(d,"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(553648140),
this.frontOnly=this.isShell=!1):c=M(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?M(this.vwr.getScreenWidth()/2):0,g=this.showNumbers?M(this.vwr.getScreenHeight()/2):0;this.showNumbers&&this.vwr.gdata.setFontBold("Monospaced",24);for(var h=!this.imesh.hasGridPoints||0>this.imesh.firstRealVertex?0:this.imesh.firstRealVertex;h<this.vertexCount;h+=b)if(!(null!=
this.vertexValues&&Float.isNaN(this.vertexValues[h])||this.frontOnly&&!this.isVisibleNormix(this.normixes[h])||null!=this.imesh.jvxlData.thisSet&&!this.imesh.jvxlData.thisSet.get(this.mesh.vertexSets[h])||!this.mesh.isColorSolid&&null!=this.mesh.vcs&&!this.setColix(this.mesh.vcs[h])||this.haveBsDisplay&&!this.mesh.bsDisplay.get(h)||a&&!this.bsPolygons.get(h))){this.hasColorRange=!0;if(this.showNumbers&&10<this.screens[h].z&&150>Math.abs(this.screens[h].x-e)&&150>Math.abs(this.screens[h].y-g)){var j=
h+(this.mesh.isColorSolid?"":" "+this.mesh.vvs[h]);this.g3d.setC(4);this.g3d.drawStringNoSlab(j,null,this.screens[h].x,this.screens[h].y,this.screens[h].z-30,0)}this.volumeRender?(c=x(this.vwr.tm.scaleToScreen(this.screens[h].z,d)),1>c&&(c=1),this.g3d.volumeRender4(c,this.screens[h].x,this.screens[h].y,this.screens[h].z)):this.g3d.fillSphereI(c,this.screens[h])}if(3==b){this.g3d.setC(this.isTranslucent?JU.C.getColixTranslucent3(12,!0,0.5):12);for(h=1;h<this.vertexCount;h+=3)this.g3d.fillCylinder(3,
M(c/4),this.screens[h],this.screens[h+1]);this.g3d.setC(this.isTranslucent?JU.C.getColixTranslucent3(21,!0,0.5):21);for(h=1;h<this.vertexCount;h+=3)this.g3d.fillSphereI(c,this.screens[h]);this.g3d.setC(this.isTranslucent?JU.C.getColixTranslucent3(7,!0,0.5):7);for(h=2;h<this.vertexCount;h+=3)this.g3d.fillSphereI(c,this.screens[h])}}catch(m){}this.volumeRender&&this.g3d.volumeRender(!1)});m(d,"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 g=this.isGhostPass&&!this.isBicolorMap||null==e||this.mesh.isColorSolid,h=this.isGhostPass&&!this.isBicolorMap||null==
e||!a&&0!=this.mesh.meshColix,j=this.colix;null!=this.imesh.jvxlData.jvxlPlane&&(!g&&!a&&this.mesh.fillTriangles)&&(g=!0,j=4);var m=g&&null!=this.mesh.pcs;m&&(!a&&this.mesh.fillTriangles)&&(m=!1);var k=this.imesh.jvxlData.contourColixes;this.hasColorRange=!g&&!this.isBicolorMap;for(var r=this.getDiameter(),n=this.mesh.hasTranslucentVertices,p=this.mesh.pc;0<=--p;){var s=d[p];if(!(null==s||this.selectedPolyOnly&&!this.bsPolygons.get(p))){var w=s[0],x=s[1],z=s[2];if(!(null!=this.imesh.jvxlData.thisSet&&
null!=this.mesh.vertexSets&&!this.imesh.jvxlData.thisSet.get(this.mesh.vertexSets[w]))&&(!this.haveBsDisplay||this.mesh.bsDisplay.get(w)&&this.mesh.bsDisplay.get(x)&&this.mesh.bsDisplay.get(z))){var B=this.normixes[w],C=this.normixes[x],L=this.normixes[z],M=this.frontOnly||this.isShell?this.checkFront(B,C,L):7;if(!(a&&0==M)){var I,P,K;if(g){if(m&&p<this.mesh.pcs.length){I=this.mesh.pcs[p];if(0==I)continue;j=I}b&&(j=Math.round(10*Math.random())+5);I=P=K=j}else{I=e[w];P=e[x];K=e[z];if(n){var O=(this.g3d.setC(I)?
1:0)+(this.g3d.setC(P)?2:0);if(0==O||3!=O&&!this.g3d.setC(K))continue}if(this.isBicolorMap){if(I!=P||P!=K)continue;this.isGhostPass&&(I=P=K=JU.C.copyColixTranslucency(this.mesh.slabColix,I))}}if(a)c?this.bsPolygonsToExport.set(p):(x==z?(this.setColix(I),w==x?this.g3d.fillSphereI(r,this.screens[w]):this.g3d.fillCylinder(3,r,this.screens[w],this.screens[x])):this.mesh.colorsExplicit?(this.vwr.gdata.setColor(s[4]),I=JU.C.copyColixTranslucency(this.mesh.colix,2047),this.g3d.setC(I),this.g3d.fillTriangle3CN(this.screens[w],
I,B,this.screens[x],I,C,this.screens[z],I,L)):(this.isTranslucentInherit&&null!=e&&(I=JU.C.copyColixTranslucency(this.mesh.slabColix,e[w]),P=JU.C.copyColixTranslucency(this.mesh.slabColix,e[x]),K=JU.C.copyColixTranslucency(this.mesh.slabColix,e[z])),this.g3d.fillTriangle3CN(this.screens[w],I,B,this.screens[x],P,C,this.screens[z],K,L)),this.iShowNormals&&this.renderNormals());else if(M&=s[3],0!=M){b&&(M=7);this.pt1i.setT(this.screens[w]);this.pt2i.setT(this.screens[x]);this.pt3i.setT(this.screens[z]);
this.pt1i.z-=2;this.pt2i.z-=2;this.pt3i.z-=2;if(!h)if(m)this.g3d.setC(this.mesh.fillTriangles?4:k[s[4]%k.length]);else{this.drawTriangle(this.pt1i,I,this.pt2i,P,this.pt3i,K,M,r);continue}this.drawTriangle(this.pt1i,j,this.pt2i,j,this.pt3i,j,M,r)}}}}}c&&this.exportSurface(g?j:0)},"~B,~B,~B");e(d,"getDiameter",function(){var a;0>=this.mesh.diameter?(a=0>this.meshScale?this.meshScale=this.vwr.getInt(553648149):this.meshScale,this.antialias&&(a*=2)):a=M(this.vwr.getScreenDim()/100);1>a&&(a=1);return a});
e(d,"renderNormals",function(){if(this.g3d.setC(JU.C.copyColixTranslucency(this.mesh.colix,8))){this.vwr.gdata.setFontBold("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.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,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);
