zincjs 1.16.1 → 1.16.2

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.16.1","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.16.2","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 */
@@ -982,12 +982,12 @@ function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var
982
982
  direction the slide should be facing.
983
983
  @property {Number} value - Normalised value of the location on direction.
984
984
  @property {String} id - ID of the mesh, it is only available if the settings
985
- is returned from {@link TextureSlides.createSlide} or
985
+ is returned from {@link TextureSlides.createSlide} or
986
986
  {@link TextureSlides.getTextureSettings}.
987
987
  */ /**
988
988
  * Create the slides required for visualisation based on the slide settings.
989
989
  * The slides themselves are {THREE.PlanGeometry} objects.
990
- *
990
+ *
991
991
  * @param {SLIDE_SETTINGS} slideSettings - An array to each slide settings.
992
992
  */this.createSlides=slideSettings=>{slideSettings.forEach(slide=>this.createSlide(slide))};/**
993
993
  * Set the value of the uniforms for a specific mesh in this
@@ -1004,16 +1004,16 @@ var expandBoxWithSettings=(box,settings,vector)=>{if(settings)switch(settings.di
1004
1004
  * Get the bounding box of this slides.
1005
1005
  * It uses the max and min of the slides position and the
1006
1006
  * transformation to calculate the position of the box.
1007
- *
1007
+ *
1008
1008
  * @return {THREE.Box3}.
1009
1009
  */this.getBoundingBox=()=>{if(this.morph&&this.morph.children&&this.morph.visible&&this.boundingBoxUpdateRequired){this.cachedBoundingBox.makeEmpty();var vector=new THREE.Vector3(0,0,0);this.morph.children.forEach(slide=>{expandBoxWithSettings(this.cachedBoundingBox,slide.material.uniforms,vector)}),this.morph.updateMatrixWorld(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1}return this.cachedBoundingBox},this.applyTransformation=(rotation,position,scale)=>{var matrix=new THREE.Matrix4;matrix.set(rotation[0],rotation[1],rotation[2],0,rotation[3],rotation[4],rotation[5],0,rotation[6],rotation[7],rotation[8],0,0,0,0,0);var quaternion=new THREE.Quaternion().setFromRotationMatrix(matrix);this.morph.position.set(...position),this.morph.quaternion.copy(quaternion),this.morph.scale.set(...scale),this.morph.updateMatrix(),this.boundingBoxUpdateRequired=!0},this.setRenderOrder=order=>{//multiilayers
1010
1010
  this.morph.renderOrder=order},this.initialise=(textureData,finishCallback)=>{if(textureData){var locations=textureData.locations;locations&&0<locations.length&&(this.applyTransformation(locations[0].orientation,locations[0].position,locations[0].scale),"flipY"in locations[0]&&(flipY=locations[0].flipY)),this.createSlides(textureData.settings.slides),finishCallback!=null&&"function"==typeof finishCallback&&finishCallback(this)}},this.showEdges=color=>{if(!edgesLine){var geometry=new THREE.BoxGeometry(1,1,1);geometry.translate(.5,.5,.5);var edges=new THREE.EdgesGeometry(geometry);edgesLine=new THREE.LineSegments(edges,new THREE.LineBasicMaterial({color})),this.group.add(edgesLine)}else edgesLine.material.color=color;edgesLine.visible=!0},this.hideEdges=()=>{edgesLine&&(edgesLine.visible=!1)}};/**
1011
1011
  * Provides a class which create a texture stacks in a block
1012
1012
  * with shaders allowing slices of texture to be displayed.
1013
- *
1013
+ *
1014
1014
  * @param {TextureArray} textureIn - An object of texture array
1015
1015
  * holding texture information.
1016
- *
1016
+ *
1017
1017
  * @class
1018
1018
  * @author Alan Wu
1019
1019
  * @return {TextureSlides}
@@ -1031,20 +1031,20 @@ var THREE=__webpack_require__(4),glslVersion=THREE.GLSL3,fs="\nprecision highp f
1031
1031
 
1032
1032
  var THREE=__webpack_require__(4),resolveURL=(__webpack_require__(5).resolveURL),TexturePrimitive=function(textureIn){/**
1033
1033
  * Load texture data into this primitves.
1034
- *
1034
+ *
1035
1035
  * @param {Object} textureData - contains the informations about the textures.
1036
1036
  * @param {Function} finishCallback - User's function to be called once texture's
1037
1037
  * is loaded.
1038
1038
  */ /**
1039
1039
  * Initialise a texture based on the provided textureData, this should be used
1040
1040
  * internally only.
1041
- *
1041
+ *
1042
1042
  * @param {Object} textureData - contains the informations about the textures.
1043
1043
  * @param {Function} finishCallback - User's function to be called once texture's
1044
1044
  * is loaded.
1045
1045
  */(__webpack_require__(10).ZincObject).call(this),this.isTexturePrimitive=!0,this.texture=textureIn,this.load=(textureData,finishCallback)=>{if(textureData&&textureData.images&&textureData.images.source){var texture=new((__webpack_require__(25).TextureArray)),imgArray=[];textureData.images.source.forEach(img=>{imgArray.push(resolveURL(img))});var _this=this;texture.loadFromImages(imgArray).then(()=>{_this.texture=texture,_this.initialise(textureData,finishCallback)})}},this.initialise=(textureData,finishCallback)=>{finishCallback!=null&&"function"==typeof finishCallback&&finishCallback(this)}};/**
1046
1046
  * Provides a base class object which stores textures and rendering object.
1047
- *
1047
+ *
1048
1048
  * @class
1049
1049
  * @author Alan Wu
1050
1050
  * @return {TexturePrimitive}
@@ -1274,7 +1274,7 @@ module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGlu
1274
1274
  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);/**
1275
1275
  * A helper class to help with reading / importing primitives and
1276
1276
  * settings into a {@link Scene}.
1277
- *
1277
+ *
1278
1278
  * @class
1279
1279
  * @param {Object} containerIn - Container to create the renderer on.
1280
1280
  * @author Alan Wu
@@ -1283,7 +1283,7 @@ var THREE=__webpack_require__(4),resolveURL=(__webpack_require__(5).resolveURL),
1283
1283
  * This function returns a three component array, which contains
1284
1284
  * [totalsize, totalLoaded and errorDownload] of all the downloads happening
1285
1285
  * in this scene.
1286
- * @returns {Array}
1286
+ * @returns {Array}
1287
1287
  */this.getDownloadProgress=()=>{var totalSize=0,totalLoaded=0,unknownFound=!1;for(var key in this.progressMap){var progress=this.progressMap[key];totalSize+=progress[1],totalLoaded+=progress[0],0==progress[1]&&(unknownFound=!0)}return unknownFound&&(totalSize=0),[totalSize,totalLoaded,errorDownload]},this.onProgress=id=>xhr=>{this.progressMap[id]=[xhr.loaded,xhr.total]},this.onError=finishCallback=>xhr=>{--this.toBeDownloaded,errorDownload=!0,console.error("There is an issue with external resource ".concat(null!==xhr&&void 0!==xhr&&xhr.responseURL?": "+(null===xhr||void 0===xhr?void 0:xhr.responseURL):"","."));finishCallback&&finishCallback({type:"Error",xhr})};var loadMultipleViews=(referenceURL,views)=>{var defaultView=views.Default;if(views.Inline)scene.setupMultipleViews(defaultView,views.Entries);else{var promises=[],_loop=function _loop(key){referenceURL&&(newURL=createNewURL(value,referenceURL),promises.push(new Promise((resolve,reject)=>{// Add parameters if we are sent them
1288
1288
  fetch(newURL).then(response=>response.json()).then(data=>resolve({key:key,data:data})).catch(data=>reject(data))})))};for(var[key,value]of Object.entries(views.Entries))_loop(key);Promise.all(promises).then(values=>{var entries={};values.forEach(entry=>{entries[entry.key]=entry.data}),scene.setupMultipleViews(defaultView,entries);var zincCameraControls=scene.getZincCameraControls();zincCameraControls&&zincCameraControls.setCurrentViewport(defaultView),viewLoaded=!0})}};/**
1289
1289
  * Load the viewport from an external location provided by the url.
@@ -1291,7 +1291,7 @@ fetch(newURL).then(response=>response.json()).then(data=>resolve({key:key,data:d
1291
1291
  */this.loadViewURL=(url,finishCallback)=>{this.toBeDownloaded+=1;var xmlhttp=new XMLHttpRequest;xmlhttp.onreadystatechange=()=>{if(4==xmlhttp.readyState)if(200==xmlhttp.status){var viewData=JSON.parse(xmlhttp.responseText);scene.setupMultipleViews("default",{default:viewData}),scene.resetView(),viewLoaded=!0,--this.toBeDownloaded,null!=finishCallback&&"function"==typeof finishCallback&&finishCallback()}else this.onError(finishCallback)({responseURL:url})};var requestURL=resolveURL(url);xmlhttp.open("GET",requestURL,!0),xmlhttp.send()},this.loadModelsURL=(region,urls,colours,opacities,timeEnabled,morphColour,finishCallback)=>{var number=urls.length;this.toBeDownloaded+=number;for(var i=0;i<number;i++){var filename=urls[i],colour=(__webpack_require__(0).defaultMaterialColor),opacity=(__webpack_require__(0).defaultOpacity);colours!=null&&colours[i]!=null&&(colour=!!colours[i]),opacities!=null&&opacities[i]!=null&&(opacity=opacities[i]);var localTimeEnabled=0;timeEnabled!=null&&timeEnabled[i]!=null&&(localTimeEnabled=!!timeEnabled[i]);var localMorphColour=0;morphColour!=null&&morphColour[i]!=null&&(localMorphColour=!!morphColour[i]),primitivesLoader.load(resolveURL(filename),meshloader(region,colour,opacity,localTimeEnabled,localMorphColour,void 0,void 0,void 0,void 0,finishCallback),this.onProgress(filename),this.onError(finishCallback))}},this.loadFromViewURL=(targetRegion,jsonFilePrefix,finishCallback)=>{var xmlhttp=new XMLHttpRequest;xmlhttp.onreadystatechange=()=>{if(4==xmlhttp.readyState&&200==xmlhttp.status){var viewData=JSON.parse(xmlhttp.responseText);scene.loadView(viewData);for(var filename,urls=[],filename_prefix=jsonFilePrefix+"_",i=0;i<viewData.numberOfResources;i++)filename=filename_prefix+(i+1)+".json",urls.push(filename);this.loadModelsURL(targetRegion,urls,viewData.colour,viewData.opacity,viewData.timeEnabled,viewData.morphColour,finishCallback)}};var requestURL=resolveURL(jsonFilePrefix+"_view.json");xmlhttp.open("GET",requestURL,!0),xmlhttp.send()};//Internal loader for a regular zinc geometry.
