zincjs 1.11.7 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/zinc.js CHANGED
@@ -32,7 +32,7 @@ module.exports = require("url-polyfill");
32
32
  /***/ ((module) => {
33
33
 
34
34
  "use strict";
35
- module.exports = /*#__PURE__*/JSON.parse('{"name":"zincjs","version":"1.11.7","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}');
35
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"zincjs","version":"1.12.0","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}');
36
36
 
37
37
  /***/ }),
38
38
  /* 3 */
@@ -112,7 +112,14 @@ if(oldAttribute.isInterleavedBufferAttribute?attribute=new THREE.BufferAttribute
112
112
  var cons=Uint8Array;newIndices.length>=Math.pow(2,8)&&(cons=Uint16Array),newIndices.length>=Math.pow(2,16)&&(cons=Uint32Array);var newIndexBuffer=new cons(newIndices),newIndices=null;return null===indices?newIndices=new THREE.BufferAttribute(newIndexBuffer,1):(newIndices=geometry.getIndex().clone(),newIndices.setArray(newIndexBuffer)),result.setIndex(newIndices),result};function PhongToToon(materialIn){if(materialIn.isMeshPhongMaterial){var material=new THREE.MeshToonMaterial({color:materialIn.color.clone(),morphTargets:materialIn.morphTargets,morphNormals:materialIn.morphNormals,vertexColors:materialIn.vertexColors,transparent:materialIn.transparent,opacity:materialIn.opacity,side:materialIn.side});return materialIn.map&&(material.map=materialIn.map),material}return materialIn}/**
113
113
  * Create and return a new buffer geometry with the size of length,
114
114
  * and initial coords.
115
- */function createBufferGeometry(length,coords){if(coords&&length>=coords.length){var geometry=new THREE.BufferGeometry,vertices=new Float32Array(3*length),i=0;return coords.forEach(coord=>{vertices[i++]=coord[0],vertices[i++]=coord[1],vertices[i++]=coord[2]}),geometry.setAttribute("position",new THREE.BufferAttribute(vertices,3)),geometry.setDrawRange(0,coords.length),geometry}}function getCircularTexture(){var image=new Image;image.src=__webpack_require__(8);var texture=new THREE.Texture;return texture.image=image,texture.needsUpdate=!0,texture}function createNewSpriteText(text,height,colour,font,pixel,weight){var sprite=new SpriteText(text,height,colour,font,pixel,weight);return sprite.fontFace=font,sprite.fontSize=pixel,sprite.fontWeight=weight,sprite.material.map.generateMipmaps=!1,sprite.material.map.anisotropy=4,sprite.material.sizeAttenuation=!1,sprite.material.alphaTest=.5,sprite.material.transparent=!0,sprite.material.depthWrite=!1,sprite.material.depthTest=!1,sprite.center.set(.5,-1.2),sprite.renderOrder=1e4,sprite}exports.getBoundingBox=getBoundingBox,exports.createNewURL=createNewURL,exports.createBufferGeometry=createBufferGeometry,exports.getCircularTexture=getCircularTexture,exports.resolveURL=resolveURL,exports.loadExternalFile=loadExternalFile,exports.loadExternalFiles=loadExternalFiles,exports.PhongToToon=PhongToToon,exports.createNewSpriteText=createNewSpriteText;
115
+ */function createBufferGeometry(length,coords){if(coords&&length>=coords.length){var geometry=new THREE.BufferGeometry,vertices=new Float32Array(3*length),i=0;return coords.forEach(coord=>{vertices[i++]=coord[0],vertices[i++]=coord[1],vertices[i++]=coord[2]}),geometry.setAttribute("position",new THREE.BufferAttribute(vertices,3)),geometry.setDrawRange(0,coords.length),geometry}}function getCircularTexture(){var image=new Image;image.src=__webpack_require__(8);var texture=new THREE.Texture;return texture.image=image,texture.needsUpdate=!0,texture}function createNewSpriteText(text,height,colour,font,pixel,weight){var sprite=new SpriteText(text,height,colour,font,pixel,weight);return sprite.fontFace=font,sprite.fontSize=pixel,sprite.fontWeight=weight,sprite.material.map.generateMipmaps=!1,sprite.material.map.anisotropy=4,sprite.material.sizeAttenuation=!1,sprite.material.alphaTest=.5,sprite.material.transparent=!0,sprite.material.depthWrite=!1,sprite.material.depthTest=!1,sprite.center.set(.5,-1.2),sprite.renderOrder=1e4,sprite}/*
116
+ * Check if the compare path match with the region or/and group.
117
+ * comparePath should be in the form of regionPath/Group.
118
+ * * can be used as wildcard.
119
+ * comparePath will be used to compare both region and group if it
120
+ * is a single string without /
121
+ */function isRegionGroup(regionPath,groupName,comparePath){if(comparePath){var region=regionPath?regionPath:"",group=groupName?groupName:"",n=comparePath.lastIndexOf("/");if(-1<n){var r=void 0,g=void 0;if(r=comparePath.substring(0,n),g=comparePath.substring(n+1),("*"===r||"**"===r||r.toLowerCase()===region.toLowerCase())&&("*"===g||"**"===g||g.toLowerCase()===group.toLowerCase()))return!0}else//one single value if one of the region / group matches
122
+ if(region.toLowerCase()===comparePath.toLowerCase()||group.toLowerCase()===comparePath.toLowerCase())return!0}return!1}exports.getBoundingBox=getBoundingBox,exports.createNewURL=createNewURL,exports.createBufferGeometry=createBufferGeometry,exports.getCircularTexture=getCircularTexture,exports.resolveURL=resolveURL,exports.loadExternalFile=loadExternalFile,exports.loadExternalFiles=loadExternalFiles,exports.PhongToToon=PhongToToon,exports.createNewSpriteText=createNewSpriteText,exports.isRegionGroup=isRegionGroup;
116
123
 
117
124
  /***/ }),
118
125
  /* 6 */
@@ -400,12 +407,8 @@ this.isZincObject=!0,this.geometry=void 0,this.morph=void 0,this.group=new THREE
400
407
  * Add lod from an url into the lod object.
