X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=creaWT.git;a=blobdiff_plain;f=wt%2Fdata%2FreosurcesXTK%2Fxtk.js;fp=wt%2Fdata%2FreosurcesXTK%2Fxtk.js;h=4bac0330f4298dc7a32de6ee4f5422f7ef7d859d;hp=0000000000000000000000000000000000000000;hb=708bc1229cb98486aa18f03ebfd4fd8f26137843;hpb=1830bf64f6ad13d04f4fd7589317f0515fae837c diff --git a/wt/data/reosurcesXTK/xtk.js b/wt/data/reosurcesXTK/xtk.js new file mode 100644 index 0000000..4bac033 --- /dev/null +++ b/wt/data/reosurcesXTK/xtk.js @@ -0,0 +1,420 @@ +/* + * + * xxxxxxx xxxxxxx + * x:::::x x:::::x + * x:::::x x:::::x + * x:::::xx:::::x + * x::::::::::x + * x::::::::x + * x::::::::x + * x::::::::::x + * x:::::xx:::::x + * x:::::x x:::::x + * x:::::x x:::::x + * THE xxxxxxx xxxxxxx TOOLKIT + * + * http://www.goXTK.com + * + * Copyright (c) 2012 The X Toolkit Developers + * + * The X Toolkit (XTK) is licensed under the MIT License: + * http://www.opensource.org/licenses/mit-license.php + * + * "Free software" is a matter of liberty, not price. + * "Free" as in "free speech", not as in "free beer". + * - Richard M. Stallman + * + * FUELED BY: + * - the wonderful Constructive Solid Geometry library by Evan Wallace (http://madebyevan.com) + * LICENSE: https://raw.github.com/xtk/X/master/lib/csg/LICENSE + * + * - parts of the Google Closure Library (http://code.google.com/closure/library) + * LICENSE: https://raw.github.com/xtk/google-closure-library/master/LICENSE + * + * - zlib.js, the ultimate gzip/zlib javascript implementation (https://github.com/imaya/zlib.js) + * LICENSE: https://raw.github.com/imaya/zlib.js/master/LICENSE + * + * MORE CREDITS: https://raw.github.com/xtk/X/master/LICENSE + * + */ +function m(a){throw a;}var p=void 0,q=!0,t=null,u=!1;function aa(){return function(){}}function ca(a){return function(b){this[a]=b}}function v(a){return function(){return this[a]}}var w,fa=this;function ga(){} +function ha(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; +else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ia(a){return a!==p}function ja(a){return"array"==ha(a)}function ma(a){var b=ha(a);return"array"==b||"object"==b&&"number"==typeof a.length}function na(a){return"string"==typeof a}function x(a){return"number"==typeof a}function oa(a){return"function"==ha(a)}function pa(a){var b=typeof a;return"object"==b&&a!=t||"function"==b}function qa(a){return a[ra]||(a[ra]=++sa)}var ra="closure_uid_"+(1E9*Math.random()>>>0),sa=0; +function ta(a,b,c){return a.call.apply(a.bind,arguments)}function ua(a,b,c){a||m(Error());if(2a&&(a=this.byteLength+a);0>c&&(c=this.byteLength+c);ca&&(a=0);0>c&&(c=0);a>this.byteLength&&(a=this.byteLength);c>this.byteLength&&(c=this.byteLength);for(var e=new ArrayBuffer(c-a),d=new Uint8Array(this),f=new Uint8Array(e),g=a,h=0;g")&&(a=a.replace(Va,">"));-1!=a.indexOf('"')&&(a=a.replace(Wa,"""));return a}var Ta=/&/g,Ua=//g,Wa=/\"/g,Sa=/[&<>\"]/;var Xa,Ya,Za,$a,ab,bb,db;function eb(){return fa.navigator?fa.navigator.userAgent:t}function fb(){return fa.navigator}$a=Za=Ya=Xa=u;var gb;if(gb=eb()){var hb=fb();Xa=0==gb.indexOf("Opera");Ya=!Xa&&-1!=gb.indexOf("MSIE");Za=!Xa&&-1!=gb.indexOf("WebKit");$a=!Xa&&!Za&&"Gecko"==hb.product}var ib=Xa,K=Ya,jb=$a,lb=Za,mb,pb=fb();mb=pb&&pb.platform||"";ab=-1!=mb.indexOf("Mac");bb=-1!=mb.indexOf("Win");db=-1!=mb.indexOf("Linux");var qb=!!fb()&&-1!=(fb().appVersion||"").indexOf("X11"); +function rb(){var a=fa.document;return a?a.documentMode:p}var sb;a:{var wb="",xb;if(ib&&fa.opera)var yb=fa.opera.version,wb="function"==typeof yb?yb():yb;else if(jb?xb=/rv\:([^\);]+)(\)|;)/:K?xb=/MSIE\s+([^\);]+)(\)|;)/:lb&&(xb=/WebKit\/(\S+)/),xb)var zb=xb.exec(eb()),wb=zb?zb[1]:"";if(K){var Ab=rb();if(Ab>parseFloat(wb)){sb=String(Ab);break a}}sb=wb}var Bb={}; +function Cb(a){var b;if(!(b=Bb[a])){b=0;for(var c=String(sb).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),e=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),d=Math.max(c.length,e.length),f=0;0==b&&f(0==n[1].length?0:parseInt(n[1],10))?1:0)||((0==k[2].length)<(0==n[2].length)?-1:(0==k[2].length)>(0==n[2].length)?1:0)||(k[2]n[2]?1:0)}while(0==b)}b=Bb[a]=0<=b}return b}var Db=fa.document,Eb=!Db||!K?p:rb()||("CSS1Compat"==Db.compatMode?parseInt(sb,10):5);var Fb=!K||K&&9<=Eb,Gb=K&&!Cb("9");!lb||Cb("528");jb&&Cb("1.9b")||K&&Cb("8")||ib&&Cb("9.5")||lb&&Cb("528");jb&&!Cb("8")||K&&Cb("9");var Hb=Array.prototype,Ib=Hb.indexOf?function(a,b,c){return Hb.indexOf.call(a,b,c)}:function(a,b,c){c=c==t?0:0>c?Math.max(0,a.length+c):c;if(na(a))return!na(b)||1!=b.length?-1:a.indexOf(b,c);for(;c=arguments.length?Hb.slice.call(a,b):Hb.slice.call(a,b,c)};function Pb(){0!=Qb&&(this.xl=Error().stack,qa(this))}var Qb=0;function Rb(a,b){this.type=a;this.currentTarget=this.target=b}w=Rb.prototype;w.wc=u;w.defaultPrevented=u;w.ye=q;w.stopPropagation=function(){this.wc=q};w.preventDefault=function(){this.defaultPrevented=q;this.ye=u};function Sb(a){Sb[" "](a);return a}Sb[" "]=ga;function Tb(a,b){a&&this.Ca(a,b)}C(Tb,Rb);w=Tb.prototype;w.target=t;w.relatedTarget=t;w.offsetX=0;w.offsetY=0;w.clientX=0;w.clientY=0;w.screenX=0;w.screenY=0;w.button=0;w.keyCode=0;w.charCode=0;w.ctrlKey=u;w.altKey=u;w.shiftKey=u;w.metaKey=u;w.Wj=u;w.sb=t; +w.Ca=function(a,b){var c=this.type=a.type;Rb.call(this,c);this.target=a.target||a.srcElement;this.currentTarget=b;var e=a.relatedTarget;if(e){if(jb){var d;a:{try{Sb(e.nodeName);d=q;break a}catch(f){}d=u}d||(e=t)}}else"mouseover"==c?e=a.fromElement:"mouseout"==c&&(e=a.toElement);this.relatedTarget=e;this.offsetX=lb||a.offsetX!==p?a.offsetX:a.layerX;this.offsetY=lb||a.offsetY!==p?a.offsetY:a.layerY;this.clientX=a.clientX!==p?a.clientX:a.pageX;this.clientY=a.clientY!==p?a.clientY:a.pageY;this.screenX= +a.screenX||0;this.screenY=a.screenY||0;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.Wj=ab?a.metaKey:a.ctrlKey;this.state=a.state;this.sb=a;a.defaultPrevented&&this.preventDefault();delete this.wc};w.stopPropagation=function(){Tb.u.stopPropagation.call(this);this.sb.stopPropagation?this.sb.stopPropagation():this.sb.cancelBubble=q}; +w.preventDefault=function(){Tb.u.preventDefault.call(this);var a=this.sb;if(a.preventDefault)a.preventDefault();else if(a.returnValue=u,Gb)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};w.Gi=v("sb");var Ub={},Vb={},Wb={},Xb={};function L(a,b,c,e,d){if(ja(b)){for(var f=0;fd.keyCode||d.returnValue!=p)return q;a:{var l=u;if(0==d.keyCode)try{d.keyCode=-1;break a}catch(j){l=q}if(l||d.returnValue==p)d.returnValue=q}}l=new Tb;l.Ca(d,this);d=q;try{if(g){for(var k=[],n=l.currentTarget;n;n=n.parentNode)k.push(n);f=e[q];f.Na=f.oa;for(var s=k.length- +1;!l.wc&&0<=s&&f.Na;s--)l.currentTarget=k[s],d&=fc(f,k[s],c,q,l);if(h){f=e[u];f.Na=f.oa;for(s=0;!l.wc&&sj?2:1E-52*this.oa&&Ac(this),q):u};function Ac(a){if(a.oa!=a.S.length){for(var b=0,c=0;ba||360a||360a||360a)&&m(Error("Invalid opacity."));for(var b=this.c,c=b.length,e=0,e=0;eb.ya?-1:1}A("X.object",Y);A("X.object.prototype.modified",Y.prototype.q);A("X.object.prototype.remove",Y.prototype.remove); +A("X.object.prototype.destroy",Y.prototype.Ta);function od(){}function pd(a){for(var b=a.h.count,c=[],e=0,e=0;e");c=c.join("")}var f=a.createElement(c);e&&(na(e)?f.className=e:ja(e)?Ud.apply(t,[f].concat(e)):Na(e,function(a,b){"style"==b?f.style.cssText=a:"class"==b?f.className=a:"for"==b?f.htmlFor=a:b in ce?f.setAttribute(ce[b],a):0==b.lastIndexOf("aria-",0)||0==b.lastIndexOf("data-",0)?f.setAttribute(b,a): +f[b]=a}));if(2=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom}; +w.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};w.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};w.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this}; +w.translate=function(a,b){a instanceof Xd?(this.left+=a.x,this.right+=a.x,this.top+=a.y,this.bottom+=a.y):(this.left+=a,this.right+=a,x(b)&&(this.top+=b,this.bottom+=b));return this};w.scale=function(a,b){var c=x(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};function le(a,b,c,e){this.left=a;this.top=b;this.width=c;this.height=e}w=le.prototype;w.l=function(){return new le(this.left,this.top,this.width,this.height)};w.Tg=function(a){var b=Math.max(this.left,a.left),c=Math.min(this.left+this.width,a.left+a.width);if(b<=c){var e=Math.max(this.top,a.top);a=Math.min(this.top+this.height,a.top+a.height);if(e<=a)return this.left=b,this.top=e,this.width=c-b,this.height=a-e,q}return u}; +w.contains=function(a){return a instanceof le?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height};function me(a,b){var c=b.xa.clientWidth||a.scrollHeight>a.clientHeight||"fixed"==c||"absolute"==c||"relative"==c))return a;return t} +function se(a){for(var b=new ke(0,Infinity,Infinity,0),c=Zd(a),e=c.ka.body,d=c.ka.documentElement,f=!lb&&"CSS1Compat"==c.ka.compatMode?c.ka.documentElement:c.ka.body;a=re(a);)if((!K||0!=a.clientWidth)&&(!lb||0!=a.clientHeight||a!=e)&&a!=e&&a!=d&&"visible"!=oe(a,"overflow")){var g=te(a),h;h=a;if(jb&&!Cb("1.9")){var l=parseFloat(ne(h,"borderLeftWidth"));if(ue(h))var j=h.offsetWidth-h.clientWidth-l-parseFloat(ne(h,"borderRightWidth")),l=l+j;h=new Xd(l,parseFloat(ne(h,"borderTopWidth")))}else h=new Xd(h.clientLeft, +h.clientTop);g.x+=h.x;g.y+=h.y;b.top=Math.max(b.top,g.y);b.right=Math.min(b.right,g.x+a.clientWidth);b.bottom=Math.min(b.bottom,g.y+a.clientHeight);b.left=Math.max(b.left,g.x)}e=f.scrollLeft;f=f.scrollTop;b.left=Math.max(b.left,e);b.top=Math.max(b.top,f);c=(c.ka.parentWindow||c.ka.defaultView||window).document;c="CSS1Compat"==c.compatMode?c.documentElement:c.body;c=new Vd(c.clientWidth,c.clientHeight);b.right=Math.min(b.right,e+c.width);b.bottom=Math.min(b.bottom,f+c.height);return 0<=b.top&&0<=b.left&& +b.bottom>b.top&&b.right>b.left?b:t} +function te(a){var b,c=ae(a),e=oe(a,"position"),d=jb&&c.getBoxObjectFor&&!a.getBoundingClientRect&&"absolute"==e&&(b=c.getBoxObjectFor(a))&&(0>b.screenX||0>b.screenY),f=new Xd(0,0),g=pe(c);if(a==g)return f;if(a.getBoundingClientRect)b=qe(a),a=je(Zd(c)),f.x=b.left+a.x,f.y=b.top+a.y;else if(c.getBoxObjectFor&&!d)b=c.getBoxObjectFor(a),a=c.getBoxObjectFor(g),f.x=b.screenX-a.screenX,f.y=b.screenY-a.screenY;else{b=a;do{f.x+=b.offsetLeft;f.y+=b.offsetTop;b!=a&&(f.x+=b.clientLeft||0,f.y+=b.clientTop||0); +if(lb&&"fixed"==oe(b,"position")){f.x+=c.body.scrollLeft;f.y+=c.body.scrollTop;break}b=b.offsetParent}while(b&&b!=a);if(ib||lb&&"absolute"==e)f.y-=c.body.offsetTop;for(b=a;(b=re(b))&&b!=c.body&&b!=g;)if(f.x-=b.scrollLeft,!ib||"TR"!=b.tagName)f.y-=b.scrollTop}return f} +function ve(a){var b=new Xd;if(1==a.nodeType){if(a.getBoundingClientRect){var c=qe(a);b.x=c.left;b.y=c.top}else{var c=je(Zd(a)),e=te(a);b.x=e.x-c.x;b.y=e.y-c.y}if(jb&&!Cb(12)){var d;K?d="-ms-transform":lb?d="-webkit-transform":ib?d="-o-transform":jb&&(d="-moz-transform");var f;d&&(f=oe(a,d));f||(f=oe(a,"transform"));f?(a=f.match(we),a=!a?new Xd(0,0):new Xd(parseFloat(a[1]),parseFloat(a[2]))):a=new Xd(0,0);b=new Xd(b.x+a.x,b.y+a.y)}}else d=oa(a.Gi),f=a,a.targetTouches?f=a.targetTouches[0]:d&&a.sb.targetTouches&& +(f=a.sb.targetTouches[0]),b.x=f.clientX,b.y=f.clientY;return b}function xe(a,b){"number"==typeof a&&(a=(b?Math.round(a):a)+"px");return a}function ye(a){if("none"!=oe(a,"display"))return ze(a);var b=a.style,c=b.display,e=b.visibility,d=b.position;b.visibility="hidden";b.position="absolute";b.display="inline";a=ze(a);b.display=c;b.position=d;b.visibility=e;return a} +function ze(a){var b=a.offsetWidth,c=a.offsetHeight,e=lb&&!b&&!c;return(!ia(b)||e)&&a.getBoundingClientRect?(a=qe(a),new Vd(a.right-a.left,a.bottom-a.top)):new Vd(b,c)}function Ae(a,b){a.style.display=b?"":"none"}function ue(a){return"rtl"==oe(a,"direction")}function Be(a,b){if(/^\d+px?$/.test(b))return parseInt(b,10);var c=a.style.left,e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=b;var d=a.style.pixelLeft;a.style.left=c;a.runtimeStyle.left=e;return d} +function Ce(a,b){var c=a.currentStyle?a.currentStyle[b]:t;return c?Be(a,c):0}var De={thin:2,medium:4,thick:6};function Ee(a,b){if("none"==(a.currentStyle?a.currentStyle[b+"Style"]:t))return 0;var c=a.currentStyle?a.currentStyle[b+"Width"]:t;return c in De?De[c]:Be(a,c)}var we=/matrix\([0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, ([0-9\.\-]+)p?x?, ([0-9\.\-]+)p?x?\)/;function Fe(a,b){jc.call(this);this.H=a;var c=pa(this.H)&&1==this.H.nodeType?this.H:this.H?this.H.body:t;this.aj=!!c&&ue(c);this.Jl=L(this.H,jb?"DOMMouseScroll":"mousewheel",this,b)}C(Fe,jc); +Fe.prototype.handleEvent=function(a){var b=0,c=0,e=0;a=a.sb;if("mousewheel"==a.type){c=1;if(K||lb&&(bb||Cb("532.0")))c=40;e=Ge(-a.wheelDelta,c);ia(a.wheelDeltaX)?(b=Ge(-a.wheelDeltaX,c),c=Ge(-a.wheelDeltaY,c)):c=e}else e=a.detail,100e&&(e=-3),ia(a.axis)&&a.axis===a.HORIZONTAL_AXIS?b=e:c=e;x(this.Yg)&&(b=Math.min(Math.max(b,-this.Yg),this.Yg));x(this.Zg)&&(c=Math.min(Math.max(c,-this.Zg),this.Zg));this.aj&&(b=-b);b=new He(e,a,b,c);this.dispatchEvent(b)}; +function Ge(a,b){return lb&&(ab||db)&&0!=a%b?a:a/b}function He(a,b,c,e){b&&this.Ca(b,p);this.type="mousewheel";this.detail=a;this.yl=c;this.Xc=e}C(He,Tb);K||lb&&Cb("525");function Ie(a){M.call(this);this.f="interactor";this.Oa=a;this.Se=this.og=this.ng=this.pg=this.mg=this.qg=t;this.Yd=q;this.Xb=this.Qb=this.wb=u;this.ua=[0,0];this.Ne=new D.m(0,0,0);this.gd=new D.m(0,0,0);this.Vg=0;this.xg=this.Wd=t;this.wg=u;this.R={MOUSEWHEEL_ENABLED:q,MOUSECLICKS_ENABLED:q,KEYBOARD_ENABLED:q,HOVERING_ENABLED:q,CONTEXTMENU_ENABLED:u,TOUCH_ENABLED:q,TOUCH_BOUNCING_ENABLED:u}}C(Ie,M);Ie.prototype.__defineGetter__("config",v("R"));Ie.prototype.__defineGetter__("leftButtonDown",v("wb")); +Ie.prototype.__defineGetter__("middleButtonDown",v("Qb"));Ie.prototype.__defineGetter__("rightButtonDown",v("Xb")); +Ie.prototype.Ca=function(){this.R.MOUSEWHEEL_ENABLED?(this.Se=new Fe(this.Oa),this.qg=L(this.Se,"mousewheel",this.Kd.bind(this))):(bc(this.qg),this.Se=t);this.R.MOUSECLICKS_ENABLED?(this.mg=L(this.Oa,"mousedown",this.vj.bind(this)),this.pg=L(this.Oa,"mouseup",this.Aj.bind(this))):(bc(this.mg),bc(this.pg));this.Oa.oncontextmenu=this.R.CONTEXTMENU_ENABLED?t:function(){return u};window.onkeydown=this.R.KEYBOARD_ENABLED?this.ih.bind(this):t;this.R.TOUCH_ENABLED?(this.R.TOUCH_BOUNCING_ENABLED||document.body.addEventListener("touchmove", +function(a){a.preventDefault()},u),this.ci=L(this.Oa,"touchstart",this.Pj.bind(this)),this.bi=L(this.Oa,"touchmove",this.Nj.bind(this)),this.ai=L(this.Oa,"touchend",this.Jj.bind(this))):(bc(this.ci),bc(this.bi),bc(this.ai));bc(this.ng);bc(this.og);this.ng=L(this.Oa,"mousemove",this.xj.bind(this));this.og=L(this.Oa,"mouseout",this.yj.bind(this))}; +Ie.prototype.vj=function(a){0==a.button?this.wb=q:1==a.button?this.Qb=q:2==a.button&&(this.Xb=q);eval("this.onMouseDown("+this.wb+","+this.Qb+","+this.Xb+")");Je(this);a.preventDefault()};Ie.prototype.uj=aa();Ie.prototype.Aj=function(a){0==a.button?this.wb=u:1==a.button?this.Qb=u:2==a.button&&(this.Xb=u);eval("this.onMouseUp("+this.wb+","+this.Qb+","+this.Xb+")");Je(this);a.preventDefault()};Ie.prototype.__defineGetter__("mousePosition",v("ua"));w=Ie.prototype;w.zj=aa(); +w.yj=function(a){this.Yd=u;this.R.KEYBOARD_ENABLED&&(window.onkeydown=t);this.Xb=this.Qb=this.wb=u;Je(this);this.Ne=new D.m(0,0,0);a.preventDefault()};w.wj=aa();w.Pj=function(a){a.preventDefault();a.Ca(a.sb.targetTouches[0],a.currentTarget);eval("this.onTouchStart("+a.clientX+","+a.clientY+")");this.gd=new D.m(a.clientX,a.clientY,0);this.xg=setTimeout(this.Lj.bind(this,a),500)};w.Oj=aa(); +w.Lj=function(a){eval("this.onTouchHover("+a.clientX+","+a.clientY+")");a=new Jd;a.vb=q;a.ib=this instanceof Ke;this.dispatchEvent(a);this.be=q};w.Kj=aa();function Le(a){clearTimeout(a.xg);if(a.be){var b=new Jd;b.vb=u;b.ib=a instanceof Ke;a.dispatchEvent(b)}a.be=u}w.Jj=function(a){a.preventDefault();eval("this.onTouchEnd()");Le(this)};w.Ij=aa(); +w.Nj=function(a){a.preventDefault();this.be||Le(this);this.touchmoveEvent=a=a.sb;eval("this.onTouchMove(this['touchmoveEvent'])");var b=a.targetTouches;if(1==b.length){a=b[0];var c=[a.clientX,a.clientY];a=new D.m(c[0],c[1],0);var b=c[0]>3*this.Oa.clientWidth/4,e=c[0]3*this.Oa.clientHeight/4,c=!b&&!e&&!d&&!c,d=this.gd.wa(a);this.gd=a.l();if(this.be)a=new Hd,5d.x&&(d.x=-1),5d.y&&(d.y=-1),a.ya=d,this.dispatchEvent(a); +else if(this instanceof Me&&(b||e))a=new Kd,a.V=0>d.y,this.dispatchEvent(a);else if(this instanceof Ke||c)d.scale(3),a=new Id,a.ya=d,this.dispatchEvent(a)}else 2==b.length&&(a=b[0],b=b[1],a=[a.clientX,a.clientY],b=[b.clientX,b.clientY],a=new D.m(a[0],a[1],0),b=new D.m(b[0],b[1],0),d=Gc(a,b),b=d-this.Vg,this.Vg=d,this.gd.wa(a),this.gd=a.l(),10=f&&(a.preventDefault(),d?a=new Hd:b?a=new Jd:(a=new Id,this instanceof Me&&(a=new Kd)),a&&(c=new D.m(0,0,0),37==f?(c.x=5,a.V=u,b&&(a.V=q,a.vb=q,a.ib=u)):39==f?(c.x=-5,a.V=q,b&&(a.vb=u,a.ib=u)):38==f?(c.y=5,a.V=q,b&&(a.vb=q,a.ib=q)):40==f&&(c.y=-5,a.V=u,b&&(a.vb= +u,a.ib=q)),a.ya=c,this.dispatchEvent(a)))}};A("X.interactor",Ie);A("X.interactor.prototype.init",Ie.prototype.Ca);A("X.interactor.prototype.onMouseDown",Ie.prototype.uj);A("X.interactor.prototype.onMouseUp",Ie.prototype.zj);A("X.interactor.prototype.onMouseMove",Ie.prototype.wj);A("X.interactor.prototype.onMouseWheel",Ie.prototype.Bj);A("X.interactor.prototype.onKey",Ie.prototype.sj);A("X.interactor.prototype.onTouchStart",Ie.prototype.Oj);A("X.interactor.prototype.onTouchMove",Ie.prototype.Mj); +A("X.interactor.prototype.onTouchEnd",Ie.prototype.Ij);A("X.interactor.prototype.onTouchHover",Ie.prototype.Kj);function Me(a){Ie.call(this,a);this.f="interactor2D"}C(Me,Ie);Me.prototype.Kd=function(a){Me.u.Kd.call(this,a);var b=new Kd;a.Xc==t&&(a.Xc=0);b.V=0>a.Xc;this.dispatchEvent(b)};function Ne(){M.call(this);this.f="parser";this.J=t;this.C=0;this.Zh=0<(new Int8Array((new Int16Array([1])).buffer))[0];this.Mc=q;this.rl=-Infinity;this.ql=Infinity}C(Ne,M);Ne.prototype.parse=function(){m(Error("The function parse() should be overloaded."))};function Oe(a){for(var b=Infinity,c=-Infinity,e=a.length,d=0,d=0;d +g;f--,g++){var h=b[g];b[g]=b[f];b[f]=h}b=a}return 1==c?b[0]:b} +function Qe(a,b){var c=[Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE],e=Qc(0,0,0,1),d=Pc();cd(a,e,d);c[0]=d[0]c[1]?d[0]:c[1];c[2]=d[1]c[3]?d[1]:c[3];c[4]=d[2]c[5]?d[2]:c[5];e=Qc(0,0,b[2]-1,1);cd(a,e,d);c[0]=d[0]c[1]?d[0]:c[1];c[2]=d[1]c[3]?d[1]:c[3];c[4]=d[2]c[5]?d[2]:c[5];e=Qc(0,b[1]- +1,0,1);cd(a,e,d);c[0]=d[0]c[1]?d[0]:c[1];c[2]=d[1]c[3]?d[1]:c[3];c[4]=d[2]c[5]?d[2]:c[5];e=Qc(b[0]-1,0,0,1);cd(a,e,d);c[0]=d[0]c[1]?d[0]:c[1];c[2]=d[1]c[3]?d[1]:c[3];c[4]=d[2]c[5]?d[2]:c[5];e=Qc(b[0]-1,b[1]-1,0,1);cd(a,e,d);c[0]=d[0]c[1]?d[0]:c[1];c[2]=d[1]c[3]?d[1]:c[3];c[4]=d[2]c[5]?d[2]:c[5];e=Qc(b[0]-1,0,b[2]-1,1);cd(a,e,d);c[0]=d[0]c[1]?d[0]:c[1];c[2]=d[1]c[3]?d[1]:c[3];c[4]=d[2]c[5]?d[2]:c[5];e=Qc(0,b[1]-1,b[2]-1,1);cd(a,e,d);c[0]=d[0]c[1]?d[0]:c[1];c[2]=d[1]c[3]?d[1]:c[3];c[4]=d[2]c[5]?d[2]:c[5];e=Qc(b[0]-1,b[1]-1,b[2]-1,1);cd(a,e,d);c[0]=d[0]c[1]?d[0]:c[1];c[2]=d[1]c[3]?d[1]:c[3];c[4]=d[2]c[5]?d[2]:c[5];return c} +function Re(a,b){var c=Sc();if(!(a.length==b.length&&a[0]==b[0]&&a[1]==b[1]&&a[2]==b[2])){var e=Math.acos(a[2]),d=Mc(),f=a[0],g=a[1],h=a[2],l=b[0],j=b[1],k=b[2];d[0]=g*k-h*j;d[1]=h*l-f*k;d[2]=f*j-g*l;Oc(d,d);f=Math.cos(e/2);g=Math.sin(e/2)*d[0];h=Math.sin(e/2)*d[1];e=Math.sin(e/2)*d[2];T(c,0,f*f+g*g-h*h-e*e,2*(g*h-f*e),2*(g*e+f*h),0);T(c,1,2*(g*h+f*e),f*f+h*h-g*g-e*e,2*(h*e-f*g),0);T(c,2,2*(g*e-f*h),2*(h*e+f*g),f*f+e*e-h*h-g*g,0)}e=Rc();ad(c,e);return[c,e]} +function Se(a,b,c,e,d,f,g,h,l){var j=new Te;Oc(c,c);for(var k=[],n=[],s=0;6>s;s++)for(var r=Math.floor(s/2),y=(r+1)%3,z=(r+2)%3,F=(4+2*r)%6,G=0;2>G;G++){var H=(2+G+2*r)%6,B=-(c[r]*(d[s]-a[r])+c[y]*(d[H]-a[y]))/c[z]+a[z];if(B>=d[F]&&B<=d[F+1]||B<=d[F]&&B>=d[F+1]){var E=[];E[r]=d[s];E[y]=d[H];E[z]=B;k.push(E)}else E=[],E[r]=d[s],E[y]=d[H],E[z]=B,n.push(E)}a=Nc(0,0,1);a=Re(c,a);d=a[0];a=a[1];r=[];for(n=0;ns[1]&&(s[1]=r[n][0]),r[n][1]s[3]&&(s[3]=r[n][1]),r[n][2]s[5]&&(s[5]=r[n][2]);n=Qc(s[0]+(s[1]-s[0])/2,s[2]+(s[3]-s[2])/2,s[4]+(s[5]-s[4])/2,0);r=Pc();$c(a,n,r);y=Math.floor(s[0]);z=Math.ceil(s[1]);y==z&&z++;F=z-y;G=Math.floor(s[2]); +H=Math.ceil(s[3]);G==H&&H++;B=H-G;E=b[0];b=b[1];var n=Math.ceil(F/E),I=Math.ceil(B/b),N=new Uint8Array(4*n*I),Q=new gd;Q.Ye=n;Q.Xe=I;var I=Pc(),O=Qc(0,0,s[4],1),S=Rc();$c(g.Qh,a,S);for(var da=H-1E-7,J=z-1E-7,ba=0,la=0,U=0,V=G,V=G;V<=da;V+=b){U++;la=0;O[1]=V;for(n=y;n<=J;n+=E){la++;O[0]=n;cd(S,O,I);var Ga=4*ba,tb=Math.floor(I[2]),ub=Math.floor(I[1]),vb=Math.floor(I[0]);if(0<=vb&&vbh;h++){var l=Math.floor(h/2),j=(l+1)%3,k=(l+2)%3,n=(2+2*l)%6,s=(4+2*l)%6,r=(d[h]-b[l])*(1/c[l]);if(Infinity!=r&&-Infinity!=r){var y=b[j]+c[j]*r,r=b[k]+c[k]*r;y>=d[n]&&y<=d[n+1]&&r>=d[s]&&r<=d[s+1]?(n=[],n[l]=d[h],n[j]=y,n[k]=r,f.push(n)):(n=[],n[l]=d[h],n[j]=y,n[k]=r,g.push(n))}}d=[f,g];b=d[0];e.b[a].k=d;d=Fc(new R(b[0][0],b[0][1],b[0][2]),new R(b[1][0],b[1][1],b[1][2]));e.b[a].nl=d;f=Nc(0,0,1);g=Re(c,f)[0];h=Qc(e.ad[0],e.ad[1],e.ad[2],0); +f=Pc();cd(g,h,f);g=Pc();h=f[2];g[0]=c[0]*h;g[1]=c[1]*h;g[2]=c[2]*h;g[3]=c[3]*h;0.1>Math.abs(f[0])&&(f[0]=0.1);0.1>Math.abs(f[1])&&(f[1]=0.1);f[0]/=e.ae;f[1]/=e.ae;e.b[a].Ga=[Math.abs(f[0]),Math.abs(f[1])];e.b[a].Sc=f[2];e.b[a].B=g;d=Math.floor(Math.abs(d/f[2]));e.ud[a]=d+1;e.b[a].p=d+1;e.b[a].k[0][0][0]>e.b[a].k[0][1][0]?0g[0]&&(d=e.b[a].k[0][0],e.b[a].k[0][0]=e.b[a].k[0][1],e.b[a].k[0][1]= +d):e.b[a].k[0][0][1]>e.b[a].k[0][1][1]?0g[1]&&(d=e.b[a].k[0][0],e.b[a].k[0][0]=e.b[a].k[0][1],e.b[a].k[0][1]=d):e.b[a].k[0][0][2]>e.b[a].k[0][1][2]?0g[2]&&(d=e.b[a].k[0][0],e.b[a].k[0][0]=e.b[a].k[0][1],e.b[a].k[0][1]=d);e.b[a].Ue=-(c[0]*b[0][0]+c[1]*b[0][1]+c[2]*b[0][2])} +function Ve(a,b){var c;c=b.J;for(var e=b.ca,d=b.ia,f=b.ra,g=Array(e[2]),h=Array(e[2]),l=e[1]*e[0],j=0,k=0,n=0,s=0,r=0,s=0;sb;b++){var c=this.c[b],e=0,d=0;0==b?(e=this.Cb,d=this.Hc,this.Hc=this.Cb):1==b?(e=this.Db,d=this.Ic,this.Ic=this.Db):2==b&&(e=this.Eb,d=this.Jc,this.Jc=this.Eb);if(this.c[b].c[parseInt(e,10)]==t){var f=Mc();f[0]=this.b[b].k[0][0][0]+this.b[b].B[0]*parseInt(e,10);f[1]=this.b[b].k[0][0][1]+this.b[b].B[1]* +parseInt(e,10);f[2]=this.b[b].k[0][0][2]+this.b[b].B[2]*parseInt(e,10);if(this.L){var g=Se(f,this.b[b].Ga,this.b[b].i,this.b[b].w,this.ma,this.e.$,this.e,this.e.L,this.e.xa.Ka);this.e.c[b].c[parseInt(e,10)]=g;this.e.c[b].q(q)}f=Se(f,this.b[b].Ga,this.b[b].i,this.b[b].w,this.ma,this.$,this,q,t);this.L&&(f.e=f.G,f.e=this.e.c[b].c[parseInt(e,10)].G);c.c[parseInt(e,10)]=f;this.c[b].q(q)}d=c.c[parseInt(d,10)];this.Ra||(d.visible=u);c=c.c[parseInt(e,10)];c.visible=q;c.za=1;this.Ra&&(c.c[0].O=u,b!=this.X&& +(c.visible=u,c.za=0))}this.Ra&&-1!=this.X&&We(this,this.X)}a&&P.u.q.call(this)};P.prototype.__defineGetter__("dimensions",v("ca"));P.prototype.__defineSetter__("dimensions",ca("ca"));P.prototype.__defineGetter__("spacing",v("qb"));P.prototype.__defineSetter__("spacing",ca("qb"));P.prototype.__defineGetter__("bbox",v("ma"));P.prototype.__defineGetter__("range",v("ud"));P.prototype.__defineGetter__("dimensionsRAS",v("dg"));P.prototype.__defineGetter__("volumeRendering",v("Ra")); +P.prototype.__defineSetter__("volumeRendering",function(a){this.Ra=a;this.q(u)});P.prototype.__defineGetter__("visible",v("O"));P.prototype.__defineSetter__("visible",function(a){if(a)this.O=a,this.q(u);else{for(var b=this.c,c=b.length,e=0,e=0;e=a.length))&&m(Error("Invalid volumeRederingCache."));this.de=a});P.prototype.__defineGetter__("image",v("jb"));P.prototype.__defineGetter__("labelmap",function(){this.e||(this.e=new Xe(this));return this.e});P.prototype.__defineGetter__("indexX",v("Cb"));P.prototype.__defineSetter__("indexX",function(a){x(a)&&(0<=a&&a>8)+c(a&255)+(c((e&65280)>>8)+c(e&255)),2);4294967295==e&&(e=0);b+=e/2;break;default:b+=e/2}return b} +bf.prototype.vc=function(a,b){this.J=a;if("undefined"==typeof b.ta||b.ta==t)b.ta=[];for(var c={pixel_spacing:[0.1,0.1,Infinity],image_orientation_patient:[1,0,0,0,1,0],image_position_patient:[0,0,0],transfer_syntax_uid:"no_transfer_syntax_uid"},e=Z(this,"ushort",this.J.byteLength),d=66,f=t,g=t,h=t,l=t;d> +8,j+=String.fromCharCode(g),j+=String.fromCharCode(h);c.transfer_syntax_uid=j.replace(/\0/g,"");break;default:d=cf(e,d,h,l)}break;case 40:switch(g){case 16:c.rows=e[d];d+=l/2;break;case 17:c.columns=e[d];d+=l/2;break;case 256:c.gf=e[d];d+=l/2;break;case 257:c.bits_stored=e[d];d+=l/2;break;case 2:c.number_of_images=e[d];d+=l/2;break;case 48:j="";for(f=0;f>8,j+=String.fromCharCode(g),j+=String.fromCharCode(h);j=j.split("\\");c.pixel_spacing=[parseFloat(j[0]),parseFloat(j[1]), +Infinity];break;default:d=cf(e,d,h,l)}break;case 32:switch(g){case 14:c.series_instance_uid="";for(f=0;f>8,c.series_instance_uid+=String.fromCharCode(g),c.series_instance_uid+=String.fromCharCode(h);break;case 19:j="";for(f=0;f>8,j+=String.fromCharCode(g),j+=String.fromCharCode(h);c.instance_number=parseInt(j,10);break;case 50:j="";for(f=0;f>8,j+=String.fromCharCode(g),j+=String.fromCharCode(h); +j=j.split("\\");c.image_position_patient=[parseFloat(j[0]),parseFloat(j[1]),parseFloat(j[2])];break;case 55:j="";for(f=0;f>8,j+=String.fromCharCode(g),j+=String.fromCharCode(h);j=j.split("\\");c.image_orientation_patient=[parseFloat(j[0]),parseFloat(j[1]),parseFloat(j[2]),parseFloat(j[3]),parseFloat(j[4]),parseFloat(j[5])];break;default:d=cf(e,d,h,l)}break;case 65534:switch(g){default:l=0,d+=l/2}break;case 8:switch(g){case 24:c.sop_instance_uid="";for(f=0;f>8,c.sop_instance_uid+=String.fromCharCode(g),c.sop_instance_uid+=String.fromCharCode(h);break;default:d=cf(e,d,h,l)}break;case 16:switch(g){case 8720:for(f=0;f=k);n++){var s=parseInt(j[n],10),r=c.get(s);e.add(r[0],r[1],r[2]);var y=s,z=r;"LINES"==this.Pa?(y=parseInt(j[n+1],10),z=c.get(y),e.add(z[0],z[1],z[2])):"TRIANGLE_STRIPS"==this.Pa&&(0==n||n==k-1)&&e.add(r[0],r[1],r[2]);sc&&10!=g);Z(this,"uchar");d=Z(this,"uint");c=Z(this,"uint");var h=Z(this,"float",3*d);g=Z(this,"uint",3*c);var l=new Uint32Array(d),j=new Float32Array(9*c);b.h=e=new W(9*c);b.n=d=new W(9*c);var k;for(k=0;k>>8^d[(b^a[c])&255];for(f=e>>3;f--;c+=8)b=b>>>8^d[(b^a[c])&255],b=b>>>8^d[(b^a[c+1])&255],b=b>>>8^d[(b^a[c+2])&255],b=b>>>8^d[(b^a[c+3])&255],b=b>>>8^d[(b^a[c+4])&255],b=b>>>8^d[(b^a[c+5])&255],b=b>>>8^d[(b^a[c+6])&255],b=b>>>8^d[(b^a[c+7])&255];return(b^4294967295)>>>0}}; +gf.Mh=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101, +3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271, +366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376, +3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954, +1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836, +1088359270,936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function hf(a){var b=a.length,c=0,e=Number.POSITIVE_INFINITY,d,f,g,h,l,j,k,n,s;for(n=0;nc&&(c=a[n]),a[n]>=1;for(s=j;s>>=1;switch(a){case 0:var a=this.input,b=this.M,c=this.Ua,e=this.la,d=p,f=p,g=p,h=c.length,d=p;this.rb=this.Bd=0;d=a[b++];d===p&&m(Error("invalid uncompressed block header: LEN (first byte)"));f=d;d=a[b++];d===p&&m(Error("invalid uncompressed block header: LEN (second byte)"));f|=d<<8;d=a[b++];d===p&&m(Error("invalid uncompressed block header: NLEN (first byte)"));g=d;d=a[b++];d===p&&m(Error("invalid uncompressed block header: NLEN (second byte)"));g|= +d<<8;f===~g&&m(Error("invalid uncompressed block header: length verify"));b+f>a.length&&m(Error("input buffer is broken"));switch(this.kf){case lf:for(;e+f>c.length;)d=h-e,f-=d,c.set(a.subarray(b,b+d),e),e+=d,b+=d,this.la=e,c=this.tc(),e=this.la;break;case kf:for(;e+f>c.length;)c=this.tc({Jg:2});break;default:m(Error("invalid inflate mode"))}c.set(a.subarray(b,b+f),e);e+=f;this.M=b+=f;this.la=e;this.Ua=c;break;case 1:this.rf(nf,of);break;case 2:pf(this);break;default:m(Error("unknown BTYPE: "+a))}}return this.Dg()}; +var qf=new Uint16Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rf=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258]),sf=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0]),tf=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577]),uf=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),vf=new Uint8Array(288), +wf,xf;wf=0;for(xf=vf.length;wf=wf?8:255>=wf?9:279>=wf?7:8;var nf=hf(vf),yf=new Uint8Array(30),zf,Af;zf=0;for(Af=yf.length;zf>>b;a.rb=e-b;a.M=f;return g} +function Bf(a,b){for(var c=a.Bd,e=a.rb,d=a.input,f=a.M,g=b[0],h=b[1],l;e>>16;a.Bd=c>>g;a.rb=e-g;a.M=f;return d&65535} +function pf(a){function b(a,b,c){var d,e,f;for(f=0;ff)e>=d&&(this.la=e,c=this.tc(),e=this.la),c[e++]=f;else{f-=257;h=rf[f];0=d&&(this.la=e,c=this.tc(),e=this.la);for(;h--;)c[e]=c[e++-g]}for(;8<=this.rb;)this.rb-=8,this.M--;this.la=e}; +w.ri=function(a,b){var c=this.Ua,e=this.la;this.Gg=a;for(var d=c.length,f,g,h;256!==(f=Bf(this,a));)if(256>f)e>=d&&(c=this.tc(),d=c.length),c[e++]=f;else{f-=257;h=rf[f];0d&&(c=this.tc(),d=c.length);for(;h--;)c[e]=c[e++-g]}for(;8<=this.rb;)this.rb-=8,this.M--;this.la=e}; +w.tc=function(){var a=new Uint8Array(this.la-32768),b=this.la-32768,c=this.Ua;a.set(c.subarray(32768,a.length));this.hf.push(a);this.Vf+=a.length;c.set(c.subarray(b,b+32768));this.la=32768;return c};w.xi=function(a){var b=this.input.length/this.M+1|0,c=this.input,e=this.Ua;a&&("number"===typeof a.Jg&&(b=a.Jg),"number"===typeof a.fi&&(b+=a.fi));2>b?(a=(c.length-this.M)/this.Gg[2],a=258*(a/2)|0,a=aCf;++Cf)for(var Df=Cf,Ef=7,Df=Df>>>1;Df;Df>>>=1)--Ef;var Ff=[],Gf;for(Gf=0;288>Gf;Gf++)switch(q){case 143>=Gf:Ff.push([Gf+48,8]);break;case 255>=Gf:Ff.push([Gf-144+400,9]);break;case 279>=Gf:Ff.push([Gf-256+0,7]);break;case 287>=Gf:Ff.push([Gf-280+192,8]);break;default:m("invalid literal: "+Gf)} +function Hf(){var a=If;switch(q){case 3===a:return[257,a-3,0];case 4===a:return[258,a-4,0];case 5===a:return[259,a-5,0];case 6===a:return[260,a-6,0];case 7===a:return[261,a-7,0];case 8===a:return[262,a-8,0];case 9===a:return[263,a-9,0];case 10===a:return[264,a-10,0];case 12>=a:return[265,a-11,1];case 14>=a:return[266,a-13,1];case 16>=a:return[267,a-15,1];case 18>=a:return[268,a-17,1];case 22>=a:return[269,a-19,2];case 26>=a:return[270,a-23,2];case 30>=a:return[271,a-27,2];case 34>=a:return[272,a- +31,2];case 42>=a:return[273,a-35,3];case 50>=a:return[274,a-43,3];case 58>=a:return[275,a-51,3];case 66>=a:return[276,a-59,3];case 82>=a:return[277,a-67,4];case 98>=a:return[278,a-83,4];case 114>=a:return[279,a-99,4];case 130>=a:return[280,a-115,4];case 162>=a:return[281,a-131,5];case 194>=a:return[282,a-163,5];case 226>=a:return[283,a-195,5];case 257>=a:return[284,a-227,5];case 258===a:return[285,a-258,0];default:m("invalid length: "+a)}}var Jf=[],If,Kf; +for(If=3;258>=If;If++)Kf=Hf(),Jf[If]=Kf[2]<<24|Kf[1]<<16|Kf[0];new Uint32Array(Jf);function Lf(){};function Mf(a){this.input=a;this.M=0;this.member=[]} +Mf.prototype.Yb=function(){for(var a=this.input.length;this.M>>0;gf.lf(d)!==c&&m(Error("invalid CRC-32 checksum: 0x"+gf.lf(d).toString(16)+ +" / 0x"+c.toString(16)));b.Fl=c=(h[e++]|h[e++]<<8|h[e++]<<16|h[e++]<<24)>>>0;(d.length&4294967295)!==c&&m(Error("invalid input size: "+(d.length&4294967295)+" / "+c));this.member.push(b);this.M=e}a=this.member;b=d=e=0;for(h=a.length;bj;++j)l[j]=e.fb[3][j]-(c[j+0]*f[0]*g+c[j+4]*f[1]*h+c[j+8]*f[2]*d);Uc(c,l[0],l[1],l[2],1)}e.eb=c;e.gb=Rc();ad(e.eb,e.gb);g=Qc(0,0,0,1);f=Pc();cd(c,g,f);h=Qc(1,1,1,1);g=Pc();cd(c,h,g);c=Qe(c,b.ca);e.Bc=[g[0]-f[0],g[1]-f[1],g[2]-f[2]];e.zc=[c[1]-c[0]+1,c[3]-c[2]+1,c[5]-c[4]+1];e.Ac=[c[0],c[2],c[4]];b.Gb(e);D.Da(this.f+".parse");b.jb=Ve(this,b);e=new ld;e.D=b;e.v=a;this.dispatchEvent(e)}; +Nf.prototype.vc=function(a){this.J=a;a={version:0,Ph:0,Nh:0,Ei:0,Oh:0,Bf:0,Cf:0,Df:0,nj:0,type:0,vi:0,vh:0,Ck:t,fb:t,Gh:t,data:t,min:Infinity,max:-Infinity};a.version=Z(this,"uint");a.Bf=Z(this,"uint");a.Cf=Z(this,"uint");a.Df=Z(this,"uint");a.nj=Z(this,"uint");a.type=Z(this,"uint");a.vi=Z(this,"uint");a.vh=Z(this,"ushort");if(0d&&m(Error("Could not find scalar for vertex.")),l=g[l],f[h++]=l,f[h++]=l,f[h++]=l;b.F.I= +g;b.F.dd=f;b.F.j=q;D.Da(this.f+".parse");e=new ld;e.D=b;e.v=a;this.dispatchEvent(e)};A("X.parserLBL",Of);A("X.parserLBL.prototype.parse",Of.prototype.parse);function Pf(){Ne.call(this);this.f="parserCRV";this.Mc=u}C(Pf,Ne); +Pf.prototype.parse=function(a,b,c){D.Ja(this.f+".parse");var e=b.Nc;0==e.length&&m(Error("No _pointIndices defined on the X.object."));this.J=c;this.C=3;var d=Z(this,"uint");Z(this,"uint");Z(this,"uint");var f=0,g=0,h=0,l=0,j=0,k=0,n=0,s=0,r=0,y=0,z=0;c=Array(2);var F=Array(2),G=Z(this,"float",d),H;for(H=0;H>>0,c=b;if("string"===typeof c){var c=c.split(""),e,d;e=0;for(d=c.length;e>>0}e=1;d=0;for(var f=c.length,g,h=0;0>>0&&m(Error("invalid adler-32 checksum"))}return b};function Rf(){Ne.call(this);this.f="parserRAW"}C(Rf,Ne); +Rf.prototype.parse=function(a,b,c,e){D.Ja(this.f+".parse");e&&(c=(new Qf(new Uint8Array(c))).Yb(),c=c.buffer);e={};e.data=new Uint8Array(c);var d=Oe(e.data);c=d[0];d=d[1];e.min=b.ra=b.fa=c;e.max=b.ia=b.ea=d;-Infinity==b.U&&(b.U=c);Infinity==b.W&&(b.W=d);d=Sc();e.eb=d;e.gb=Sc();var f=Qc(0,0,0,1);c=Pc();cd(d,f,c);var g=Qc(1,1,1,1),f=Pc();cd(d,g,f);d=Qe(d,b.ca);e.Bc=[f[0]-c[0],f[1]-c[1],f[2]-c[2]];e.zc=[d[1]-d[0]+1,d[3]-d[2]+1,d[5]-d[4]+1];e.Ac=[d[0],d[2],d[4]];b.Gb(e);D.Da(this.f+".parse");b.jb=Ve(this, +b);e=new ld;e.D=b;e.v=a;this.dispatchEvent(e)};A("X.parserRAW",Rf);A("X.parserRAW.prototype.parse",Rf.prototype.parse);function Sf(){Ne.call(this);this.f="parserIMAGE"}C(Sf,Ne);Sf.prototype.parse=function(a,b,c,e){c instanceof ArrayBuffer||m(Error());for(var d=new Uint8Array(c),f=d.length,g=Array(f);f--;)g[f]=String.fromCharCode(d[f]);d=window.btoa(g.join(""));f=new Image;$b(f,"load",this.Uj.bind(this,f,a,b,c,e));f.src="data:image/"+e+";base64,"+d};Sf.prototype.Uj=function(a,b,c){b.jb=a;b.Wb=t;a=new ld;a.D=c;a.v=b;this.dispatchEvent(a)};A("X.parserIMAGE",Sf);A("X.parserIMAGE.prototype.parse",Sf.prototype.parse);function Tf(){Ne.call(this);this.f="parserLUT"}C(Tf,Ne); +Tf.prototype.parse=function(a,b,c){D.Ja(this.f+".parse");this.J=c;c=Z(this,"uchar",c.byteLength);var e=c.length,d=0,f;for(f=0;fa.qc-(a.he-a.qc)?(a.min=a.ff,a.max=a.qc+(a.qc-a.ff)): +(a.min=a.qc-(a.he-a.qc),a.max=a.he);return a};A("X.parserMRC",Uf);A("X.parserMRC.prototype.parse",Uf.prototype.parse);function Vf(){Ne.call(this);this.f="parserNRRD"}C(Vf,Ne); +Vf.prototype.parse=function(a,b,c){D.Ja(this.f+".parse");this.J=c;c=Z(this,"uchar",c.byteLength);var e=c.length,d=t,f=0,g;for(g=1;g=k;k++)e.push(!isNaN(this.Tf[k])?this.ha[k].scale(this.Tf[k]):p)}f=c.subarray(f);if("gzip"==this.encoding||"gz"==this.encoding)f=(new Mf(new Uint8Array(f))).Yb();f=f.buffer;c={data:t,min:Infinity,max:-Infinity};c.data=new this.Mb(f);k=Oe(c.data);f=c.min=k[0];k=c.max=k[1];b.ra=b.fa=f;b.ia=b.ea=k;b.ca=[this.Rf[0],this.Rf[1],this.Rf[2]];e=(new R(this.ha[0][0],this.ha[0][1], +this.ha[0][2])).Ib();d=(new R(this.ha[1][0],this.ha[1][1],this.ha[1][2])).Ib();g=(new R(this.ha[2][0],this.ha[2][1],this.ha[2][2])).Ib();b.qb=[e,d,g];-Infinity==b.U&&(b.U=f);Infinity==b.W&&(b.W=k);e=k=1;"left-posterior-superior"==this.zh&&(e=k=-1);f=Sc();"false"==b.reslicing||b.reslicing==u?(T(f,0,k,0,0,0),T(f,1,0,e,0,0),T(f,2,0,0,1,0)):(T(f,0,k*this.ha[0][0],k*this.ha[1][0],k*this.ha[2][0],k*this.Sf[0]),T(f,1,e*this.ha[0][1],e*this.ha[1][1],e*this.ha[2][1],e*this.Sf[1]),T(f,2,1*this.ha[0][2],1*this.ha[1][2], +1*this.ha[2][2],1*this.Sf[2]));T(f,3,0,0,0,1);c.eb=f;c.gb=Rc();ad(c.eb,c.gb);e=Qc(0,0,0,1);k=Pc();cd(f,e,k);d=Qc(1,1,1,1);e=Pc();cd(f,d,e);f=Qe(f,b.ca);c.Bc=[e[0]-k[0],e[1]-k[1],e[2]-k[2]];c.zc=[f[1]-f[0]+1,f[3]-f[2]+1,f[5]-f[4]+1];c.Ac=[f[0],f[2],f[4]];b.Gb(c);D.Da(this.f+".parse");b.jb=Ve(this,b);c=new ld;c.D=b;c.v=a;this.dispatchEvent(c)}; +Vf.prototype.Ai={type:function(a){switch(a){case "uchar":case "unsigned char":case "uint8":case "uint8_t":this.Mb=Uint8Array;break;case "signed char":case "int8":case "int8_t":this.Mb=Int8Array;break;case "short":case "short int":case "signed short":case "signed short int":case "int16":case "int16_t":this.Mb=Int16Array;break;case "ushort":case "unsigned short":case "unsigned short int":case "uint16":case "uint16_t":this.Mb=Uint16Array;break;case "int":case "signed int":case "int32":case "int32_t":this.Mb= +Int32Array;break;case "uint":case "unsigned int":case "uint32":case "uint32_t":this.Mb=Uint32Array;break;case "float":this.Mb=Float32Array;break;case "double":this.Mb=Float64Array;break;default:m(Error("Unsupported NRRD data type: "+a))}return this.type=a},endian:function(a){return this.Al=a},encoding:function(a){return this.encoding=a},dimension:function(a){return this.Zb=parseInt(a,10)},sizes:function(a){var b,c,e,d;e=a.split(/\s+/);d=[];b=0;for(c=e.length;bc.sa[0]&&(h=-h);T(d,0,f,0,0,0);T(d,1,0,g,0,0);T(d,2,0,0,h,0)}else if(0l?(l=1/Math.sqrt(j*j+k*k+n*n),j*=l,k*=l,n*=l,l=0):l=Math.sqrt(l);0c.sa[0]&&(h=-h);T(d,0,(l*l+j*j-k*k-n*n)*f,2*(j*k-l*n)*g,2*(j*n+l*k)*h,s);T(d,1,2*(j*k+l*n)*f,(l*l+k*k-j*j-n*n)*g,2*(k*n-l*j)*h,r);T(d,2,2*(j*n-l*k)*f,2*(k*n+l*j)*g,(l*l+n*n-k*k-j*j)*h,y)}else 0z)z=I;if(!F||SG)G=da;if(!e||Jd)d=ba;n.push(N);s.push(Q)}g=(y+z)/2;h=(F+G)/2;G=(e+d)/2;F=new Float32Array(f);b.h=e=new W(f);b.n=d=new W(f);b.pa=f=new W(f);for(j=y=0;jj;j++)if(0!=c[j]){l=q;break}l==u&&(c[0]=c[5]=c[10]=c[15]=1);D.Da(this.f+".parse");D.g.Wf(c,b.ja.Q); +c=new ld;c.D=b;c.v=a;this.dispatchEvent(c)};A("X.parserTRK",Zf);A("X.parserTRK.prototype.parse",Zf.prototype.parse);function $f(){Ne.call(this);this.f="parserOBJ"}C($f,Ne); +$f.prototype.parse=function(a,b,c){D.Ja(this.f+".parse");this.J=c;c=c.byteLength;var e=Z(this,"uchar",c),d=[];b.h=new W(c);b.n=new W(c);var f=b.h,g=b.n,h=0,l;for(l=0;la.Xc;b.ib=q;this.dispatchEvent(b)};function lg(a){M.call(this);this.f="array";this.I=[];this.cg=a}C(lg,M);function mg(a,b,c){for(var e=0;4>e;e++)if(a[e+0]!==b[e+c])return u;return q}lg.prototype.add=function(a){this.I.push(a);return q};lg.prototype.remove=function(a){a=this.I.indexOf(a);-1e)){e=b+Math.floor(e/2);ng(a,b,e);for(ng(a,e,c);bf.cg(f.I[g+1],d);){var l=f,j=g+1,k=l.I[g];l.I[g]=l.I[j];l.I[j]=k;++g}f.I[g]=d}}}lg.prototype.sort=function(){ng(this,0,this.I.length)};function og(a,b){eg.call(this,a,b);this.f="camera2D"}C(og,eg);og.prototype.rotate=function(a){a=og.u.rotate.call(this,a);var b=new Gd;0a.x&&b.df++;0a.y&&b.Re--;this.dispatchEvent(b)};og.prototype.$f=function(a){var b=20;a!=t&&!a&&(b=0.02);this.o[14]+=b};og.prototype.ag=function(a){var b=20;a!=t&&!a&&(b=0.02);this.o[14]-=b}; +og.prototype.Lf=function(a){ja(a)&&2==a.length?a=new D.m(a[0],a[1],0):a instanceof D.m||m(Error("Invalid distance vector for pan operation."));this.o[12]-=a.x/this.o[14];this.o[13]+=a.y/this.o[14]};function pg(a,b){eg.call(this,a,b);this.f="camera3D";this.eg=45;this.We=D.g.zf(D.g.Ed(),this.eg,a/b,1,1E4)}C(pg,eg);pg.prototype.rotate=function(a){a=pg.u.rotate.call(this,a);var b=-a.x/5*Math.PI/180;a=-a.y/5*Math.PI/180;var c=new D.m(this.o[1],this.o[5],this.o[9]),e=new D.m(this.o[0],this.o[4],this.o[8]);c.normalize();e.normalize();D.g.rotate(this.o,b,c.x,c.y,c.d);D.g.rotate(this.o,a,e.x,e.y,e.d)};pg.prototype.ue=function(a,b){var c=pg.u.ue.call(this,a,b);D.g.Xg(c,a,b,this.V);return c}; +function qg(a,b,c,e){var d=new Float32Array(4),f=new Float32Array(4),g=new Float32Array(16),h=new Float32Array(16);new Float32Array(16);D.g.multiply(a.We,a.o,h);D.g.Y(h,g);d[0]=b;d[1]=c;d[2]=2*e-1;d[3]=1;D.g.ah(g,d,f);f[3]=1/f[3];f[0]*=f[3];f[1]*=f[3];f[2]*=f[3];return f}A("X.camera3D",pg);function rg(a){Pb.call(this);this.Hb=a;this.S=[]}C(rg,Pb);var sg=[];function tg(a,b,c,e,d){ja(c)||(sg[0]=c,c=sg);for(var f=0;fthis.Af?this.Af-this.Hg:asb&&L(this.t(),"resize",this.Ge,u,this);this.Ge();var a=this.t();a.setAttribute("role","progressbar");a.setAttribute("aria-live","polite")};w.le=function(){zg.u.le.call(this);K&&7>sb&&ac(this.t(),"resize",this.Ge,u,this)};w.qe=function(){return this.Md.qe()};w.Od=function(a){this.Md.Od(a);this.t()&&Cg(this)};function Cg(a){var b=a.qe();a.t().setAttribute("aria-valuenow",b)}w.pe=function(){return this.Md.pe()};w.oe=function(){return this.Md.oe()};w.mh="horizontal"; +w.Ki=function(){this.Ge();this.dispatchEvent("change")};w.Ge=function(){if(this.Ab){var a=this.pe(),b=this.oe(),a=(this.qe()-a)/(b-a),b=Math.round(100*a);"vertical"==this.mh?K&&7>sb?(this.Ab.style.top=0,this.Ab.style.height="100%",b=this.Ab.offsetHeight,a=Math.round(a*b),this.Ab.style.top=b-a+"px",this.Ab.style.height=a+"px"):(this.Ab.style.top=100-b+"%",this.Ab.style.height=b+"%"):this.Ab.style.width=b+"%"}};function Dg(a,b){a==t&&m(Error("No valid parent element."));b==t&&m(Error("Invalid initial value."));zg.call(this);this.f="progressbar";this.bb=a;this.Ve="";this.Td=this.Fb=t;this.fc=[];var c;c=".progress-bar-horizontal {\n position: relative;\n border: 1px solid #949dad;\n";c+=" background: white;\n";c+=" padding: 1px;\n";c+=" overflow: hidden;\n";c+=" margin: 2px;\n";c+=" width: 100px;\n";c+=" height: 5px;\n";c+="}";var e;e=".progress-bar-thumb {\n position: relative;\n background: #F62217;\n"; +e+=" overflow: hidden;\n";e+=" width: 0%;\n";e+=" height: 100%;\n";e+="}";var d;d=".progress-bar-thumb-done {\n background: #57E964;\n}";this.fc=[c,e,d];this.Od(b);this.vf()}C(Dg,zg); +Dg.prototype.vf=function(){var a=ne(this.bb,"position");if("static"==a||""==a)this.Ve=this.bb.style.position,this.bb.style.position="relative";var a=document.getElementsByTagName("head")[0],b=de("style");b.type="text/css";b.media="screen";var c=document.createTextNode(String(this.fc[0])),e=document.createTextNode(String(this.fc[1])),d=document.createTextNode(String(this.fc[2]));a.appendChild(b);b.appendChild(c);b.appendChild(e);b.appendChild(d);this.Fb=b;this.cc(this.bb);a=this.t();a.style.position= +"absolute";a.style.top=(this.bb.clientHeight-5)/2+"px";a.style.left=(this.bb.clientWidth-100)/2+"px";a.classList.add("xtk-progress-bar")};function Eg(a){var b=a.t().style.top,c=a.t().style.left;fe(a.t());var e=new Dg(a.bb,100),d=e.t();d.style.position="absolute";d.style.top=b;d.style.left=c;d.classList.add("xtk-progress-bar");(d.firstElementChild!=p?d.firstElementChild:ge(d.firstChild)).classList.add("progress-bar-thumb-done");a.Td=e} +Dg.prototype.Fd=function(){this.Fb&&fe(this.Fb);this.t()&&fe(this.t());this.Td&&fe(this.Td.t());this.Td=this.Fb=t;this.Ve&&(this.bb.style.position=this.Ve)};function Fg(a,b,c){oa(a)?c&&(a=va(a,c)):a&&"function"==typeof a.handleEvent?a=va(a.handleEvent,a):m(Error("Invalid listener argument"));return 2147483647..) is required."));var b=a;na(b)&&(b=be(a));pa(b)&&1==b.nodeType||m(Error("Could not find the given container."));this.v=b});w=Gg.prototype;w.Nd=function(){this.N.reset()}; +w.Ca=function(a){var b=de("canvas");this.v.appendChild(b);this.K=this.v.clientWidth;this.A=this.v.clientHeight;b.width=this.K;b.height=this.A;try{var c=b.getContext(a);c||m(Error())}catch(e){var d="Sorry, "+a+' context is not supported on this machine! See http://crash.goXTK.com for requirements..';this.v.innerHTML='

Oooops..

'+d+"

"; +m(Error(d))}this.aa=new ag;L(this.aa,Ad,this.Dj.bind(this));this.na=b;this.a=c;b=new Ke(this.na);"2d"==a&&(b=new Me(this.na));b.Ca();L(b,wd,this.Nd.bind(this));L(b,Bd,this.Jf.bind(this));L(b,vd,this.Kf.bind(this));this.T=b;b=new pg(this.K,this.A);"2d"==a&&(b=new og(this.K,this.A));b.observe(this.T);this.N=b;L(window,"resize",this.ve,u,this)};w.add=function(a){(a instanceof kg||a instanceof ig||a instanceof gg)&&a.q();this.Ha.push(a);this.ub(a)}; +w.remove=function(a){(!this.na||!this.a)&&m(Error("The renderer was not initialized properly."));if(a!=t){dc(a);var b=this.Ha.length,c;for(c=0;c=d.right))f&=-2;if(132==(f&132)&&(h.y=d.bottom))f&=-5;h.xd.right&&f&16)&&(g.width=Math.max(g.width-(h.x+g.width-d.right),0),e|=4);h.x+g.width>d.right&&f&1&&(h.x=Math.max(d.right-g.width, +d.left),e|=1);f&2&&(e|=(h.xd.right?32:0));h.y=d.top&&(h.y+g.height>d.bottom&&f&32)&&(g.height=Math.max(g.height-(h.y+g.height-d.bottom),0),e|=8);h.y+g.height>d.bottom&&f&4&&(h.y=Math.max(d.bottom-g.height,d.top),e|=2);f&8&&(e|=(h.yd.bottom?128:0));h=e}else h=256;if(h&496)return h}f=a;d=jb&&(ab||qb)&&Cb("1.9");f instanceof +Xd?(a=f.x,f=f.y):(a=f,f=p);b.style.left=xe(a,d);b.style.top=xe(f,d);if(!(c==g||(!c||!g?0:c.width==g.width&&c.height==g.height)))a=ie(Zd(ae(b))),K&&(!a||!Cb("8"))?(c=b.style,a?(K?(a=Ce(b,"paddingLeft"),d=Ce(b,"paddingRight"),f=Ce(b,"paddingTop"),e=Ce(b,"paddingBottom"),a=new ke(f,d,e,a)):(a=ne(b,"paddingLeft"),d=ne(b,"paddingRight"),f=ne(b,"paddingTop"),e=ne(b,"paddingBottom"),a=new ke(parseFloat(f),parseFloat(d),parseFloat(e),parseFloat(a))),K?(d=Ee(b,"borderLeft"),f=Ee(b,"borderRight"),e=Ee(b,"borderTop"), +b=Ee(b,"borderBottom"),b=new ke(e,f,b,d)):(d=ne(b,"borderLeftWidth"),f=ne(b,"borderRightWidth"),e=ne(b,"borderTopWidth"),b=ne(b,"borderBottomWidth"),b=new ke(parseFloat(e),parseFloat(f),parseFloat(b),parseFloat(d))),c.pixelWidth=g.width-b.left-a.left-a.right-b.right,c.pixelHeight=g.height-b.top-a.top-a.bottom-b.bottom):(c.pixelWidth=g.width,c.pixelHeight=g.height)):(b=b.style,jb?b.MozBoxSizing="border-box":lb?b.WebkitBoxSizing="border-box":b.boxSizing="border-box",b.width=Math.max(g.width,0)+"px", +b.height=Math.max(g.height,0)+"px");return h};function Jg(){}Jg.prototype.tb=aa();function Kg(a,b){this.of=a instanceof Xd?a:new Xd(a,b)}C(Kg,Jg);Kg.prototype.tb=function(a,b,c,e){Hg(pe(a),0,a,b,this.of,c,t,e)};function Lg(a,b,c){this.element=a;this.Fg=b;this.Tj=c}C(Lg,Jg);Lg.prototype.tb=function(a,b,c){Hg(this.element,this.Fg,a,b,p,c,this.Tj)};function Mg(a,b){jc.call(this);this.Hb=new rg(this);this.Pf(a||t);b&&(this.$c=b)}C(Mg,jc);w=Mg.prototype;w.H=t;w.gi=q;w.zg=t;w.Ma=u;w.ek=u;w.xf=-1;w.Wg=-1;w.Pi=u;w.wi=q;w.$c="toggle_display";w.t=v("H");w.Pf=function(a){this.Ma&&m(Error("Can not change this state of the popup while showing."));this.H=a}; +function Ng(a,b){a.Fe&&a.Fe.stop();a.re&&a.re.stop();if(b){if(!a.Ma&&a.Ef()){a.H||m(Error("Caller must call setElement before trying to show the popup"));a.tb();var c=ae(a.H);a.Pi&&tg(a.Hb,c,"keydown",a.rj,q);if(a.gi)if(tg(a.Hb,c,"mousedown",a.hh,q),K){var e;try{e=c.activeElement}catch(d){}for(;e&&"IFRAME"==e.nodeName;){try{var f=e.contentDocument||e.contentWindow.document}catch(g){break}c=f;e=c.activeElement}tg(a.Hb,c,"mousedown",a.hh,q);tg(a.Hb,c,"deactivate",a.gh)}else tg(a.Hb,c,"blur",a.gh);"toggle_display"== +a.$c?(a.H.style.visibility="visible",Ae(a.H,q)):"move_offscreen"==a.$c&&a.tb();a.Ma=q;a.Fe?($b(a.Fe,"end",a.kh,u,a),a.Fe.play()):a.kh()}}else Og(a)}w.tb=ga;function Og(a,b){if(!a.Ma||!a.dispatchEvent({type:"beforehide",target:b}))return u;a.Hb&&a.Hb.xe();a.Ma=u;a.Wg=xa();a.re?($b(a.re,"end",wa(a.Eg,b),u,a),a.re.play()):a.Eg(b);return q}w.Eg=function(a){"toggle_display"==this.$c?this.ek?Fg(this.Og,0,this):this.Og():"move_offscreen"==this.$c&&(this.H.style.top="-10000px");this.If(a)}; +w.Og=function(){this.H.style.visibility="hidden";Ae(this.H,u)};w.Ef=function(){return this.dispatchEvent("beforeshow")};w.kh=function(){this.xf=xa();this.Wg=-1;this.dispatchEvent("show")};w.If=function(a){this.dispatchEvent({type:"hide",target:a})};w.hh=function(a){a=a.target;!he(this.H,a)&&((!this.zg||he(this.zg,a))&&!(150>xa()-this.xf))&&Og(this,a)};w.rj=function(a){27==a.keyCode&&Og(this,a.target)&&(a.preventDefault(),a.stopPropagation())}; +w.gh=function(a){if(this.wi){var b=ae(this.H);if(K||ib){if(a=b.activeElement,!a||he(this.H,a)||"BODY"==a.tagName)return}else if(a.target!=b)return;150>xa()-this.xf||Og(this)}};function Pg(a,b){this.Xj=4;this.we=b||p;Mg.call(this,a)}C(Pg,Mg);Pg.prototype.tb=function(){if(this.we){var a=!this.Ma&&"move_offscreen"!=this.$c,b=this.t();a&&(b.style.visibility="hidden",Ae(b,q));this.we.tb(b,this.Xj,this.Kl);a&&Ae(b,u)}};function Qg(a){this.ga=new zc;a&&this.ef(a)}function Rg(a){var b=typeof a;return"object"==b&&a||"function"==b?"o"+qa(a):b.substr(0,1)+a}w=Qg.prototype;w.tf=function(){return this.ga.tf()};w.add=function(a){this.ga.set(Rg(a),a)};w.ef=function(a){a=yc(a);for(var b=a.length,c=0;c 0.0) {\n";a+=" if (labelmapColor.a != -255.0) {\n";a+=" if (all(equal(floor(texture2 * vec4(255)), labelmapColor))) {\n";a+=" if (labelmapOpacity < 1.0) {\n";a+=" textureSum = mix(texture2, textureSum, 1.0 - labelmapOpacity);\n";a+=" } else {\n";a+=" textureSum = texture2;\n";a+=" }\n";a+=" }\n";a+=" } else {\n";a+=" if (labelmapOpacity < 1.0) {\n";a+=" textureSum = mix(texture2, textureSum, 1.0 - labelmapOpacity);\n"; +a+=" } else {\n";a+=" textureSum = texture2;\n";a+=" }\n";a+=" }\n";a+=" }\n";a+=" }\n";a+=" if (volumeTexture) {\n";a+=" float _volumeLowerThreshold = (volumeLowerThreshold - volumeScalarMin)/ (volumeScalarMax - volumeScalarMin);\n";a+=" float _volumeUpperThreshold = (volumeUpperThreshold - volumeScalarMin)/ (volumeScalarMax - volumeScalarMin);\n";a+=" if (texture1.r < _volumeLowerThreshold ||\n";a+=" texture1.r > _volumeUpperThreshold ||\n"; +a+=" texture1.a == 0.0 ) {\n";a+=" discard;\n";a+=" };\n";a+=" };\n";a+=" gl_FragColor = textureSum;\n";a+=" gl_FragColor.a = objectOpacity;\n";a+=" } else {\n";a+=" vec3 nNormal = normalize(fTransformedVertexNormal);\n";a+=" if (fVertexNormal == vec3(0.0,0.0,0.0)) {\n";a+=" gl_FragColor = vec4(fragmentColor,1.0);\n";a+=" return;\n";a+=" }\n";a+=" vec3 light = vec3(0.0, 0.0, 1.0);\n";a+=" vec3 lightDirection = vec3(0,0,-10);\n";a+=" lightDirection = normalize(lightDirection);\n"; +a+=" vec3 eyeDirection = normalize(-fVertexPosition.xyz);\n";a+=" vec3 reflectionDirection = reflect(-lightDirection, nNormal);\n";a+=" float specular = pow(max(dot(reflectionDirection, eyeDirection), 0.0), 10.0);\n";a+=" float diffuse = 0.8 * max(dot(nNormal, light), 0.0);\n";a+=" float ambient = 0.3;\n";a+=" gl_FragColor = vec4(fragmentColor * ambient +\n";a+=" fragmentColor * diffuse +\n";a+=" vec3(0.2, 0.2, 0.2) * specular,\n";a+=" objectOpacity);\n"; +a+=" }\n";this.Ud=a+="}\n"}C(eh,M); +var fh={$k:"vertexPosition",Zk:"vertexNormal",Yk:"vertexColor",bl:"vertexTexturePos",al:"vertexScalar"},gh={cl:"view",Hk:"perspective",yk:"center",Gk:"objectTransform",Uk:"useObjectColor",Ek:"objectColor",Wk:"useScalars",Qk:"scalarsReplaceMode",Nk:"scalarsMin",Kk:"scalarsMax",Ok:"scalarsMinColor",Lk:"scalarsMaxColor",Pk:"scalarsMinThreshold",Mk:"scalarsMaxThreshold",Jk:"scalarsInterpolation",Ik:"pointSize",Fk:"objectOpacity",Dk:"normal",Vk:"usePicking",Xk:"useTexture",Tk:"useLabelMapTexture",Bk:"labelmapOpacity", +Ak:"labelmapColor",Rk:"textureSampler",Sk:"textureSampler2",dl:"volumeLowerThreshold",jl:"volumeUpperThreshold",gl:"volumeScalarMin",el:"volumeScalarMax",hl:"volumeScalarMinColor",fl:"volumeScalarMaxColor",ll:"volumeWindowLow",kl:"volumeWindowHigh",il:"volumeTexture"};function hh(){Gg.call(this);this.f="renderer3D";this.md=this.pd=this.ld=this.od=this.kd=this.nd=this.Ze=this.$e=t;this.z=[0,0,0];this.bd=[0,0,0];this.rg=t;this.Je=new zc;this.xd=new zc;this.pc=new zc;this.qd=new zc;this.Ec=new zc;this.Pc=new zc;this.oc=new zc;this.wd=new zc;this.R={PROGRESSBAR_ENABLED:q,PICKING_ENABLED:q,ORDERING_ENABLED:q,STATISTICS_ENABLED:u,INTERMEDIATE_RENDERING:u}}C(hh,Gg);hh.prototype.__defineGetter__("config",v("R"));w=hh.prototype; +w.Zj=function(){this.md=this.pd=this.ld=this.od=this.kd=this.nd=t;this.z=[0,0,0]};w.Jf=function(a){hh.u.Jf.call(this,a);var b=a.fe;a=a.ge;var c=this.Nf(b,a);if(c=this.get(c))if(c=c.Dc){var e=ve(this.v);(new dh(this.v,e.x+b+10,e.y+a+10,this.T)).t().innerHTML=c}}; +w.Ca=function(){hh.u.Ca.call(this,"experimental-webgl");try{if(this.a.viewport(0,0,this.K,this.A),this.a.clearColor(this.bd[0],this.bd[1],this.bd[2],0),this.a.enable(this.a.BLEND),this.a.blendEquation(this.a.FUNC_ADD),this.a.blendFunc(this.a.SRC_ALPHA,this.a.ONE_MINUS_SRC_ALPHA),this.a.enable(this.a.DEPTH_TEST),this.a.depthFunc(this.a.LEQUAL),this.a.clear(this.a.COLOR_BUFFER_BIT|this.a.DEPTH_BUFFER_BIT),this.R.PICKING_ENABLED){var a=this.a.createFramebuffer(),b=this.a.createRenderbuffer(),c=this.a.createTexture(); +this.a.bindTexture(this.a.TEXTURE_2D,c);this.a.texImage2D(this.a.TEXTURE_2D,0,this.a.RGB,this.K,this.A,0,this.a.RGB,this.a.UNSIGNED_BYTE,t);this.a.texParameteri(this.a.TEXTURE_2D,this.a.TEXTURE_WRAP_S,this.a.CLAMP_TO_EDGE);this.a.texParameteri(this.a.TEXTURE_2D,this.a.TEXTURE_WRAP_T,this.a.CLAMP_TO_EDGE);this.a.texParameteri(this.a.TEXTURE_2D,this.a.TEXTURE_MAG_FILTER,this.a.NEAREST);this.a.texParameteri(this.a.TEXTURE_2D,this.a.TEXTURE_MIN_FILTER,this.a.NEAREST);this.a.bindFramebuffer(this.a.FRAMEBUFFER, +a);this.a.bindRenderbuffer(this.a.RENDERBUFFER,b);this.a.renderbufferStorage(this.a.RENDERBUFFER,this.a.DEPTH_COMPONENT16,this.K,this.A);this.a.bindRenderbuffer(this.a.RENDERBUFFER,t);this.a.framebufferTexture2D(this.a.FRAMEBUFFER,this.a.COLOR_ATTACHMENT0,this.a.TEXTURE_2D,c,0);this.a.framebufferRenderbuffer(this.a.FRAMEBUFFER,this.a.DEPTH_ATTACHMENT,this.a.RENDERBUFFER,b);this.a.bindFramebuffer(this.a.FRAMEBUFFER,t);this.rg=a}}catch(e){m(Error("Exception while accessing GL Context!\n"+e))}a=new eh; +(this.na==t||this.a==t||this.N==t)&&m(Error("Renderer was not initialized properly."));(a==t||!(a instanceof eh))&&m(Error("Could not add shaders."));b=Object.keys(gh);Object.keys(fh).every(function(a){a=fh[a];return-1!=this.ce.search(a)||-1!=this.Ud.search(a)}.bind(a))||m(Error("Could not find all attributes in the shader sources."));b.every(function(a){a=gh[a];return-1!=this.ce.search(a)||-1!=this.Ud.search(a)}.bind(a))||m(Error("Could not find all uniforms in the shader sources."));b=this.a.createShader(this.a.FRAGMENT_SHADER); +c=this.a.createShader(this.a.VERTEX_SHADER);this.a.shaderSource(b,a.Ud);this.a.shaderSource(c,a.ce);this.a.compileShader(b);this.a.compileShader(c);this.a.getShaderParameter(b,this.a.COMPILE_STATUS)||m(Error("Fragement Shader compilation failed!\n"+this.a.getShaderInfoLog(b)));this.a.getShaderParameter(c,this.a.COMPILE_STATUS)||m(Error("Vertex Shader compilation failed!\n"+this.a.getShaderInfoLog(c)));var d=this.a.createProgram();this.a.attachShader(d,c);this.a.attachShader(d,b);this.a.linkProgram(d); +this.a.getProgramParameter(d,this.a.LINK_STATUS)||m(Error("Could not create shader program!\n"+this.a.getShaderInfoLog(b)+"\n"+this.a.getShaderInfoLog(c)+"\n"+this.a.getProgramInfoLog(d)));this.a.useProgram(d);this.Ze=d;Object.keys(fh).forEach(function(a){a=fh[a];this.Je.set(a,this.a.getAttribLocation(this.Ze,a));this.a.enableVertexAttribArray(this.Je.get(a))}.bind(this));Object.keys(gh).forEach(function(a){a=gh[a];this.xd.set(a,this.a.getUniformLocation(this.Ze,a))}.bind(this));this.$e=a}; +w.ub=function(a){hh.u.ub.call(this,a);var b=u;if(a!=t){this.get(a.qa)&&(b=q);var c=a.qa,e=a.h,d=a.n,f=a.pa,g=a.G,h=a.r,l=a.ja,j=a.xa,k=a.e,n=a.F;if(k!=t&&k.r!=t&&k.r.j)this.ub(k);else if(k!=t&&k.j&&this.ub(k),j!=t&&j.r!=t&&j.r.j)this.aa.load(j,a);else if(g!=t&&g.r!=t&&g.r.j)this.aa.load(g,a);else{if(h!=t&&ja(h))if(a.yc!=t){if(a.yc.yf!=h.length||!a.j)return}else{b=0;c=h.length;for(b=0;bthis.kd)this.kd=j.x;if(this.od===t||g.ythis.ld)this.ld=j.y;if(this.pd===t||g.dthis.md)this.md=j.d;this.z=[(this.nd+this.kd)/ +2,(this.od+this.ld)/2,(this.pd+this.md)/2];l.j=u}b&&e.j&&(l=this.pc.get(c),l!=t&&this.a.isBuffer(l.P)&&this.a.deleteBuffer(l.P));l=t;!b||e.j?(l=this.a.createBuffer(),e.Jb(),this.a.bindBuffer(this.a.ARRAY_BUFFER,l),this.a.bufferData(this.a.ARRAY_BUFFER,e.da,this.a.STATIC_DRAW),l=new Sd(l,e.count,3),e.j=u):l=this.pc.get(c);bg(this.aa,0.3);b&&d.j&&(g=this.pc.get(c),g!=t&&this.a.isBuffer(g.P)&&this.a.deleteBuffer(g.P));g=t;!b||d.j?(g=this.a.createBuffer(),d.Jb(),this.a.bindBuffer(this.a.ARRAY_BUFFER, +g),this.a.bufferData(this.a.ARRAY_BUFFER,d.da,this.a.STATIC_DRAW),g=new Sd(g,d.count,3),d.j=u):g=this.qd.get(c);bg(this.aa,0.3);b&&(f&&f.j)&&(d=this.Ec.get(c),d!=t&&this.a.isBuffer(d.P)&&this.a.deleteBuffer(d.P));d=t;f&&(!b||f.j?(f.length!=e.length&&m(Error("Mismatch between points and point colors.")),d=this.a.createBuffer(),f.Jb(),this.a.bindBuffer(this.a.ARRAY_BUFFER,d),this.a.bufferData(this.a.ARRAY_BUFFER,f.da,this.a.STATIC_DRAW),d=new Sd(d,f.count,3),f.j=u):d=this.Ec.get(c));bg(this.aa,0.2); +b&&(n&&n.j)&&(f=this.Pc.get(c),f!=t&&this.a.isBuffer(f.P)&&this.a.deleteBuffer(f.P));f=t;n&&(f=n.dd,!b||n.j?(f.length!=e.length&&m(Error("Mismatch between points and scalars.")),e=this.a.createBuffer(),this.a.bindBuffer(this.a.ARRAY_BUFFER,e),this.a.bufferData(this.a.ARRAY_BUFFER,f,this.a.STATIC_DRAW),f=new Sd(e,f.length,3),n.j=u):f=this.Pc.get(c));bg(this.aa,0.1);b||this.ab.add(a);this.pc.set(c,l);this.qd.set(c,g);this.Ec.set(c,d);this.oc.set(c,h);this.Pc.set(c,f);this.Xd=a.j=u}}else a.j=u}}}; +w.Nf=function(a,b){if(this.R.PICKING_ENABLED){this.dc(q,u);var c=new Uint8Array(4);this.a.readPixels(a,this.A-b,1,1,this.a.RGBA,this.a.UNSIGNED_BYTE,c);return c[0]+255*c[1]+65025*c[2]}return-1}; +w.dc=function(a,b){hh.u.dc.call(this,a,b);this.a.viewport(0,0,this.K,this.A);this.a.clear(this.a.COLOR_BUFFER_BIT|this.a.DEPTH_BUFFER_BIT);var c=this.ab.I,e=c.length;if(0!=e){a?this.a.bindFramebuffer(this.a.FRAMEBUFFER,this.rg):this.a.bindFramebuffer(this.a.FRAMEBUFFER,t);var d=this.N.We,f=this.N.o;this.a.uniformMatrix4fv(this.xd.get("perspective"),u,d);this.a.uniformMatrix4fv(this.xd.get("view"),u,f);d=this.z;this.a.uniform3f(this.xd.get("center"),parseFloat(d[0]),parseFloat(d[1]),parseFloat(d[2])); +f=this.Ha.length;for(d=0;dh*(l+n))for(h=h=0;hh;h++){var l=Math.floor(h/2),j=(l+1)%3,k=(l+2)%3,s=(2+2*l)%6,y=(4+2*l)%6,z=(r[h]-f[l])*(1/a[l]);Infinity!=z&&-Infinity!=z&&(n=f[j]+a[j]*z,z=f[k]+a[k]*z,n>=r[s]&&n<=r[s+1]&&z>=r[y]&&z<=r[y+1]?(s=[],s[l]=r[h],s[j]=n,s[k]=z,b.push(s)):(s=[],s[l]=r[h],s[j]=n,s[k]=z,g.push(s)))}a=[b,g];a=a[0];if(0==a.length)return t;g=Array(2);for(r=0;2>r;r++)b=a[r],g[r]=Math.sqrt((b[0]-f[0])*(b[0]-f[0])+(b[1]-f[1])*(b[1]-f[1])+(b[2]-f[2])*(b[2]-f[2]));f=b=r=t;g[0]n&&aj&&b=c.b[0].p?d=c.b[0].p-1:0>d&&(d=0),k=Math.round((c.b[1].i[0]* +g[0]+c.b[1].i[1]*g[1]+c.b[1].i[2]*g[2]+c.b[1].Ue)/c.b[1].Sc),k>=c.b[1].p?k=c.b[1].p-1:0>k&&(k=0),e=Math.round((c.b[2].i[0]*g[0]+c.b[2].i[1]*g[1]+c.b[2].i[2]*g[2]+c.b[2].Ue)/c.b[2].Sc),e>=c.b[2].p?e=c.b[2].p-1:0>e&&(e=0),[[d,k,e],[f[0],f[1],f[2]],[g[0],g[1],g[2]]]):t}; +w.dc=function(a,b){kh.u.dc.call(this,a,b);if(0!=this.ab.I.length){var c=this.Ha[0],e=t,e=0==this.Fa?c.indexX:1==this.Fa?c.indexY:c.indexZ,d=this.cb[parseInt(e,10)].jg,f=this.cb[parseInt(e,10)].ig;this.Uc=this.cb[parseInt(e,10)].Vc;this.Rc=this.cb[parseInt(e,10)].Gc;this.Tc=d;this.Qc=f;var g=this.K,h=this.A,l=this.N.o;this.a.save();this.a.clearRect(-g,-h,2*g,2*h);this.a.restore();this.xb=Math.max(l[14],1E-4);this.a.setTransform(this.xb,0,0,this.xb,0,0);var j=1*l[12],l=-1*l[13],k=t;c.e&&(k=c.e.af); +var n=this.cb[parseInt(e,10)],s=n.G.Wb,n=n.e,r=t;n&&(r=n.Wb);var y=this.Tc,z=this.Qc,F=this.fg,G=this.kg,H=F.getImageData(0,0,y,z),B=G.getImageData(0,0,y,z),E=H.data,I=B.data,N=E.length,Q=c.U,O=c.W,S=c.fa,da=c.ea;if(this.Ke!=e||this.U!=Q||this.W!=O||this.fa!=S||this.ea!=da||k&&!mg(k,this.lg,0)){var J=this.Vd;J.width=d;J.height=f;J=this.fd;J.width=d;J.height=f;d=0;do{var J=[0,0,0,0],f=[0,0,0,0],ba=s[d]/255*(c.ia-c.ra)+c.ra,la=da-S,U=la/2+S,V=0,V=baU+la/2?255:255*(ba-(U-la/2))/la;ba>=Q&& +ba<=O&&(J=new R(c.Rb[0],c.Rb[1],c.Rb[2]),J=(new R(c.Pb[0],c.Pb[1],c.Pb[2])).scale(V).add(J.scale(255-V)),J=[Math.floor(J.x),Math.floor(J.y),Math.floor(J.d),255],n&&(-255==k[3]?f=[r[d],r[d+1],r[d+2],r[d+3]]:mg(k,r,d)&&(f=[r[d],r[d+1],r[d+2],r[d+3]])));"X"==this.Qa?(E[d]=J[0],E[d+1]=J[1],E[d+2]=J[2],E[d+3]=J[3],I[d]=f[0],I[d+1]=f[1],I[d+2]=f[2],I[d+3]=f[3]):"Y"==this.Qa?(V=Math.floor(d/(4*y)),V=4*V*y+(4*(y-1)-(d-4*V*y)),E[V]=J[0],E[V+1]=J[1],E[V+2]=J[2],E[V+3]=J[3],I[V]=f[0],I[V+1]=f[1],I[V+2]=f[2], +I[V+3]=f[3]):(V=N-1-d,E[V-3]=J[0],E[V-2]=J[1],E[V-1]=J[2],E[V]=J[3],I[V-3]=f[0],I[V-2]=f[1],I[V-1]=f[2],I[V]=f[3]);d+=4}while(d