1292
1292
  var linesloader=(region,localTimeEnabled,localMorphColour,groupName,anatomicalId,renderOrder,lod,tubeLines,finishCallback)=>(geometry,materials)=>{var newLines=tubeLines?new((__webpack_require__(39).TubeLines)):new((__webpack_require__(24).Lines)),material=void 0;materials&&materials[0]&&(material=new THREE.LineBasicMaterial({color:materials[0].color.clone()}),1>materials[0].opacity&&(material.transparent=!0),material.opacity=materials[0].opacity,material.morphTargets=localTimeEnabled,material.vertexColors=materials[0].vertexColors);var options={localTimeEnabled:localTimeEnabled,localMorphColour:localMorphColour};if(newLines&&(newLines.createLineSegment(geometry,material,options),newLines.setName(groupName),newLines.setAnatomicalId(anatomicalId),newLines.setRenderOrder(renderOrder),region.addZincObject(newLines),newLines.setDuration(scene.getDuration()),lod&&lod.levels))for(var[key,value]of Object.entries(lod.levels))newLines.addLOD(primitivesLoader,key,value.URL,value.Index,lod.preload);--this.toBeDownloaded,geometry.dispose(),null!=finishCallback&&"function"==typeof finishCallback&&finishCallback(newLines)};/**
1293
1293
  * Load lines into this scene object.
1294
- *
1294
+ *
1295
1295
  * @param {Boolean} timeEnabled - Indicate if morphing is enabled.
1296
1296
  * @param {Boolean} morphColour - Indicate if color morphing is enabled.
1297
1297
  * @param {STRING} groupName - name to assign the pointset's groupname to.
@@ -1301,17 +1301,17 @@ var linesloader=(region,localTimeEnabled,localMorphColour,groupName,anatomicalId
1301
1301
  //Internal loader for zinc pointset.
1302
1302
  /**
1303
1303
  * Read a STL file into this scene, the geometry will be presented as
1304
- * {@link Zinc.Geometry}.
1305
- *
1304
+ * {@link Zinc.Geometry}.
1305
+ *
1306
1306
  * @param {STRING} url - location to the STL file.
1307
1307
  * @param {STRING} groupName - name to assign the geometry's groupname to.
1308
1308
  * @param {Function} finishCallback - Callback function which will be called
1309
1309
  * once the STL geometry is succssfully loaded.
1310
1310
  */this.loadSTL=(region,url,groupName,finishCallback)=>{this.toBeDownloaded+=1;var colour=(__webpack_require__(0).defaultMaterialColor),opacity=(__webpack_require__(0).defaultOpacity),loader=new STLLoader;loader.crossOrigin="Anonymous",loader.load(resolveURL(url),meshloader(region,colour,opacity,!1,!1,groupName,void 0,void 0,void 0,finishCallback))},this.loadOBJ=(region,url,groupName,finishCallback)=>{this.toBeDownloaded+=1;var colour=(__webpack_require__(0).defaultMaterialColor),opacity=(__webpack_require__(0).defaultOpacity),loader=new OBJLoader;loader.crossOrigin="Anonymous",loader.load(resolveURL(url),meshloader(region,colour,opacity,!1,!1,groupName,void 0,void 0,void 0,finishCallback))};/**
1311
- * Load a geometry into this scene, this is a subsequent called from
1311
+ * Load a geometry into this scene, this is a subsequent called from
1312
1312
  * {@link Zinc.Scene#loadMetadataURL}, although it can be used to read
1313
1313
  * in geometry into the scene externally.
1314
- *
1314
+ *
1315
1315
  * @param {String} url - regular json model file providing geometry.
1316
1316
  * @param {Boolean} timeEnabled - Indicate if geometry morphing is enabled.
1317
1317
  * @param {Boolean} morphColour - Indicate if color morphing is enabled.
@@ -1323,22 +1323,22 @@ var linesloader=(region,localTimeEnabled,localMorphColour,groupName,anatomicalId
1323
1323
  //allCompletedCallback is called
1324
1324
  /**
1325
1325
  * Load a pointset into this scene object.
1326
- *
1326
+ *
1327
1327
  * @param {Boolean} timeEnabled - Indicate if morphing is enabled.
1328
1328
  * @param {Boolean} morphColour - Indicate if color morphing is enabled.
1329
1329
  * @param {STRING} groupName - name to assign the pointset's groupname to.
1330
1330
  * @param {Function} finishCallback - Callback function which will be called
1331
1331
  * once the glyphset is succssfully load in.
1332
- */this.loadPointsetURL=(region,url,timeEnabled,morphColour,groupName,finishCallback,options)=>{var localTimeEnabled=0;this.toBeDownloaded+=1,timeEnabled!=null&&(localTimeEnabled=!!timeEnabled);var localMorphColour=0;morphColour!=null&&(localMorphColour=!!morphColour);var isInline=!!(options&&options.isInline)&&options.isInline,anatomicalId=options&&options.anatomicalId?options.anatomicalId:void 0,renderOrder=options&&options.renderOrder?options.renderOrder:void 0;if(isInline){var object=primitivesLoader.parse(url);pointsetloader(region,localTimeEnabled,localMorphColour,groupName,anatomicalId,renderOrder,finishCallback)(object.geometry,object.materials)}else primitivesLoader.load(url,pointsetloader(region,localTimeEnabled,localMorphColour,groupName,anatomicalId,renderOrder,finishCallback),this.onProgress(url),this.onError(finishCallback),options.loaderOptions)};var loadTexture=(region,referenceURL,textureData,groupName,finishCallback,options)=>{var isInline=options&&options.isInline?options.isInline:void 0,anatomicalId=options&&options.anatomicalId?options.anatomicalId:void 0,renderOrder=options&&options.renderOrder?options.renderOrder:void 0,newTexture=void 0;if(textureData){if(referenceURL&&textureData.images&&textureData.images.source)for(var _newURL,source=textureData.images.source,i=0;i<source.length;i++)_newURL=createNewURL(source[i],referenceURL),textureData.images.source[i]=_newURL;if("slides"===textureData.type&&(newTexture=new((__webpack_require__(27).TextureSlides))),newTexture){newTexture.groupName=groupName;var myCallback=()=>{--this.toBeDownloaded,null!=finishCallback&&"function"==typeof finishCallback&&finishCallback(newTexture)};++this.toBeDownloaded,newTexture.load(textureData,myCallback,isInline),newTexture.setAnatomicalId(anatomicalId),newTexture.setRenderOrder(renderOrder),region.addZincObject(newTexture)}}},onLoadTextureReady=(region,xmlhttp,groupName,finishCallback,options)=>()=>{if(4==xmlhttp.readyState&&200==xmlhttp.status){var textureData=JSON.parse(xmlhttp.responseText);loadTexture(region,xmlhttp.responseURL,textureData,groupName,finishCallback,options)}};//Load a glyphset into this scene.
1332
+ */this.loadPointsetURL=(region,url,timeEnabled,morphColour,groupName,finishCallback,options)=>{var localTimeEnabled=0;this.toBeDownloaded+=1,timeEnabled!=null&&(localTimeEnabled=!!timeEnabled);var localMorphColour=0;morphColour!=null&&(localMorphColour=!!morphColour);var isInline=!!(options&&options.isInline)&&options.isInline,anatomicalId=options&&options.anatomicalId?options.anatomicalId:void 0,renderOrder=options&&options.renderOrder?options.renderOrder:void 0;if(isInline){var object=primitivesLoader.parse(url);pointsetloader(region,localTimeEnabled,localMorphColour,groupName,anatomicalId,renderOrder,finishCallback)(object.geometry,object.materials)}else primitivesLoader.load(url,pointsetloader(region,localTimeEnabled,localMorphColour,groupName,anatomicalId,renderOrder,finishCallback),this.onProgress(url),this.onError(finishCallback),options.loaderOptions)};var loadTexture=(region,referenceURL,textureData,groupName,finishCallback,options)=>{var isInline=options&&options.isInline?options.isInline:void 0,anatomicalId=options&&options.anatomicalId?options.anatomicalId:void 0,renderOrder=options&&options.renderOrder?options.renderOrder:void 0,newTexture=void 0;if(textureData){if(referenceURL&&textureData.images&&textureData.images.source)for(var _newURL,source=textureData.images.source,i=0;i<source.length;i++)_newURL=createNewURL(source[i],referenceURL),textureData.images.source[i]=_newURL;if("slides"===textureData.type&&(newTexture=new((__webpack_require__(27).TextureSlides))),newTexture){newTexture.groupName=groupName;var myCallback=()=>{region.addZincObject(newTexture),--this.toBeDownloaded,null!=finishCallback&&"function"==typeof finishCallback&&finishCallback(newTexture)};++this.toBeDownloaded,newTexture.load(textureData,myCallback,isInline),newTexture.setAnatomicalId(anatomicalId),newTexture.setRenderOrder(renderOrder)}}},onLoadTextureReady=(region,xmlhttp,groupName,finishCallback,options)=>()=>{if(4==xmlhttp.readyState&&200==xmlhttp.status){var textureData=JSON.parse(xmlhttp.responseText);loadTexture(region,xmlhttp.responseURL,textureData,groupName,finishCallback,options)}};//Load a glyphset into this scene.
1333
1333
  /**
1334
1334
  * Load a texture into this scene object.
1335
- *
1335
+ *
1336
1336
  * @param {STRING} groupName - name to assign the pointset's groupname to.
1337
1337
  * @param {Function} finishCallback - Callback function which will be called
1338
1338
  * once the glyphset is succssfully load in.
1339
1339
  */this.loadTextureURL=(region,url,groupName,finishCallback,options)=>{var isInline=!!(options&&options.isInline)&&options.isInline;if(isInline)loadTexture(region,void 0,url,groupName,finishCallback,options);else{var xmlhttp=new XMLHttpRequest;xmlhttp.onreadystatechange=onLoadTextureReady(region,xmlhttp,groupName,finishCallback,options),xmlhttp.open("GET",resolveURL(url),!0),xmlhttp.send()}},this.loadGlyphsetURL=(region,metaurl,glyphurl,groupName,finishCallback,options)=>{var isInline=!!(options&&options.isInline)&&options.isInline;if(isInline)loadGlyphset(region,metaurl,glyphurl,groupName,finishCallback,options);else{var xmlhttp=new XMLHttpRequest;xmlhttp.onreadystatechange=onLoadGlyphsetReady(region,xmlhttp,glyphurl,groupName,finishCallback,options),xmlhttp.open("GET",resolveURL(metaurl),!0),xmlhttp.send()}};/**
1340
1340
  * Add a user provided {THREE.Geometry} into the scene as zinc geometry.
1341
- *
1341
+ *
1342
1342
  * @param {Three.Geometry} geometry - The threejs geometry to be added as {@link Zinc.Geometry}.
1343
1343
  * @param {THREE.Color} color - Colour to be assigned to this geometry, overrided if materialIn is provided.
1344
1344
  * @param {Number} opacity - Opacity to be set for this geometry, overrided if materialIn is provided.
@@ -1347,7 +1347,7 @@ var linesloader=(region,localTimeEnabled,localMorphColour,groupName,anatomicalId
1347
1347
  * @param {Boolean} external - Set this to true if morph geometry is present, overrided if materialIn is provided.
1348
1348
  * @param {Function} finishCallback - Callback once the geometry has been added succssfully.
1349
1349
  * @param {THREE.Material} materialIn - Material to be set for this geometry if it is present.
1350
- *
1350
+ *
1351
1351
  * @returns {Zinc.Geometry}
1352
1352
  */var addZincGeometry=(region,geometryIn,colour,opacity,localTimeEnabled,localMorphColour,finishCallback,materialIn,groupName,renderOrder,anatomicalId)=>{var options={colour:colour,opacity:opacity,localTimeEnabled:localTimeEnabled,localMorphColour:localMorphColour},newGeometry=new((__webpack_require__(3).Geometry));return newGeometry.createMesh(geometryIn,materialIn,options),newGeometry.getMorph()?(newGeometry.setName(groupName),newGeometry.setRenderOrder(renderOrder),newGeometry.setAnatomicalId(anatomicalId),region&&region.addZincObject(newGeometry),newGeometry.setDuration(scene.getDuration()),null!=finishCallback&&"function"==typeof finishCallback&&finishCallback(newGeometry),newGeometry.videoHandler&&scene.setVideoHandler(newGeometry.videoHandler),newGeometry):void 0},meshloader=(region,colour,opacity,localTimeEnabled,localMorphColour,groupName,anatomicalId,renderOrder,options,finishCallback)=>(geometry,materials)=>{var material;materials&&materials[0]&&(material=materials[0]);var zincGeometry=addZincGeometry(region,geometry,colour,opacity,localTimeEnabled,localMorphColour,void 0,material,groupName,renderOrder,anatomicalId);if(options.lod&&options.lod.levels)for(var[key,value]of Object.entries(options.lod.levels))zincGeometry.addLOD(primitivesLoader,key,value.URL,value.Index,options.lod.preload);--this.toBeDownloaded,geometry.dispose(),null!=finishCallback&&"function"==typeof finishCallback&&finishCallback(zincGeometry)},parseDuration=durationString=>{var regex=/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,[,years,months,weeks,days,hours,mins,secs]=durationString.match(regex);return{years:years,months:months,weeks:weeks,days:days,hours:hours,mins:mins,secs:secs}};//Internal loader for a regular zinc geometry.