401
408
  */ /**
402
409
  * Set the objects position.
403
- *
404
- * @return {THREE.Box3}.
405
410
  */ /**
406
411
  * Set the objects scale.
407
- *
408
- * @return {THREE.Box3}.
409
412
  */ZincObject.prototype.setDuration=function(durationIn){this.duration=durationIn,this.clipAction&&this.clipAction.setDuration(this.duration)},ZincObject.prototype.getDuration=function(){return this.duration},ZincObject.prototype.setRegion=function(region){this.region=region},ZincObject.prototype.getRegion=function(){return this.region},ZincObject.prototype.getMorph=function(){var morph=this._lod.getCurrentMorph();return morph?morph:this.morph},ZincObject.prototype.getGroup=function(){return this.group},ZincObject.prototype.setMorph=function(mesh){this.morph=mesh,this.group.add(this.morph);//this is the base level object
410
413
  var distance=this._lod.calculateDistance("far");this._lod.addLevel(mesh,distance),this._lod.setMaterial(mesh.material)},ZincObject.prototype.checkTransparentMesh=function(){},ZincObject.prototype.setMesh=function(mesh,localTimeEnabled,localMorphColour){this.animationGroup=new THREE.AnimationObjectGroup(mesh),this.mixer=new THREE.AnimationMixer(this.animationGroup);var geometry=mesh.geometry;if(this.geometry=mesh.geometry,this.clipAction=void 0,geometry&&geometry.morphAttributes){var morphAttribute=geometry.morphAttributes.position;morphAttribute||(morphAttribute=geometry.morphAttributes.color?geometry.morphAttributes.color:geometry.morphAttributes.normal),morphAttribute&&(this.animationClip=THREE.AnimationClip.CreateClipsFromMorphTargetSequences(morphAttribute,10,!0),this.animationClip&&null!=this.animationClip[0]&&(this.clipAction=this.mixer.clipAction(this.animationClip[0]).setDuration(this.duration),this.clipAction.loop=THREE.loopOnce,this.clipAction.clampWhenFinished=!0,this.clipAction.play()))}this.timeEnabled=localTimeEnabled,this.morphColour=localMorphColour,mesh.userData=this,mesh.matrixAutoUpdate=!1,this.setMorph(mesh),this.checkTransparentMesh(),this.timeEnabled?this.setFrustumCulled(!1):this.morphColour&&(geometry.setAttribute("morphTarget0",geometry.getAttribute("position")),geometry.setAttribute("morphTarget1",geometry.getAttribute("position"))),this.boundingBoxUpdateRequired=!0},ZincObject.prototype.setName=function(groupNameIn){this.groupName=groupNameIn,this._lod.setName(groupNameIn)},ZincObject.prototype.getCurrentTime=function(){if(this.clipAction){var ratio=this.clipAction.time/this.clipAction._clip.duration;return this.duration*ratio}return this.inbuildTime},ZincObject.prototype.setMorphTime=function(time){var timeChanged=!1;if(this.clipAction){var ratio=time/this.duration,actualDuration=this.clipAction._clip.duration,newTime=ratio*actualDuration;newTime!=this.clipAction.time&&(this.clipAction.time=newTime,timeChanged=!0),timeChanged&&this.isTimeVarying()&&this.mixer.update(0)}else{var _newTime=time;_newTime=time>this.duration?this.duration:0>time?0:time,_newTime!=this.inbuildTime&&(this.inbuildTime=_newTime,timeChanged=!0)}timeChanged&&(this.boundingBoxUpdateRequired=!0,this._lod.updateMorphColorAttribute(!0),this.timeEnabled&&(this.markerUpdateRequired=!0))},ZincObject.prototype.isTimeVarying=function(){return!!(this.timeEnabled||this.morphColour)},ZincObject.prototype.getVisibility=function(){return this.visible},ZincObject.prototype.setVisibility=function(visible){visible!==this.visible&&(this.visible=visible,this.group.visible=visible,this.region&&(this.region.pickableUpdateRequired=!0))},ZincObject.prototype.setAlpha=function(alpha){var material=this._lod._material,isTransparent=!1;1>alpha&&(isTransparent=!0),material.opacity=alpha,material.transparent=isTransparent,this.checkTransparentMesh()},ZincObject.prototype.setFrustumCulled=function(flag){//multilayers - set for all layers
411
414
  this._lod.setFrustumCulled(flag)},ZincObject.prototype.setVertexColors=function(vertexColors){//multilayers - set for all
@@ -517,7 +520,7 @@ module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGlu
517
520
  /* 16 */
518
521
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
519
522
 
520
- var THREE=__webpack_require__(4),Glyph=function(geometry,materialIn,idIn,glyphsetIn){(__webpack_require__(10).ZincObject).call(this);var material;materialIn&&(material=materialIn.clone(),material.vertexColors=THREE.FaceColors);this.id=idIn;var label=void 0,labelString=void 0;/**
523
+ var THREE=__webpack_require__(4),Glyph=function(geometry,materialIn,idIn,glyphsetIn){(__webpack_require__(10).ZincObject).call(this);var material;materialIn&&(material=materialIn.clone(),material.vertexColors=THREE.FaceColors);this.id=idIn;var label=void 0,labelString=void 0;this.isGlyph=!0;var _position=[0,0,0];/**
521
524
  * Create a glyph using mesh
522
525
  * @param {THREE.Mesh} meshIn - Mesh to create the glyph from
523
526
  *
@@ -534,6 +537,8 @@ var THREE=__webpack_require__(4),Glyph=function(geometry,materialIn,idIn,glyphse
534
537
  * label.
535
538
  * @param {THREE.Color} colour - Colour for the label.
536
539
  */ /**
540
+ * Hide label with the choosen colour.
541
+ */ /**
537
542
  * Get the label of this glyph
538
543
  * @return {Label}
539
544
  */ /**
@@ -555,7 +560,7 @@ var THREE=__webpack_require__(4),Glyph=function(geometry,materialIn,idIn,glyphse
555
560
  * @param {THREE.Color} color - Colour to be set.
556
561
  */ /**
557
562
  * Clear and free its memory.
558
- */this.isGlyph=!0,this.fromMesh=meshIn=>!!(meshIn&&meshIn.isMesh)&&(this.morph=meshIn.clone(),this.morph.userData=this,this.group.add(this.morph),!0),geometry&&material&&this.fromMesh(new THREE.Mesh(geometry,material)),this.getGlyphset=function(){return glyphsetIn},this.setLabel=text=>{text&&("string"==typeof text||text instanceof String)&&(labelString=text,this.morph&&(this.morph.name=text)),label&&this.showLabel()},this.showLabel=colour=>{if(label&&(position=label.getPosition(),this.group.remove(label.getSprite()),label.dispose(),label=void 0),labelString&&("string"==typeof labelString||labelString instanceof String)){var _position=[0,0,0];label=new((__webpack_require__(17).Label))(labelString,colour),label.setPosition(_position[0],_position[1],_position[2]),this.group.add(label.getSprite())}},this.getLabel=()=>labelString,this.getMesh=()=>this.morph,this.setTransformation=(position,axis1,axis2,axis3)=>{this.morph&&(this.morph.matrix.elements[0]=axis1[0],this.morph.matrix.elements[1]=axis1[1],this.morph.matrix.elements[2]=axis1[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=axis2[0],this.morph.matrix.elements[5]=axis2[1],this.morph.matrix.elements[6]=axis2[2],this.morph.matrix.elements[7]=0,this.morph.matrix.elements[8]=axis3[0],this.morph.matrix.elements[9]=axis3[1],this.morph.matrix.elements[10]=axis3[2],this.morph.matrix.elements[11]=0,this.morph.matrix.elements[12]=position[0],this.morph.matrix.elements[13]=position[1],this.morph.matrix.elements[14]=position[2],this.morph.matrix.elements[15]=1,this.morph.matrixAutoUpdate=!1),label&&label.setPosition(position[0],position[1],position[2])},this.setColour=color=>{label&&label.setColour(color),this.secondaryMesh&&this.secondaryMesh.material&&(this.secondaryMesh.material.color=colour),this.geometry.colorsNeedUpdate=!0},this.dispose=()=>{this.material&&this.material.dispose(),this.morph=void 0}};/**
563
+ */this.fromMesh=meshIn=>!!(meshIn&&meshIn.isMesh)&&(this.morph=meshIn.clone(),this.morph.userData=this,this.group.add(this.morph),!0),geometry&&material&&this.fromMesh(new THREE.Mesh(geometry,material)),this.getGlyphset=function(){return glyphsetIn},this.setLabel=text=>{text&&("string"==typeof text||text instanceof String)&&(labelString=text,this.morph&&(this.morph.name=text))},this.showLabel=colour=>{label&&(_position=label.getPosition(),this.group.remove(label.getSprite()),label.dispose(),label=void 0),labelString&&("string"==typeof labelString||labelString instanceof String)&&(label=new((__webpack_require__(17).Label))(labelString,colour),label.setPosition(_position[0],_position[1],_position[2]),this.group.add(label.getSprite()))},this.hideLabel=()=>{label&&(_position=label.getPosition(),this.group.remove(label.getSprite()),label.dispose(),label=void 0)},this.getLabel=()=>labelString,this.getMesh=()=>this.morph,this.setTransformation=(position,axis1,axis2,axis3)=>{this.morph&&(this.morph.matrix.elements[0]=axis1[0],this.morph.matrix.elements[1]=axis1[1],this.morph.matrix.elements[2]=axis1[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=axis2[0],this.morph.matrix.elements[5]=axis2[1],this.morph.matrix.elements[6]=axis2[2],this.morph.matrix.elements[7]=0,this.morph.matrix.elements[8]=axis3[0],this.morph.matrix.elements[9]=axis3[1],this.morph.matrix.elements[10]=axis3[2],this.morph.matrix.elements[11]=0,this.morph.matrix.elements[12]=position[0],this.morph.matrix.elements[13]=position[1],this.morph.matrix.elements[14]=position[2],this.morph.matrix.elements[15]=1,this.morph.matrixAutoUpdate=!1),_position=[...position],label&&label.setPosition(position[0],position[1],position[2])},this.setColour=color=>{label&&label.setColour(color),this.secondaryMesh&&this.secondaryMesh.material&&(this.secondaryMesh.material.color=colour),this.geometry&&(this.geometry.colorsNeedUpdate=!0)},this.dispose=()=>{this.material&&this.material.dispose(),this.morph=void 0}};/**
559
564
  * Zinc representation of glyph graphic, it contains the colours,
560
565
  * geometry and transformation of the glyph.
561
566
  *
@@ -617,7 +622,7 @@ var SpriteText=(__webpack_require__(7)["default"]);/**
617
622
  /* 18 */
618
623
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
619
624
 
620
- function _readOnlyError(name){throw new TypeError("\""+name+"\" is read-only")}var THREE=__webpack_require__(4),JSONLoader=(__webpack_require__(19).JSONLoader),Glyphset=function(){(__webpack_require__(10).ZincObject).call(this);var glyphList=[],axis1s=void 0,axis2s=void 0,axis3s=void 0,positions=void 0,scales=void 0,colors=void 0,labels=void 0,numberOfTimeSteps=0,numberOfVertices=0,baseSize=[0,0,0],offset=[0,0,0],scaleFactors=[0,0,0],repeat_mode="NONE";this.ready=!1;var morphColours=!1,morphVertices=!1;this.isGlyphset=!0;for(var _transformMatrix=new THREE.Matrix4,_bot_colour=new THREE.Color,_top_colour=new THREE.Color,_boundingBox1=new THREE.Box3,_boundingBox2=new THREE.Box3,_boundingBox3=new THREE.Box3,_points=[],_current_positions=[],_current_axis1s=[],_current_axis2s=[],_current_axis3s=[],_current_scales=[],_current_colors=[],_glyph_axis_array=[],i=0;8>i;i++)_points[i]=new THREE.Vector3;/**
625
+ var THREE=__webpack_require__(4),JSONLoader=(__webpack_require__(19).JSONLoader),Glyphset=function(){(__webpack_require__(10).ZincObject).call(this);var glyphList=[],axis1s=void 0,axis2s=void 0,axis3s=void 0,positions=void 0,scales=void 0,colors=void 0,labels=void 0,numberOfTimeSteps=0,numberOfVertices=0,baseSize=[0,0,0],offset=[0,0,0],scaleFactors=[0,0,0],repeat_mode="NONE";this.ready=!1;var morphColours=!1,morphVertices=!1;this.isGlyphset=!0;var _transformMatrix=new THREE.Matrix4,_bot_colour=new THREE.Color,_top_colour=new THREE.Color,_boundingBox1=new THREE.Box3,_boundingBox2=new THREE.Box3,_boundingBox3=new THREE.Box3,_points=[],_current_positions=[],_current_axis1s=[],_current_axis2s=[],_current_axis3s=[],_current_scales=[],_current_colors=[],_glyph_axis_array=[];this.globalScale=1;for(var i=0;8>i;i++)_points[i]=new THREE.Vector3;/**
621
626
  * Copy glyphset data into this glyphset then load the glyph's geoemtry
622
627
  * with the provided glyphURL. FinishCallback will be called once
623
628
  * glyph is loaded.
@@ -632,11 +637,11 @@ function _readOnlyError(name){throw new TypeError("\""+name+"\" is read-only")}v
632
637
  * to the transformation matrix.
633
638
  *
634
639
  * @returns {Array}
635
- */var resolve_glyph_axes=(point,axis1,axis2,axis3,scale,return_arrays)=>{if("NONE"==repeat_mode||"MIRROR"==repeat_mode){for(var sign,axis_scale=[0,0,0],final_axis1=[0,0,0],final_axis2=[0,0,0],final_axis3=[0,0,0],final_point=[0,0,0],mirrored_axis1=[0,0,0],mirrored_axis2=[0,0,0],mirrored_axis3=[0,0,0],mirrored_point=[0,0,0],j=0;3>j;j++)sign=0>scale[j]?-1:1,axis_scale[j]=sign*baseSize[j]+scale[j]*scaleFactors[j];for(var j=0;3>j;j++)final_axis1[j]=axis1[j]*axis_scale[0],final_axis2[j]=axis2[j]*axis_scale[1],final_axis3[j]=axis3[j]*axis_scale[2],final_point[j]=point[j]+offset[0]*final_axis1[j]+offset[1]*final_axis2[j]+offset[2]*final_axis3[j],"MIRROR"==repeat_mode&&(mirrored_axis1[j]=-final_axis1[j],mirrored_axis2[j]=-final_axis2[j],mirrored_axis3[j]=-final_axis3[j],mirrored_point[j]=final_point[j],0>scale[0]&&(final_point[j]-=final_axis1[j],mirrored_point[j]-=mirrored_axis1[j]));/* if required, reverse axis3 to maintain right-handed coordinate system */0>final_axis3[0]*(final_axis1[1]*final_axis2[2]-final_axis1[2]*final_axis2[1])+final_axis3[1]*(final_axis1[2]*final_axis2[0]-final_axis1[0]*final_axis2[2])+final_axis3[2]*(final_axis1[0]*final_axis2[1]-final_axis1[1]*final_axis2[0])&&(final_axis3[0]=-final_axis3[0],final_axis3[1]=-final_axis3[1],final_axis3[2]=-final_axis3[2]),return_arrays[0]=[final_point,final_axis1,final_axis2,final_axis3],"MIRROR"==repeat_mode&&(0>mirrored_axis3[0]*(mirrored_axis1[1]*mirrored_axis2[2]-mirrored_axis1[2]*mirrored_axis2[1])+mirrored_axis3[1]*(mirrored_axis1[2]*mirrored_axis2[0]-mirrored_axis1[0]*mirrored_axis2[2])+mirrored_axis3[2]*(mirrored_axis1[0]*mirrored_axis2[1]-mirrored_axis1[1]*mirrored_axis2[0])&&(mirrored_axis3[0]=-mirrored_axis3[0],mirrored_axis3[1]=-mirrored_axis3[1],mirrored_axis3[2]=-mirrored_axis3[2]),return_arrays[1]=[mirrored_point,mirrored_axis1,mirrored_axis2,mirrored_axis3])}else if("AXES_2D"==repeat_mode||"AXES_3D"==repeat_mode){for(var sign,_axis_scale=[0,0,0],_final_point=[0,0,0],j=0;3>j;j++)sign=0>scale[j]?-1:1,_axis_scale[j]=sign*baseSize[0]+scale[j]*scaleFactors[0];for(var j=0;3>j;j++)_final_point[j]=point[j]+offset[0]*_axis_scale[0]*axis1[j]+offset[1]*_axis_scale[1]*axis2[j]+offset[2]*_axis_scale[2]*axis3[j];for(var number_of_glyphs="AXES_2D"==glyph_repeat_mode?2:3,k=0;k<number_of_glyphs;k++){var use_axis1=void 0,use_axis2=void 0,use_scale=scale[k],_final_axis=[0,0,0],_final_axis2=[0,0,0],_final_axis3=[0,0,0];0==k?(use_axis1=axis1,use_axis2=axis2):1==k?(use_axis1=axis2,use_axis2="AXES_2D"==glyph_repeat_mode?axis1:axis3):(use_axis1=axis3,use_axis2=axis1);var final_scale1=baseSize[0]+use_scale*scaleFactors[0];_final_axis[0]=use_axis1[0]*final_scale1,_final_axis[1]=use_axis1[1]*final_scale1,_final_axis[2]=use_axis1[2]*final_scale1,_final_axis3[0]=_final_axis[1]*use_axis2[2]-use_axis2[1]*_final_axis[2],_final_axis3[1]=_final_axis[2]*use_axis2[0]-use_axis2[2]*_final_axis[0],_final_axis3[2]=_final_axis[0]*use_axis2[1]-_final_axis[1]*use_axis2[0];var magnitude=Math.sqrt(_final_axis3[0]*_final_axis3[0]+_final_axis3[1]*_final_axis3[1]+_final_axis3[2]*_final_axis3[2]);if(0<magnitude){var _scaling=(baseSize[2]+use_scale*scaleFactors[2])/magnitude;"AXES_2D"==repeat_mode&&0<k&&(_scaling*=-1),_final_axis3[0]*=_scaling,_final_axis3[1]*=_scaling,_final_axis3[2]*=_scaling}if(_final_axis2[0]=_final_axis3[1]*_final_axis[2]-_final_axis[1]*_final_axis3[2],_final_axis2[1]=_final_axis3[2]*_final_axis[0]-_final_axis[2]*_final_axis3[0],_final_axis2[2]=_final_axis3[0]*_final_axis[1]-_final_axis3[1]*_final_axis[0],magnitude=Math.sqrt(_final_axis2[0]*_final_axis2[0]+_final_axis2[1]*_final_axis2[1]+_final_axis2[2]*_final_axis2[2]),0<magnitude){var scaling=(baseSize[1]+use_scale*scaleFactors[1])/magnitude;_final_axis2[0]*=scaling,_final_axis2[1]*=scaling,_final_axis2[2]*=scaling}return_arrays[k]=[_final_point,_final_axis,_final_axis2,_final_axis3]}}return return_arrays},updateGlyphsetTransformation=(current_positions,current_axis1s,current_axis2s,current_axis3s,current_scales)=>{var numberOfGlyphs=1;"AXES_2D"==repeat_mode||"MIRROR"==repeat_mode?numberOfGlyphs=2:"AXES_3D"==repeat_mode&&(numberOfGlyphs=3);var numberOfPositions=current_positions.length/3,current_glyph_index=0;_glyph_axis_array.length=numberOfGlyphs;for(var _i=0;_i<numberOfPositions;_i++){var current_index=3*_i,current_position=[current_positions[current_index],current_positions[current_index+1],current_positions[current_index+2]],current_axis1=[current_axis1s[current_index],current_axis1s[current_index+1],current_axis1s[current_index+2]],current_axis2=[current_axis2s[current_index],current_axis2s[current_index+1],current_axis2s[current_index+2]],current_axis3=[current_axis3s[current_index],current_axis3s[current_index+1],current_axis3s[current_index+2]],current_scale=[current_scales[current_index],current_scales[current_index+1],current_scales[current_index+2]],arrays=resolve_glyph_axes(current_position,current_axis1,current_axis2,current_axis3,current_scale,_glyph_axis_array);if(arrays.length==numberOfGlyphs)for(var j=0;j<numberOfGlyphs;j++){_transformMatrix.elements[0]=arrays[j][1][0],_transformMatrix.elements[1]=arrays[j][1][1],_transformMatrix.elements[2]=arrays[j][1][2],_transformMatrix.elements[3]=0,_transformMatrix.elements[4]=arrays[j][2][0],_transformMatrix.elements[5]=arrays[j][2][1],_transformMatrix.elements[6]=arrays[j][2][2],_transformMatrix.elements[7]=0,_transformMatrix.elements[8]=arrays[j][3][0],_transformMatrix.elements[9]=arrays[j][3][1],_transformMatrix.elements[10]=arrays[j][3][2],_transformMatrix.elements[11]=0,_transformMatrix.elements[12]=arrays[j][0][0],_transformMatrix.elements[13]=arrays[j][0][1],_transformMatrix.elements[14]=arrays[j][0][2],_transformMatrix.elements[15]=1,this.morph.setMatrixAt(current_glyph_index,_transformMatrix);var glyph=glyphList[current_glyph_index];glyph&&glyph.setTransformation(arrays[j][0],arrays[j][1],arrays[j][2],arrays[j][3]),current_glyph_index++}}this.morph.instanceMatrix.needsUpdate=!0},updateGlyphsetHexColors=current_colors=>{var numberOfGlyphs=1;"AXES_2D"==repeat_mode||"MIRROR"==repeat_mode?numberOfGlyphs=2:"AXES_3D"==repeat_mode&&(numberOfGlyphs=3);for(var hex_values,numberOfColours=current_colors.length,current_glyph_index=0,_i2=0;_i2<numberOfColours;_i2++){hex_values=current_colors[_i2];for(var j=0;j<numberOfGlyphs;j++){_bot_colour.setHex(hex_values),this.morph.setColorAt(current_glyph_index,_bot_colour);var glyph=glyphList[current_glyph_index];glyph&&glyph.setColour(_bot_colour),current_glyph_index++}}this.morph.instanceColor.needsUpdate=!0},updateMorphGlyphsets=()=>{var current_positions=_current_positions,current_axis1s=_current_axis1s,current_axis2s=_current_axis2s,current_axis3s=_current_axis3s,current_scales=_current_scales,current_colors=_current_colors,current_time=this.inbuildTime/this.duration*(numberOfTimeSteps-1),bottom_frame=Math.floor(current_time),proportion=1-(current_time-bottom_frame),top_frame=Math.ceil(current_time);if(morphVertices){var bottom_positions=positions[bottom_frame.toString()],top_positions=positions[top_frame.toString()],bottom_axis1=axis1s[bottom_frame.toString()],top_axis1=axis1s[top_frame.toString()],bottom_axis2=axis2s[bottom_frame.toString()],top_axis2=axis2s[top_frame.toString()],bottom_axis3=axis3s[bottom_frame.toString()],top_axis3=axis3s[top_frame.toString()],bottom_scale=scales[bottom_frame.toString()],top_scale=scales[top_frame.toString()];_current_positions.length=bottom_positions.length,_current_axis1s.length=bottom_positions.length,_current_axis2s.length=bottom_positions.length,_current_axis3s.length=bottom_positions.length,_current_scales.length=bottom_positions.length;for(var _i3=0;_i3<bottom_positions.length;_i3++)current_positions[_i3]=proportion*bottom_positions[_i3]+(1-proportion)*top_positions[_i3],current_axis1s[_i3]=proportion*bottom_axis1[_i3]+(1-proportion)*top_axis1[_i3],current_axis2s[_i3]=proportion*bottom_axis2[_i3]+(1-proportion)*top_axis2[_i3],current_axis3s[_i3]=proportion*bottom_axis3[_i3]+(1-proportion)*top_axis3[_i3],current_scales[_i3]=proportion*bottom_scale[_i3]+(1-proportion)*top_scale[_i3]}else positions[0],_readOnlyError("current_positions"),axis1s[0],_readOnlyError("current_axis1s"),axis2s[0],_readOnlyError("current_axis2s"),axis3s[0],_readOnlyError("current_axis3s"),scales[0],_readOnlyError("current_scales");if(updateGlyphsetTransformation(current_positions,current_axis1s,current_axis2s,current_axis3s,current_scales),this.boundingBoxUpdateRequired=!0,null!=colors){if(morphColours){var bottom_colors=colors[bottom_frame.toString()],top_colors=colors[top_frame.toString()];current_colors.length=bottom_colors.length;for(var _i4=0;_i4<bottom_colors.length;_i4++)_bot_colour.setHex(bottom_colors[_i4]),_top_colour.setHex(top_colors[_i4]),_bot_colour.setRGB(_bot_colour.r*proportion+_top_colour.r*(1-proportion),_bot_colour.g*proportion+_top_colour.g*(1-proportion),_bot_colour.b*proportion+_top_colour.b*(1-proportion)),current_colors[_i4]=_bot_colour.getHex();/*
640
+ */var resolve_glyph_axes=(point,axis1,axis2,axis3,scale,return_arrays)=>{if("NONE"==repeat_mode||"MIRROR"==repeat_mode){for(var sign,axis_scale=[0,0,0],final_axis1=[0,0,0],final_axis2=[0,0,0],final_axis3=[0,0,0],final_point=[0,0,0],mirrored_axis1=[0,0,0],mirrored_axis2=[0,0,0],mirrored_axis3=[0,0,0],mirrored_point=[0,0,0],j=0;3>j;j++)sign=0>scale[j]?-1:1,axis_scale[j]=(sign*baseSize[j]+scale[j]*scaleFactors[j])*this.globalScale;for(var j=0;3>j;j++)final_axis1[j]=axis1[j]*axis_scale[0],final_axis2[j]=axis2[j]*axis_scale[1],final_axis3[j]=axis3[j]*axis_scale[2],final_point[j]=point[j]+offset[0]*final_axis1[j]+offset[1]*final_axis2[j]+offset[2]*final_axis3[j],"MIRROR"==repeat_mode&&(mirrored_axis1[j]=-final_axis1[j],mirrored_axis2[j]=-final_axis2[j],mirrored_axis3[j]=-final_axis3[j],mirrored_point[j]=final_point[j],0>scale[0]&&(final_point[j]-=final_axis1[j],mirrored_point[j]-=mirrored_axis1[j]));/* if required, reverse axis3 to maintain right-handed coordinate system */0>final_axis3[0]*(final_axis1[1]*final_axis2[2]-final_axis1[2]*final_axis2[1])+final_axis3[1]*(final_axis1[2]*final_axis2[0]-final_axis1[0]*final_axis2[2])+final_axis3[2]*(final_axis1[0]*final_axis2[1]-final_axis1[1]*final_axis2[0])&&(final_axis3[0]=-final_axis3[0],final_axis3[1]=-final_axis3[1],final_axis3[2]=-final_axis3[2]),return_arrays[0]=[final_point,final_axis1,final_axis2,final_axis3],"MIRROR"==repeat_mode&&(0>mirrored_axis3[0]*(mirrored_axis1[1]*mirrored_axis2[2]-mirrored_axis1[2]*mirrored_axis2[1])+mirrored_axis3[1]*(mirrored_axis1[2]*mirrored_axis2[0]-mirrored_axis1[0]*mirrored_axis2[2])+mirrored_axis3[2]*(mirrored_axis1[0]*mirrored_axis2[1]-mirrored_axis1[1]*mirrored_axis2[0])&&(mirrored_axis3[0]=-mirrored_axis3[0],mirrored_axis3[1]=-mirrored_axis3[1],mirrored_axis3[2]=-mirrored_axis3[2]),return_arrays[1]=[mirrored_point,mirrored_axis1,mirrored_axis2,mirrored_axis3])}else if("AXES_2D"==repeat_mode||"AXES_3D"==repeat_mode){for(var sign,_axis_scale=[0,0,0],_final_point=[0,0,0],j=0;3>j;j++)sign=0>scale[j]?-1:1,_axis_scale[j]=(sign*baseSize[0]+scale[j]*scaleFactors[0])*this.globalScale;for(var j=0;3>j;j++)_final_point[j]=point[j]+offset[0]*_axis_scale[0]*axis1[j]+offset[1]*_axis_scale[1]*axis2[j]+offset[2]*_axis_scale[2]*axis3[j];for(var number_of_glyphs="AXES_2D"==glyph_repeat_mode?2:3,k=0;k<number_of_glyphs;k++){var use_axis1=void 0,use_axis2=void 0,use_scale=scale[k],_final_axis=[0,0,0],_final_axis2=[0,0,0],_final_axis3=[0,0,0];0==k?(use_axis1=axis1,use_axis2=axis2):1==k?(use_axis1=axis2,use_axis2="AXES_2D"==glyph_repeat_mode?axis1:axis3):(use_axis1=axis3,use_axis2=axis1);var final_scale1=(baseSize[0]+use_scale*scaleFactors[0])*this.globalScale;_final_axis[0]=use_axis1[0]*final_scale1,_final_axis[1]=use_axis1[1]*final_scale1,_final_axis[2]=use_axis1[2]*final_scale1,_final_axis3[0]=_final_axis[1]*use_axis2[2]-use_axis2[1]*_final_axis[2],_final_axis3[1]=_final_axis[2]*use_axis2[0]-use_axis2[2]*_final_axis[0],_final_axis3[2]=_final_axis[0]*use_axis2[1]-_final_axis[1]*use_axis2[0];var magnitude=Math.sqrt(_final_axis3[0]*_final_axis3[0]+_final_axis3[1]*_final_axis3[1]+_final_axis3[2]*_final_axis3[2]);if(0<magnitude){var _scaling=(baseSize[2]+use_scale*scaleFactors[2])*this.globalScale/magnitude;"AXES_2D"==repeat_mode&&0<k&&(_scaling*=-1),_final_axis3[0]*=_scaling,_final_axis3[1]*=_scaling,_final_axis3[2]*=_scaling}if(_final_axis2[0]=_final_axis3[1]*_final_axis[2]-_final_axis[1]*_final_axis3[2],_final_axis2[1]=_final_axis3[2]*_final_axis[0]-_final_axis[2]*_final_axis3[0],_final_axis2[2]=_final_axis3[0]*_final_axis[1]-_final_axis3[1]*_final_axis[0],magnitude=Math.sqrt(_final_axis2[0]*_final_axis2[0]+_final_axis2[1]*_final_axis2[1]+_final_axis2[2]*_final_axis2[2]),0<magnitude){var scaling=(baseSize[1]+use_scale*scaleFactors[1])*this.globalScale/magnitude;_final_axis2[0]*=scaling,_final_axis2[1]*=scaling,_final_axis2[2]*=scaling}return_arrays[k]=[_final_point,_final_axis,_final_axis2,_final_axis3]}}return return_arrays},updateGlyphsetTransformation=(current_positions,current_axis1s,current_axis2s,current_axis3s,current_scales)=>{var numberOfGlyphs=1;"AXES_2D"==repeat_mode||"MIRROR"==repeat_mode?numberOfGlyphs=2:"AXES_3D"==repeat_mode&&(numberOfGlyphs=3);var numberOfPositions=current_positions.length/3,current_glyph_index=0;_glyph_axis_array.length=numberOfGlyphs;for(var _i=0;_i<numberOfPositions;_i++){var current_index=3*_i,current_position=[current_positions[current_index],current_positions[current_index+1],current_positions[current_index+2]],current_axis1=[current_axis1s[current_index],current_axis1s[current_index+1],current_axis1s[current_index+2]],current_axis2=[current_axis2s[current_index],current_axis2s[current_index+1],current_axis2s[current_index+2]],current_axis3=[current_axis3s[current_index],current_axis3s[current_index+1],current_axis3s[current_index+2]],current_scale=[current_scales[current_index],current_scales[current_index+1],current_scales[current_index+2]],arrays=resolve_glyph_axes(current_position,current_axis1,current_axis2,current_axis3,current_scale,_glyph_axis_array);if(arrays.length==numberOfGlyphs)for(var j=0;j<numberOfGlyphs;j++){_transformMatrix.elements[0]=arrays[j][1][0],_transformMatrix.elements[1]=arrays[j][1][1],_transformMatrix.elements[2]=arrays[j][1][2],_transformMatrix.elements[3]=0,_transformMatrix.elements[4]=arrays[j][2][0],_transformMatrix.elements[5]=arrays[j][2][1],_transformMatrix.elements[6]=arrays[j][2][2],_transformMatrix.elements[7]=0,_transformMatrix.elements[8]=arrays[j][3][0],_transformMatrix.elements[9]=arrays[j][3][1],_transformMatrix.elements[10]=arrays[j][3][2],_transformMatrix.elements[11]=0,_transformMatrix.elements[12]=arrays[j][0][0],_transformMatrix.elements[13]=arrays[j][0][1],_transformMatrix.elements[14]=arrays[j][0][2],_transformMatrix.elements[15]=1,this.morph.setMatrixAt(current_glyph_index,_transformMatrix);var glyph=glyphList[current_glyph_index];glyph&&glyph.setTransformation(arrays[j][0],arrays[j][1],arrays[j][2],arrays[j][3]),current_glyph_index++}}this.morph.instanceMatrix.needsUpdate=!0},updateGlyphsetHexColors=current_colors=>{var numberOfGlyphs=1;"AXES_2D"==repeat_mode||"MIRROR"==repeat_mode?numberOfGlyphs=2:"AXES_3D"==repeat_mode&&(numberOfGlyphs=3);for(var hex_values,numberOfColours=current_colors.length,current_glyph_index=0,_i2=0;_i2<numberOfColours;_i2++){hex_values=current_colors[_i2];for(var j=0;j<numberOfGlyphs;j++){_bot_colour.setHex(hex_values),this.morph.setColorAt(current_glyph_index,_bot_colour);var glyph=glyphList[current_glyph_index];glyph&&glyph.setColour(_bot_colour),current_glyph_index++}}this.morph.instanceColor.needsUpdate=!0},updateMorphGlyphsets=()=>{var current_positions=_current_positions,current_axis1s=_current_axis1s,current_axis2s=_current_axis2s,current_axis3s=_current_axis3s,current_scales=_current_scales,current_colors=_current_colors,current_time=this.inbuildTime/this.duration*(numberOfTimeSteps-1),bottom_frame=Math.floor(current_time),proportion=1-(current_time-bottom_frame),top_frame=Math.ceil(current_time);if(morphVertices){var bottom_positions=positions[bottom_frame.toString()],top_positions=positions[top_frame.toString()],bottom_axis1=axis1s[bottom_frame.toString()],top_axis1=axis1s[top_frame.toString()],bottom_axis2=axis2s[bottom_frame.toString()],top_axis2=axis2s[top_frame.toString()],bottom_axis3=axis3s[bottom_frame.toString()],top_axis3=axis3s[top_frame.toString()],bottom_scale=scales[bottom_frame.toString()],top_scale=scales[top_frame.toString()];_current_positions.length=bottom_positions.length,_current_axis1s.length=bottom_positions.length,_current_axis2s.length=bottom_positions.length,_current_axis3s.length=bottom_positions.length,_current_scales.length=bottom_positions.length;for(var _i3=0;_i3<bottom_positions.length;_i3++)current_positions[_i3]=proportion*bottom_positions[_i3]+(1-proportion)*top_positions[_i3],current_axis1s[_i3]=proportion*bottom_axis1[_i3]+(1-proportion)*top_axis1[_i3],current_axis2s[_i3]=proportion*bottom_axis2[_i3]+(1-proportion)*top_axis2[_i3],current_axis3s[_i3]=proportion*bottom_axis3[_i3]+(1-proportion)*top_axis3[_i3],current_scales[_i3]=proportion*bottom_scale[_i3]+(1-proportion)*top_scale[_i3]}else current_positions=positions[0],current_axis1s=axis1s[0],current_axis2s=axis2s[0],current_axis3s=axis3s[0],current_scales=scales[0];if(updateGlyphsetTransformation(current_positions,current_axis1s,current_axis2s,current_axis3s,current_scales),this.boundingBoxUpdateRequired=!0,null!=colors){if(morphColours){var bottom_colors=colors[bottom_frame.toString()],top_colors=colors[top_frame.toString()];current_colors.length=bottom_colors.length;for(var _i4=0;_i4<bottom_colors.length;_i4++)_bot_colour.setHex(bottom_colors[_i4]),_top_colour.setHex(top_colors[_i4]),_bot_colour.setRGB(_bot_colour.r*proportion+_top_colour.r*(1-proportion),_bot_colour.g*proportion+_top_colour.g*(1-proportion),_bot_colour.b*proportion+_top_colour.b*(1-proportion)),current_colors[_i4]=_bot_colour.getHex();/*
636
641
  for (var i = 0; i < bottom_colors.length; i++) {
637
642
  current_colors.push(proportion * bottom_colors[i] + (1.0 - proportion) * top_colors[i]);
638
643
  }
639
- */}else colors[0],_readOnlyError("current_colors");updateGlyphsetHexColors(current_colors)}};/**
644
+ */}else current_colors=colors[0];updateGlyphsetHexColors(current_colors)}};/**
640
645
  * Update transformation for each of the glyph in this glyphset.
641
646
  */ /**
642
647
  * Update colour for each of the glyph in this glyphset.
@@ -646,16 +651,16 @@ function _readOnlyError(name){throw new TypeError("\""+name+"\" is read-only")}v
646
651
  * the internal time has been updated.
647
652
  */ /**
648
653
  * Display the label of the glyphs in the glyphset.
649
- */this.showLabel=()=>{for(var _i5=0;_i5<glyphList.length;_i5++)glyphList[_i5].showLabel(this.morph.material?this.morph.material.color:void 0)};/**
654
+ */this.showLabel=()=>{for(var _i5=0;_i5<glyphList.length;_i5++)glyphList[_i5].showLabel(this.morph.material?this.morph.material.color:void 0)},this.hideLabel=()=>{for(var _i6=0;_i6<glyphList.length;_i6++)glyphList[_i6].hideLabel()};/**
650
655
  * Create the glyphs in the glyphset.
651
656
  *
652
657
  * @param {Boolean} displayLabels -Flag to determine either the labels should be display or not.
653
- */var createGlyphs=displayLabels=>{if(labels!=null&&displayLabels)for(var glyph,_i6=0;_i6<numberOfVertices;_i6++)glyph=new((__webpack_require__(16).Glyph))(void 0,void 0,_i6,this),null!=labels&&null!=labels[_i6]&&glyph.setLabel(labels[_i6]),0<numberOfTimeSteps&&glyph.setFrustumCulled(!1),glyphList[_i6]=glyph,this.morph.add(glyph.getGroup());//Update the transformation of the glyphs.
654
- labels!=null&&displayLabels&&this.showLabel(this.morph.material?this.morph.material.color:void 0),updateGlyphsetTransformation(positions[0],axis1s[0],axis2s[0],axis3s[0],scales[0]),colors!=null&&updateGlyphsetHexColors(colors[0]),this.ready=!0,this.boundingBoxUpdateRequired=!0};/**
658
+ */var createGlyphs=displayLabels=>{for(var _i7=0;_i7<numberOfVertices;_i7++){var glyph=new((__webpack_require__(16).Glyph))(void 0,void 0,_i7,this),label=labels?labels[_i7]:void 0;label=label?label:this.groupName,label&&glyph.setLabel(label),0<numberOfTimeSteps&&glyph.setFrustumCulled(!1),glyphList[_i7]=glyph,this.morph.add(glyph.getGroup())}//Update the transformation of the glyphs.
659
+ displayLabels&&this.showLabel(),updateGlyphsetTransformation(positions[0],axis1s[0],axis2s[0],axis3s[0],scales[0]),colors!=null&&updateGlyphsetHexColors(colors[0]),this.ready=!0,this.boundingBoxUpdateRequired=!0};/**
655
660
  * Add a custom {@link Glyph} to this {@link Glyphset}.
656
661
  *
657
662
  * @param {Glyph} Glyph to be added.
658
- */this.addCustomGlyph=glyph=>{glyph.isGlyph&&glyphList.push(glyph),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(mesh,id)=>{if(mesh.isMesh){var glyph=new((__webpack_require__(16).Glyph))(void 0,void 0,id,this);return glyph.fromMesh(mesh),glyphList.push(glyph),this.morph.add(glyph.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,glyph}},this.forEachGlyph=callbackFunction=>{for(var _i7=0;_i7<glyphList.length;_i7++)callbackFunction(glyphList[_i7])};var meshloader=(finishCallback,displayLabels)=>(geometry,materials)=>{var tempGeometry=geometry.toBufferGeometry();this.geometry.copy(tempGeometry),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),tempGeometry.dispose(),materials&&materials[0]&&(this.morph.material=materials[0]),createGlyphs(displayLabels),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),geometry.dispose(),null!=finishCallback&&"function"==typeof finishCallback&&finishCallback(this)};/**
663
+ */this.addCustomGlyph=glyph=>{glyph.isGlyph&&glyphList.push(glyph),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(mesh,id)=>{if(mesh.isMesh){var glyph=new((__webpack_require__(16).Glyph))(void 0,void 0,id,this);return glyph.fromMesh(mesh),glyphList.push(glyph),this.morph.add(glyph.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,glyph}},this.forEachGlyph=callbackFunction=>{for(var _i8=0;_i8<glyphList.length;_i8++)callbackFunction(glyphList[_i8])};var meshloader=(finishCallback,displayLabels)=>(geometry,materials)=>{var tempGeometry=geometry.toBufferGeometry();this.geometry.copy(tempGeometry),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),tempGeometry.dispose(),materials&&materials[0]&&(this.morph.material=materials[0]),createGlyphs(displayLabels),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),geometry.dispose(),null!=finishCallback&&"function"==typeof finishCallback&&finishCallback(this)};/**
659
664
  * Get the index of the closest vertex to centroid.
660
665
  */ /**
661
666
  * Get the closest vertex to centroid.
@@ -676,14 +681,18 @@ labels!=null&&displayLabels&&this.showLabel(this.morph.material?this.morph.mater
676
681
  *
677
682
  * @return {Number}
678
683
  */ /**
684
+ * Set the objects scale.
685
+ *
686
+ * @return {THREE.Box3}.
687
+ */ /**
679
688
  * Clear this glyphset and its list of glyphs which will release them from the memory.
680
689
  */ /**
681
690
  * Update the glyphsets if required the render.
682
- */this.getClosestVertexIndex=function(){var closestIndex=-1;if(this.morph&&this.ready){this.getBoundingBox().getCenter(this._v1);for(var current_index,current_positions=positions[0],numberOfPositions=current_positions.length/3,distance=-1,currentDistance=0,_i8=0;_i8<numberOfPositions;_i8++)current_index=3*_i8,this._v2.set(current_positions[current_index],current_positions[current_index+1],current_positions[current_index+2]),currentDistance=this._v1.distanceTo(this._v2),-1==distance?(distance=currentDistance,closestIndex=_i8):distance>currentDistance&&(distance=currentDistance,closestIndex=_i8)}return closestIndex},this.getClosestVertex=function(){if(-1==this.closestVertexIndex&&(this.closestVertexIndex=this.getClosestVertexIndex()),0<=this.closestVertexIndex&&this.morph)/*
691
+ */this.getClosestVertexIndex=function(){var closestIndex=-1;if(this.morph&&this.ready){this.getBoundingBox().getCenter(this._v1);for(var current_index,current_positions=positions[0],numberOfPositions=current_positions.length/3,distance=-1,currentDistance=0,_i9=0;_i9<numberOfPositions;_i9++)current_index=3*_i9,this._v2.set(current_positions[current_index],current_positions[current_index+1],current_positions[current_index+2]),currentDistance=this._v1.distanceTo(this._v2),-1==distance?(distance=currentDistance,closestIndex=_i9):distance>currentDistance&&(distance=currentDistance,closestIndex=_i9)}return closestIndex},this.getClosestVertex=function(){if(-1==this.closestVertexIndex&&(this.closestVertexIndex=this.getClosestVertexIndex()),0<=this.closestVertexIndex&&this.morph)/*
683
692
  if (glyphList && glyphList[this.closestVertexIndex]) {
684
693
  glyphList[this.closestVertexIndex].getBoundingBox().getCenter(position);
685
694
  }
686
- */{var position=new THREE.Vector3;return this.morph.getMatrixAt(this.closestVertexIndex,_transformMatrix),position.setFromMatrixPosition(_transformMatrix),position}},this.getBoundingBox=()=>{if(this.morph&&this.ready&&this.morph.visible){if(this.boundingBoxUpdateRequired){_boundingBox1.setFromBufferAttribute(this.morph.geometry.attributes.position);for(var _i9=0;_i9<numberOfVertices;_i9++)this.morph.getMatrixAt(_i9,_transformMatrix),_boundingBox2.copy(_boundingBox1).applyMatrix4(_transformMatrix),0==_i9?_boundingBox3.copy(_boundingBox2):_boundingBox3.union(_boundingBox2);if(_boundingBox3)this.cachedBoundingBox.copy(_boundingBox3),this.morph.updateWorldMatrix(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1;else return}return this.cachedBoundingBox}},this.setMorphTime=time=>{this.inbuildTime=time>this.duration?this.duration:0>time?0:time,(morphColours||morphVertices)&&(updateMorphGlyphsets(),morphVertices&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((!1===this.ready||0<numberOfTimeSteps)&&(morphColours||morphVertices)),this.getCurrentTime=()=>this.inbuildTime,this.dispose=()=>{for(var _i10=glyphList.length-1;0<=_i10;_i10--)glyphList[_i10].dispose();this.geometry&&this.geometry.dispose(),this.morph&&this.morph.material.dispose(),axis1s=void 0,axis2s=void 0,axis3s=void 0,positions=void 0,scales=void 0,colors=void 0,this.ready=!1,this.groupName=void 0},this.render=(delta,playAnimation,options)=>{if(!0==playAnimation){var targetTime=this.inbuildTime+delta;targetTime>this.duration&&(targetTime-=this.duration),this.inbuildTime=targetTime,(morphColours||morphVertices)&&updateMorphGlyphsets()}this.updateMarker(playAnimation,options)}};/**
695
+ */{var position=new THREE.Vector3;return this.morph.getMatrixAt(this.closestVertexIndex,_transformMatrix),position.setFromMatrixPosition(_transformMatrix),position}},this.getBoundingBox=()=>{if(this.morph&&this.ready&&this.morph.visible){if(this.boundingBoxUpdateRequired){_boundingBox1.setFromBufferAttribute(this.morph.geometry.attributes.position);for(var _i10=0;_i10<numberOfVertices;_i10++)this.morph.getMatrixAt(_i10,_transformMatrix),_boundingBox2.copy(_boundingBox1).applyMatrix4(_transformMatrix),0==_i10?_boundingBox3.copy(_boundingBox2):_boundingBox3.union(_boundingBox2);if(_boundingBox3)this.cachedBoundingBox.copy(_boundingBox3),this.morph.updateWorldMatrix(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1;else return}return this.cachedBoundingBox}},this.setMorphTime=time=>{this.inbuildTime=time>this.duration?this.duration:0>time?0:time,(morphColours||morphVertices)&&(updateMorphGlyphsets(),morphVertices&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((!1===this.ready||0<numberOfTimeSteps)&&(morphColours||morphVertices)),this.getCurrentTime=()=>this.inbuildTime,this.setScaleAll=function(scale){this.globalScale=scale,updateMorphGlyphsets()},this.dispose=()=>{for(var _i11=glyphList.length-1;0<=_i11;_i11--)glyphList[_i11].dispose();this.geometry&&this.geometry.dispose(),this.morph&&this.morph.material.dispose(),axis1s=void 0,axis2s=void 0,axis3s=void 0,positions=void 0,scales=void 0,colors=void 0,this.ready=!1,this.groupName=void 0},this.render=(delta,playAnimation,options)=>{if(!0==playAnimation){var targetTime=this.inbuildTime+delta;targetTime>this.duration&&(targetTime-=this.duration),this.inbuildTime=targetTime,(morphColours||morphVertices)&&updateMorphGlyphsets()}this.updateMarker(playAnimation,options)}};/**
687
696
  * This is a container of {@link Glyph} and their graphical properties
688
697
  * including transformations, colors, number of time steps, duration of animations
689
698
  * and group name. Please note that all glyphs in the glyphset share the same geometry
@@ -1087,7 +1096,7 @@ var THREE=__webpack_require__(4),MarkerCluster=(__webpack_require__(33).MarkerCl
1087
1096
  * in this scene.
1088
1097
  * @returns {Array}
1089
1098
  */this.getDownloadProgress=()=>sceneLoader.getDownloadProgress(),this.onWindowResize=()=>{var wHeight=getDrawingHeight();this.camera.aspect=getDrawingWidth()/wHeight,this.camera.updateProjectionMatrix(),this.minimapScissor.updateRequired=!0,zincCameraControls.onResize(),zincCameraControls.calculateHeightPerPixelAtZeroDepth(wHeight)},this.resetView=()=>{this.onWindowResize(),zincCameraControls.resetView()},this.changeZoomByScrollRateUnit=unit=>{zincCameraControls.changeZoomByScrollRateUnit(unit)};//Setup the camera for this scene, it also initialise the lighting
1090
- var setupCamera=()=>{this.camera=new THREE.PerspectiveCamera(40,getDrawingWidth()/getDrawingHeight(),0,10),this.ambient=new THREE.AmbientLight(16777215,.2),scene.add(this.ambient),this.directionalLight=new THREE.DirectionalLight(16777215,.8),scene.add(this.directionalLight),zincCameraControls=new((__webpack_require__(43).CameraControls))(this.camera,rendererIn.domElement,rendererIn,this),zincCameraControls.setDirectionalLight(this.directionalLight),zincCameraControls.resetView(),minimap=new((__webpack_require__(49).Minimap))(this)};setupCamera(),this.loadView=settings=>{var viewPort=new Viewport;return viewPort.setFromObject(settings),zincCameraControls.setCurrentCameraSettings(viewPort),!0},this.setupMultipleViews=(defaultView,entries)=>{for(var[name,settings]of Object.entries(entries)){var viewport=new Viewport;viewport.setFromObject(settings),zincCameraControls.addViewport(name,viewport)}zincCameraControls.setDefaultViewport(defaultView)},this.getBoundingBox=()=>rootRegion.getBoundingBox(!0),this.viewAllWithBoundingBox=boundingBox=>{if(boundingBox){var viewport=zincCameraControls.getViewportFromBoundingBox(boundingBox,1);zincCameraControls.setCurrentCameraSettings(viewport),zincCameraControls.calculateHeightPerPixelAtZeroDepth(getDrawingHeight()),markerCluster.markerUpdateRequired=!0}},this.viewAll=()=>{var boundingBox=this.getBoundingBox();this.viewAllWithBoundingBox(boundingBox),markerCluster.markerUpdateRequired=!0},this.forEachGeometry=callbackFunction=>{rootRegion.forEachGeometry(callbackFunction,!0)},this.forEachGlyphset=callbackFunction=>{rootRegion.forEachGlyphset(callbackFunction,!0)},this.forEachPointset=callbackFunction=>{rootRegion.forEachPointset(callbackFunction,!0)},this.forEachLine=callbackFunction=>{rootRegion.forEachLine(callbackFunction,!0)},this.findGeometriesWithGroupName=GroupName=>rootRegion.findGeometriesWithGroupName(GroupName,!0),this.findPointsetsWithGroupName=GroupName=>rootRegion.findPointsetsWithGroupName(GroupName,!0),this.findGlyphsetsWithGroupName=GroupName=>rootRegion.findGlyphsetsWithGroupName(GroupName,!0),this.findLinesWithGroupName=GroupName=>rootRegion.findLinesWithGroupName(GroupName,!0),this.findObjectsWithGroupName=GroupName=>rootRegion.findObjectsWithGroupName(GroupName,!0),this.findObjectsWithAnatomicalId=anatomicalId=>rootRegion.findObjectsWithAnatomicalId(anatomicalId,!0),this.getBoundingBoxOfZincObjects=objectsArray=>{for(var box,boundingBox=void 0,i=0;i<objectsArray.length;i++)box=objectsArray[i].getBoundingBox(),box&&(boundingBox?boundingBox.union(box):boundingBox=box);return boundingBox},this.vectorToScreenXY=point=>{point.project(this.camera);var width=getDrawingWidth(),height=getDrawingHeight(),widthHalf=width/2,heightHalf=height/2;return point.x=point.x*widthHalf+widthHalf,point.y=-(point.y*heightHalf)+heightHalf,point},this.getObjectsScreenXY=zincObjects=>{if(zincObjects&&0<zincObjects.length){var boundingBox=this.getBoundingBoxOfZincObjects(zincObjects),center=new THREE.Vector3;return boundingBox.getCenter(center),this.vectorToScreenXY(center)}},this.getNamedObjectsScreenXY=name=>{var zincObjects=this.findObjectsWithGroupName(name);return this.getObjectsScreenXY(zincObjects)},this.addZincObject=zincObject=>{zincObject&&(rootRegion.addZincObject(zincObject),zincCameraControls&&zincCameraControls.calculateMaxAllowedDistance(this))},this.loadGlyphsetURL=(metaurl,glyphurl,groupName,finishCallback)=>{sceneLoader.loadGlyphsetURL(rootRegion,metaurl,glyphurl,groupName,finishCallback)},this.loadPointsetURL=(url,timeEnabled,morphColour,groupName,finishCallback)=>{sceneLoader.loadPointsetURL(rootRegion,url,timeEnabled,morphColour,groupName,finishCallback)},this.loadLinesURL=(url,timeEnabled,morphColour,groupName,finishCallback)=>{sceneLoader.loadLinesURL(rootRegion,url,timeEnabled,morphColour,groupName,finishCallback)},this.loadSTL=(url,groupName,finishCallback)=>{sceneLoader.loadSTL(rootRegion,url,groupName,finishCallback)},this.loadOBJ=(url,groupName,finishCallback)=>{sceneLoader.loadOBJ(rootRegion,url,groupName,finishCallback)},this.loadMetadataURL=(url,finishCallback,allCompletedCallback)=>{sceneLoader.loadMetadataURL(rootRegion,url,finishCallback,allCompletedCallback)},this.loadModelsURL=(urls,colours,opacities,timeEnabled,morphColour,finishCallback)=>{sceneLoader.loadModelsURL(rootRegion.urls,colours,opacities,timeEnabled,morphColour,finishCallback)},this.loadViewURL=url=>{sceneLoader.loadViewURL(url)},this.loadFromViewURL=(jsonFilePrefix,finishCallback)=>{sceneLoader.loadFromViewURL(jsonFilePrefix,finishCallback)},this.loadGLTF=(url,finishCallback,allCompletedCallback,options)=>{sceneLoader.loadGLTF(rootRegion,url,finishCallback,allCompletedCallback,options)},this.updateDirectionalLight=()=>{zincCameraControls.updateDirectionalLight()},this.addObject=object=>{scene.add(object)},this.removeObject=object=>{scene.remove(object)},this.getCurrentTime=()=>{if(videoHandler!=null)return videoHandler.getCurrentTime(duration);var time=rootRegion.getCurrentTime();return-1===time?0:time},this.setMorphsTime=time=>{videoHandler!=null&&videoHandler.setMorphTime(time,duration),rootRegion.setMorphTime(time,!0)},this.isTimeVarying=()=>!!(videoHandler&&videoHandler.video&&!videoHandler.video.error)||rootRegion.isTimeVarying(),this.renderGeometries=(playRate,delta,playAnimation)=>{// Let video dictates the progress if one is present
1099
+ var setupCamera=()=>{this.camera=new THREE.PerspectiveCamera(40,getDrawingWidth()/getDrawingHeight(),0,10),this.ambient=new THREE.AmbientLight(16777215,.2),scene.add(this.ambient),this.directionalLight=new THREE.DirectionalLight(16777215,.8),scene.add(this.directionalLight),zincCameraControls=new((__webpack_require__(43).CameraControls))(this.camera,rendererIn.domElement,rendererIn,this),zincCameraControls.setDirectionalLight(this.directionalLight),zincCameraControls.resetView(),minimap=new((__webpack_require__(49).Minimap))(this)};setupCamera(),this.loadView=settings=>{var viewPort=new Viewport;return viewPort.setFromObject(settings),zincCameraControls.setCurrentCameraSettings(viewPort),!0},this.setupMultipleViews=(defaultView,entries)=>{for(var[name,settings]of Object.entries(entries)){var viewport=new Viewport;viewport.setFromObject(settings),zincCameraControls.addViewport(name,viewport)}zincCameraControls.setDefaultViewport(defaultView)},this.getBoundingBox=()=>rootRegion.getBoundingBox(!0),this.viewAllWithBoundingBox=boundingBox=>{if(boundingBox){var viewport=zincCameraControls.getViewportFromBoundingBox(boundingBox,1);zincCameraControls.setCurrentCameraSettings(viewport),zincCameraControls.calculateHeightPerPixelAtZeroDepth(getDrawingHeight()),markerCluster.markerUpdateRequired=!0}},this.viewAll=()=>{var boundingBox=this.getBoundingBox();this.viewAllWithBoundingBox(boundingBox),markerCluster.markerUpdateRequired=!0},this.forEachGeometry=callbackFunction=>{rootRegion.forEachGeometry(callbackFunction,!0)},this.forEachGlyphset=callbackFunction=>{rootRegion.forEachGlyphset(callbackFunction,!0)},this.forEachPointset=callbackFunction=>{rootRegion.forEachPointset(callbackFunction,!0)},this.forEachLine=callbackFunction=>{rootRegion.forEachLine(callbackFunction,!0)},this.findGeometriesWithGroupName=GroupName=>rootRegion.findGeometriesWithGroupName(GroupName,!0),this.findPointsetsWithGroupName=GroupName=>rootRegion.findPointsetsWithGroupName(GroupName,!0),this.findGlyphsetsWithGroupName=GroupName=>rootRegion.findGlyphsetsWithGroupName(GroupName,!0),this.findLinesWithGroupName=GroupName=>rootRegion.findLinesWithGroupName(GroupName,!0),this.findObjectsWithGroupName=GroupName=>rootRegion.findObjectsWithGroupName(GroupName,!0),this.findObjectsWithAnatomicalId=anatomicalId=>rootRegion.findObjectsWithAnatomicalId(anatomicalId,!0),this.getBoundingBoxOfZincObjects=objectsArray=>{for(var box,boundingBox=void 0,i=0;i<objectsArray.length;i++)box=objectsArray[i].getBoundingBox(),box&&(boundingBox?boundingBox.union(box):boundingBox=box);return boundingBox},this.vectorToScreenXY=point=>{point.project(this.camera);var width=getDrawingWidth(),height=getDrawingHeight(),widthHalf=width/2,heightHalf=height/2;return point.x=point.x*widthHalf+widthHalf,point.y=-(point.y*heightHalf)+heightHalf,point},this.getObjectsScreenXY=zincObjects=>{if(zincObjects&&0<zincObjects.length){var boundingBox=this.getBoundingBoxOfZincObjects(zincObjects),center=new THREE.Vector3;return boundingBox.getCenter(center),this.vectorToScreenXY(center)}},this.getNamedObjectsScreenXY=name=>{var zincObjects=this.findObjectsWithGroupName(name);return this.getObjectsScreenXY(zincObjects)},this.addZincObject=zincObject=>{zincObject&&(rootRegion.addZincObject(zincObject),zincCameraControls&&zincCameraControls.calculateMaxAllowedDistance(this))},this.loadGlyphsetURL=(metaurl,glyphurl,groupName,finishCallback)=>{sceneLoader.loadGlyphsetURL(rootRegion,metaurl,glyphurl,groupName,finishCallback)},this.loadPointsetURL=(url,timeEnabled,morphColour,groupName,finishCallback)=>{sceneLoader.loadPointsetURL(rootRegion,url,timeEnabled,morphColour,groupName,finishCallback)},this.loadLinesURL=(url,timeEnabled,morphColour,groupName,finishCallback)=>{sceneLoader.loadLinesURL(rootRegion,url,timeEnabled,morphColour,groupName,finishCallback)},this.loadSTL=(url,groupName,finishCallback)=>{sceneLoader.loadSTL(rootRegion,url,groupName,finishCallback)},this.loadOBJ=(url,groupName,finishCallback)=>{sceneLoader.loadOBJ(rootRegion,url,groupName,finishCallback)},this.loadMetadataURL=(url,finishCallback,allCompletedCallback,options)=>{sceneLoader.loadMetadataURL(rootRegion,url,finishCallback,allCompletedCallback,options)},this.loadModelsURL=(urls,colours,opacities,timeEnabled,morphColour,finishCallback)=>{sceneLoader.loadModelsURL(rootRegion.urls,colours,opacities,timeEnabled,morphColour,finishCallback)},this.loadViewURL=url=>{sceneLoader.loadViewURL(url)},this.loadFromViewURL=(jsonFilePrefix,finishCallback)=>{sceneLoader.loadFromViewURL(jsonFilePrefix,finishCallback)},this.loadGLTF=(url,finishCallback,allCompletedCallback,options)=>{sceneLoader.loadGLTF(rootRegion,url,finishCallback,allCompletedCallback,options)},this.updateDirectionalLight=()=>{zincCameraControls.updateDirectionalLight()},this.addObject=object=>{scene.add(object)},this.removeObject=object=>{scene.remove(object)},this.getCurrentTime=()=>{if(videoHandler!=null)return videoHandler.getCurrentTime(duration);var time=rootRegion.getCurrentTime();return-1===time?0:time},this.setMorphsTime=time=>{videoHandler!=null&&videoHandler.setMorphTime(time,duration),rootRegion.setMorphTime(time,!0)},this.isTimeVarying=()=>!!(videoHandler&&videoHandler.video&&!videoHandler.video.error)||rootRegion.isTimeVarying(),this.renderGeometries=(playRate,delta,playAnimation)=>{// Let video dictates the progress if one is present
1091
1100
  var options={};if(options.camera=zincCameraControls,options.displayMarkers=this.displayMarkers,options.markerCluster=markerCluster,options.markersList=markerCluster.markers,options.ndcToBeUpdated=!1,playAnimation&&(options.markerCluster.markerUpdateRequired=!0),!videoHandler)0==sceneLoader.toBeDownloaded?(options.ndcToBeUpdated=zincCameraControls.update(delta),options.ndcToBeUpdated&&zincCameraControls.calculateHeightPerPixelAtZeroDepth(getDrawingHeight()),rootRegion.renderGeometries(playRate,delta,playAnimation,zincCameraControls,options,!0)):zincCameraControls.update(0);else if(videoHandler.isReadyToPlay()){playAnimation?videoHandler.video.play():videoHandler.video.pause();var currentTime=videoHandler.video.currentTime/videoHandler.getVideoDuration()*duration;0==sceneLoader.toBeDownloaded?(zincCameraControls.setTime(currentTime),options.ndcToBeUpdated=zincCameraControls.update(0),options.ndcToBeUpdated&&zincCameraControls.calculateHeightPerPixelAtZeroDepth(getDrawingHeight()),rootRegion.setMorphTime(currentTime,!0),rootRegion.renderGeometries(0,0,playAnimation,zincCameraControls,options,!0)):zincCameraControls.update(0)}else myPlayRate=0},this.getThreeJSScene=()=>scene,this.setVideoHandler=videoHandlerIn=>{videoHandler||(videoHandler=videoHandlerIn)},this.setAdditionalScenesGroup=scenesGroup=>{scene.add(scenesGroup)};var getWindowsPosition=(align,x_offset,y_offset,width,height,renderer_width,renderer_height)=>{var x=0,y=0;return y=align.includes("top")?renderer_height-height-y_offset:align.includes("bottom")?y_offset:Math.floor((renderer_height-height)/2),x=align.includes("left")?x_offset:align.includes("right")?renderer_width-x_offset-width:Math.floor((renderer_width-width)/2),{x:x,y:y}},renderMinimap=renderer=>{!0===this.displayMinimap&&(renderer.setScissorTest(!0),renderer.getSize(_markerTarget),this.minimapScissor.updateRequired&&(scissor=getWindowsPosition(this.minimapScissor.align,this.minimapScissor.x_offset,this.minimapScissor.y_offset,this.minimapScissor.width,this.minimapScissor.height,_markerTarget.x,_markerTarget.y),this.minimapScissor.updateRequired=!1),renderer.setScissor(scissor.x,scissor.y,this.minimapScissor.width,this.minimapScissor.height),renderer.setViewport(scissor.x,scissor.y,this.minimapScissor.width,this.minimapScissor.height),minimap.updateCamera(),scene.add(minimap.mask),renderer.render(scene,minimap.camera),scene.remove(minimap.mask),renderer.setScissorTest(!1),renderer.setViewport(0,0,_markerTarget.x,_markerTarget.y))};/**
1092
1101
  * Render the scene.
1093
1102
  * @private
@@ -1205,7 +1214,7 @@ module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGlu
1205
1214
  /* 35 */
1206
1215
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1207
1216
 
1208
- var THREE=__webpack_require__(4),resolveURL=(__webpack_require__(5).resolveURL),createNewURL=(__webpack_require__(5).createNewURL),STLLoader=(__webpack_require__(36).STLLoader),OBJLoader=(__webpack_require__(37).OBJLoader),PrimitivesLoader=(__webpack_require__(38).PrimitivesLoader);/**
1217
+ var THREE=__webpack_require__(4),resolveURL=(__webpack_require__(5).resolveURL),createNewURL=(__webpack_require__(5).createNewURL),isRegionGroup=(__webpack_require__(5).isRegionGroup),STLLoader=(__webpack_require__(36).STLLoader),OBJLoader=(__webpack_require__(37).OBJLoader),PrimitivesLoader=(__webpack_require__(38).PrimitivesLoader);/**
1209
1218
  * A helper class to help with reading / importing primitives and
1210
1219
  * settings into a {@link Scene}.
1211
1220
  *
@@ -1296,18 +1305,20 @@ var readPrimitivesItem=(region,referenceURL,item,order,finishCallback)=>{if(item
1296
1305
  * @param {String} url - URL to the GLTF file
1297
1306
  * @param {Function} finishCallback - Callback function which will be called
1298
1307
  * once the glyphset is succssfully load in.
1299
- */this.loadGLTF=(region,url,finishCallback,allCompletedCallback,options)=>{var GLTFToZincJSLoader=new((__webpack_require__(39).GLTFToZincJSLoader));GLTFToZincJSLoader.load(scene,region,url,finishCallback,allCompletedCallback,options)};var loadRegions=(currentRegion,referenceURL,regions,callback)=>{if(regions.Primitives&&regions.Primitives.forEach(primitive=>{var order=1;primitive.Order&&(order=primitive.Order),readPrimitivesItem(currentRegion,referenceURL,primitive,order,callback)}),regions.Transformation&&currentRegion.setTransformation(regions.Transformation),regions.Children)for(var[regionName,value]of Object.entries(regions.Children)){var childRegion=currentRegion.findOrCreateChildFromPath(regionName);childRegion&&loadRegions(childRegion,referenceURL,value,callback)}},getNumberOfDownloadsInArray=(array,includeViews)=>{if(Array.isArray(array)){for(var count=0,i=0;i<array.length;i++)array[i].Type&&(includeViews&&"View"===array[i].Type||"Surfaces"===array[i].Type||"Glyph"===array[i].Type||"Points"===array[i].Type||"Lines"===array[i].Type||"Texture"===array[i].Type)&&count++;return count}return 0},getNumberOfObjectsInRegions=regionJson=>{var counts=regionJson.Primitives?getNumberOfDownloadsInArray(regionJson.Primitives,!1):0;return regionJson.Children&&Object.values(regionJson.Children).forEach(childRegion=>{counts+=getNumberOfObjectsInRegions(childRegion)}),counts},getNumberOfObjects=metadata=>{if(Array.isArray(metadata))return getNumberOfDownloadsInArray(metadata,!0);return"object"==typeof metadata&&null!==metadata&&"2.0"===metadata.Version?getNumberOfObjectsInRegions(metadata.Regions):void 0},readVersionOneRegionPath=(region,referenceURL,item,order,callback)=>{var targetRegion=region;//Render order is set to i * 2 to account for front and back rendering
1300
- item.RegionPath&&""!==item.RegionPath&&(targetRegion=region.findOrCreateChildFromPath(item.RegionPath)),readPrimitivesItem(targetRegion,referenceURL,item,2*order,callback)},loadVersionOne=(targetRegion,metadata,referenceURL,finishCallback,allCompletedCallback)=>{// view file does not receive callback
1308
+ */this.loadGLTF=(region,url,finishCallback,allCompletedCallback,options)=>{var GLTFToZincJSLoader=new((__webpack_require__(39).GLTFToZincJSLoader));GLTFToZincJSLoader.load(scene,region,url,finishCallback,allCompletedCallback,options)};var loadRegions=(currentRegion,referenceURL,regions,callback)=>{if(regions.Primitives&&regions.Primitives.forEach(primitive=>{var order=1;primitive.Order&&(order=primitive.Order),readPrimitivesItem(currentRegion,referenceURL,primitive,order,callback)}),regions.Transformation&&currentRegion.setTransformation(regions.Transformation),regions.Children)for(var[regionName,value]of Object.entries(regions.Children)){var childRegion=currentRegion.findOrCreateChildFromPath(regionName);childRegion&&loadRegions(childRegion,referenceURL,value,callback)}},filterPrimitivesArray=(array,options)=>{var _options$enabled,_options$enabled2,newArray=array,include=null===options||void 0===options||null===(_options$enabled=options.enabled)||void 0===_options$enabled?void 0:_options$enabled.include,exclude=null===options||void 0===options||null===(_options$enabled2=options.enabled)||void 0===_options$enabled2?void 0:_options$enabled2.exclude;return(null!==include&&void 0!==include&&include.length||null!==exclude&&void 0!==exclude&&exclude.length)&&(include&&(newArray=array.filter(item=>{if("View"===item.Type)return!0;for(var i=0;i<include.length;i++)if(isRegionGroup(item.RegionPath,item.GroupName,include[i]))return!0;return!1})),exclude&&(newArray=newArray.filter(item=>{if("View"===item.Type)return!0;for(var i=0;i<exclude.length;i++)if(isRegionGroup(item.RegionPath,item.GroupName,exclude[i]))return!1;return!0}))),newArray},filterMetadataInArray=(metadata,options)=>Array.isArray(metadata)?filterPrimitivesArray(metadata,options):metadata,getNumberOfDownloadsInArray=(array,includeViews)=>{if(Array.isArray(array)){for(var count=0,i=0;i<array.length;i++)array[i].Type&&(includeViews&&"View"===array[i].Type||"Surfaces"===array[i].Type||"Glyph"===array[i].Type||"Points"===array[i].Type||"Lines"===array[i].Type||"Texture"===array[i].Type)&&count++;return count}return 0},getNumberOfObjectsInRegions=regionJson=>{var counts=regionJson.Primitives?getNumberOfDownloadsInArray(regionJson.Primitives,!1):0;return regionJson.Children&&Object.values(regionJson.Children).forEach(childRegion=>{counts+=getNumberOfObjectsInRegions(childRegion)}),counts},getNumberOfObjects=metadata=>{if(Array.isArray(metadata))return getNumberOfDownloadsInArray(metadata,!0);return"object"==typeof metadata&&null!==metadata&&"2.0"===metadata.Version?getNumberOfObjectsInRegions(metadata.Regions):void 0},readVersionOneRegionPath=(region,referenceURL,item,order,callback)=>{var targetRegion=region;//Render order is set to i * 2 to account for front and back rendering
1309
+ item.RegionPath&&""!==item.RegionPath&&(targetRegion=region.findOrCreateChildFromPath(item.RegionPath)),readPrimitivesItem(targetRegion,referenceURL,item,2*order,callback)},loadVersionOne=(targetRegion,metadata,referenceURL,finishCallback,allCompletedCallback,options)=>{// view file does not receive callback
1301
1310
  // Prioritise the view file and settings before loading anything else
1302
- for(var numberOfObjects=getNumberOfObjects(metadata),callback=new metaFinishCallback(numberOfObjects,finishCallback,allCompletedCallback),i=0;i<metadata.length;i++)readViewAndSettingsItem(referenceURL,metadata[i],callback);for(var _i=0;_i<metadata.length;_i++)readVersionOneRegionPath(targetRegion,referenceURL,metadata[_i],_i,callback)},loadVersionTwo=(targetRegion,metadata,referenceURL,finishCallback,allCompletedCallback)=>{var numberOfObjects=getNumberOfObjects(metadata),callback=new metaFinishCallback(numberOfObjects,finishCallback,allCompletedCallback);// view file does not receive callback
1311
+ for(var filteredMetada=filterMetadataInArray(metadata,options),numberOfObjects=getNumberOfObjects(filteredMetada),callback=new metaFinishCallback(numberOfObjects,finishCallback,allCompletedCallback),i=0;i<metadata.length;i++)readViewAndSettingsItem(referenceURL,filteredMetada[i],callback);for(var _i=0;_i<metadata.length;_i++)readVersionOneRegionPath(targetRegion,referenceURL,filteredMetada[_i],_i,callback)},loadVersionTwo=(targetRegion,metadata,referenceURL,finishCallback,allCompletedCallback)=>{var numberOfObjects=getNumberOfObjects(metadata),callback=new metaFinishCallback(numberOfObjects,finishCallback,allCompletedCallback);// view file does not receive callback
1303
1312
  metadata.Settings&&this.loadSettings(metadata.Settings),metadata.Views&&loadMultipleViews(referenceURL,metadata.Views,referenceURL),metadata.Regions&&loadRegions(targetRegion,referenceURL,metadata.Regions,callback)};/**
1304
1313
  * Load a metadata file from the provided URL into this scene. Once
1305
1314
  * succssful scene proceeds to read each items into scene for visualisations.
1306
1315
  *
1307
- * @param {String} url - Location of the metafile
1316
+ * @param {String} url - Location of the metadata file
1308
1317
  * @param {Function} finishCallback - Callback function which will be called
1318
+ * @param {options} Optional settings, it can be used to ignore some regions/groups
1319
+ * in the metadata file. Only supports version 1 at this moment.
1309
1320
  * for each glyphset and geometry that has been written in.
1310
- */this.loadMetadataURL=(targetRegion,url,finishCallback,allCompletedCallback)=>{var xmlhttp=new XMLHttpRequest,requestURL=resolveURL(url);xmlhttp.onreadystatechange=()=>{if(4==xmlhttp.readyState&&200==xmlhttp.status){scene.resetMetadata(),scene.resetDuration(),viewLoaded=!1;var referenceURL=xmlhttp.responseURL;referenceURL===void 0&&(referenceURL=new URL(requestURL).href);var metadata=JSON.parse(xmlhttp.responseText);Array.isArray(metadata)?loadVersionOne(targetRegion,metadata,referenceURL,finishCallback,allCompletedCallback):"object"==typeof metadata&&null!==metadata&&"2.0"==metadata.Version&&loadVersionTwo(targetRegion,metadata,referenceURL,finishCallback,allCompletedCallback)}},xmlhttp.open("GET",requestURL,!0),xmlhttp.send()}};
1321
+ */this.loadMetadataURL=(targetRegion,url,finishCallback,allCompletedCallback,options)=>{var xmlhttp=new XMLHttpRequest,requestURL=resolveURL(url);xmlhttp.onreadystatechange=()=>{if(4==xmlhttp.readyState&&200==xmlhttp.status){scene.resetMetadata(),scene.resetDuration(),viewLoaded=!1;var referenceURL=xmlhttp.responseURL;referenceURL===void 0&&(referenceURL=new URL(requestURL).href);var metadata=JSON.parse(xmlhttp.responseText);Array.isArray(metadata)?loadVersionOne(targetRegion,metadata,referenceURL,finishCallback,allCompletedCallback,options):"object"==typeof metadata&&null!==metadata&&"2.0"==metadata.Version&&loadVersionTwo(targetRegion,metadata,referenceURL,finishCallback,allCompletedCallback)}},xmlhttp.open("GET",requestURL,!0),xmlhttp.send()}};
1311
1322
 
1312
1323
  /***/ }),
1313
1324
  /* 36 */