1353
1353
  //Turn ISO 8601 duration string into an array.
@@ -1358,7 +1358,7 @@ if(item.Duration){var duration=parseDuration(item.Duration);scene.setDurationFro
1358
1358
  var readPrimitivesItem=(region,referenceURL,item,order,finishCallback)=>{if(item){var _newURL2=void 0,isInline=!1;item.URL?(_newURL2=item.URL,referenceURL&&(_newURL2=createNewURL(_newURL2,referenceURL))):item.Inline&&(_newURL2=item.Inline.URL,isInline=!0);var lod={};if(item.LOD&&item.LOD.Levels){lod.preload=!!item.LOD.Preload,lod.levels={};for(var[key,value]of Object.entries(item.LOD.Levels))lod.levels[key]={},lod.levels[key].URL=createNewURL(value.URL,referenceURL),lod.levels[key].Index=value.Index}var groupName=item.GroupName;(groupName===void 0||""===groupName)&&(groupName="_Unnamed");var options={loaderOptions:{index:item.Index},isInline:isInline,fileFormat:item.FileFormat,anatomicalId:item.AnatomicalId,compression:item.compression,tubeLines:item.tubeLines,lod:lod,renderOrder:order};switch(item.Type){case"Surfaces":loadSurfaceURL(region,_newURL2,item.MorphVertices,item.MorphColours,groupName,finishCallback,options);break;case"Glyph":var newGeometryURL;isInline?newGeometryURL=item.Inline.GlyphGeometriesURL:(newGeometryURL=item.GlyphGeometriesURL,newGeometryURL=createNewURL(item.GlyphGeometriesURL,referenceURL)),item.DisplayLabels&&(options.displayLabels=!0),this.loadGlyphsetURL(region,_newURL2,newGeometryURL,groupName,finishCallback,options);break;case"Points":this.loadPointsetURL(region,_newURL2,item.MorphVertices,item.MorphColours,groupName,finishCallback,options);break;case"Lines":this.loadLinesURL(region,_newURL2,item.MorphVertices,item.MorphColours,groupName,finishCallback,options);break;case"Texture":this.loadTextureURL(region,_newURL2,groupName,finishCallback,options);break;default:}}},readViewAndSettingsItem=(referenceURL,item,finishCallback)=>{if(item){var _newURL3=void 0,isInline=!1;switch(item.URL?(_newURL3=item.URL,referenceURL&&(_newURL3=createNewURL(item.URL,referenceURL))):item.Inline&&(_newURL3=item.Inline.URL,isInline=!0),item.Type){case"View":isInline?(scene.setupMultipleViews("default",{default:_newURL3}),viewLoaded=!0,null!=finishCallback&&"function"==typeof finishCallback&&finishCallback()):this.loadViewURL(_newURL3,finishCallback);break;case"Settings":this.loadSettings(item);break;default:}}};//Function to read the view item first
1359
1359
  /**
1360
1360
  * Load GLTF into this scene object.
1361
- *
1361
+ *
1362
1362
  * @param {String} url - URL to the GLTF file
1363
1363
  * @param {Function} finishCallback - Callback function which will be called
1364
1364
  * once the glyphset is succssfully load in.
@@ -1369,7 +1369,7 @@ for(var filteredMetada=supplementMetadataInArray(metadata,options),numberOfObjec
1369
1369
  metadata.Settings&&this.loadSettings(metadata.Settings),metadata.Views&&loadMultipleViews(referenceURL,metadata.Views,referenceURL),metadata.Regions&&loadRegions(targetRegion,referenceURL,metadata.Regions,callback)};/**
1370
1370
  * Load a metadata file from the provided URL into this scene. Once
1371
1371
  * succssful scene proceeds to read each items into scene for visualisations.
1372
- *
1372
+ *
1373
1373
  * @param {String} url - Location of the metadata file
1374
1374
  * @param {Function} finishCallback - Callback function which will be called
1375
1375
  * @param {options} Optional settings, it can be used to ignore some regions/groups