(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["Zinc"] = factory(); else root["Zinc"] = factory(); })(this, () => { return /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ([ /* 0 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(1);var PACKAGE=__webpack_require__(2),version=PACKAGE.version,Zinc=function(){this.Revision=version,this.defaultMaterialColor=16777215,this.defaultOpacity=1,this.modelPrefix=void 0,this.Geometry=(__webpack_require__(3).Geometry),this.Glyph=(__webpack_require__(16).Glyph),this.Glyphset=(__webpack_require__(18).Glyphset),this.Pointset=(__webpack_require__(22).Pointset),this.Label=(__webpack_require__(17).Label),this.Lines=(__webpack_require__(24).Lines),this.TextureArray=(__webpack_require__(25).TextureArray),this.TextureSlides=(__webpack_require__(27).TextureSlides),this.Renderer=(__webpack_require__(30).Renderer),this.Scene=(__webpack_require__(32).Scene),this.GeometryCSG=(__webpack_require__(50).GeometryCSG),this.GlyphsetCSG=(__webpack_require__(56).GlyphsetCSG),this.Viewport=(__webpack_require__(43).Viewport),this.CameraControls=(__webpack_require__(43).CameraControls),this.SmoothCameraTransition=(__webpack_require__(43).SmoothCameraTransition),this.RayCaster=(__webpack_require__(43).RayCaster),this.CameraAutoTumble=(__webpack_require__(43).CameraAutoTumble),this.StereoEffect=(__webpack_require__(43).StereoEffect),this.loadExternalFile=(__webpack_require__(5).loadExternalFile),this.loadExternalFiles=(__webpack_require__(5).loadExternalFiles),this.THREE=__webpack_require__(4)};/** * Provides a global namespace for the Zinc javascript library and some default parameters for it. * * @namespace * @author Alan Wu */module.exports=new Zinc; /***/ }), /* 1 */ /***/ ((module) => { "use strict"; module.exports = require("url-polyfill"); /***/ }), /* 2 */ /***/ ((module) => { "use strict"; module.exports = /*#__PURE__*/JSON.parse('{"name":"zincjs","version":"1.11.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 ","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"}}'); /***/ }), /* 3 */ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { var THREE=__webpack_require__(4),toBufferGeometry=(__webpack_require__(5).toBufferGeometry),createMeshForGeometry=(geometryIn,materialIn,options)=>{// First copy the geometry var geometry=toBufferGeometry(geometryIn,options),isTransparent=!1;1>options.opacity&&(isTransparent=!0);var material;if(geometry._video===void 0){var morphTargets=options.localTimeEnabled||options.localMorphColour;materialIn?(material=materialIn,material.morphTargets=morphTargets,material.morphNormals=options.localTimeEnabled):geometry instanceof THREE.BufferGeometry&&geometry.attributes.color===void 0?material=new THREE.MeshPhongMaterial({color:options.colour,morphTargets:morphTargets,morphNormals:options.localTimeEnabled,transparent:isTransparent,opacity:options.opacity,side:THREE.DoubleSide}):material=new THREE.MeshPhongMaterial({color:options.colour,morphTargets:morphTargets,morphNormals:options.localTimeEnabled,vertexColors:THREE.VertexColors,transparent:isTransparent,opacity:options.opacity,side:THREE.DoubleSide}),options.localMorphColour&&geometry.morphAttributes.color&&(material.onBeforeCompile=(__webpack_require__(9).augmentMorphColor)())}else{var videoTexture=geometry._video.createCanvasVideoTexture();material=new THREE.MeshBasicMaterial({morphTargets:options.localTimeEnabled,color:new THREE.Color(1,1,1),transparent:isTransparent,opacity:options.opacity,map:videoTexture,side:THREE.DoubleSide}),this.videoHandler=geometry._video}return new THREE.Mesh(geometry,material)},Geometry=function(){// THREE.Geometry or THREE.BufferGeometry /** * Create the mesh for rendering * * @param {THREE.Geomtry} geometryIn - Geometry to be rendered. * @param {THREE.Material} materialIn - Material to be set for the geometry. * @param {Object} options - Provide various options * @param {THREE.Color} options.colour - colour to be set for the geometry * @param {Boolean} options.localTimeEnabled - A flag to indicate either the geometry is * time dependent. * @param {Boolean} options.localMorphColour - A flag to indicate either the colour is * time dependent. * @param {Number} options.opacity - Opacity to be set for the geometry */ /** * Calculate the UV for texture rendering. */ /** * Handle transparent mesh, create a clone for backside rendering if it is * transparent. */ /** * Set wireframe display for this geometry. * * @param {Boolean} wireframe - Flag to turn on/off wireframe display. */ /** * Edit Vertice in index. */(__webpack_require__(10).ZincObject).call(this),this.videoHandler=void 0,this.isGeometry=!0,this.createMesh=(geometryIn,materialIn,options)=>{//Skip if there is a morph already if(!(this.morph&&this.morph.geometry&&null!=geometryIn)){var mesh=createMeshForGeometry(geometryIn,materialIn,options);this.setMesh(mesh,options.localTimeEnabled,options.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var max=this.geometry.boundingBox.max,min=this.geometry.boundingBox.min,offset=new THREE.Vector2(0-min.x,0-min.y),range=new THREE.Vector2(max.x-min.x,max.y-min.y);this.geometry.faceVertexUvs[0]=[];for(var i=0;i{this.morph.material.wireframe=wireframe},this.editVertices=function(coords,i){if(coords&&coords.length){var mesh=this.getMorph(),attribute=mesh.geometry.getAttribute("position");if(!mesh||0>i)return;var index=3*i;coords.forEach(coord=>{attribute.array[index++]=coord[0],attribute.array[index++]=coord[1],attribute.array[index++]=coord[2]}),attribute.needsUpdate=!0,mesh.geometry.computeBoundingBox(),mesh.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}}};/** * Provides an object which stores geometry and provides method which controls its animations. * This is created when a valid json file containging geometry is read into a {@link Zinc.Scene} * object. * * @class * @author Alan Wu * @return {Geometry} */Geometry.prototype=Object.create((__webpack_require__(10).ZincObject).prototype),exports.Geometry=Geometry; /***/ }), /* 4 */ /***/ ((module) => { "use strict"; module.exports = require("three"); /***/ }), /* 5 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { function _readOnlyError(name){throw new TypeError("\""+name+"\" is read-only")}var THREE=__webpack_require__(4),THREEGeometry=(__webpack_require__(6).Geometry),SpriteText=(__webpack_require__(7)["default"]);function resolveURL(url){var actualURL=url,prefix=(__webpack_require__(0).modelPrefix);if(prefix){"/"!=prefix[prefix.length-1]&&(prefix+"/",_readOnlyError("prefix"));/^(?:[a-z]+:)?\/\//i.test(url)||(actualURL=prefix+url)}return actualURL}function createNewURL(target,reference){var getNewURL=(target,reference)=>{try{var newURL=new URL(target,reference).href;//Make sure the target url does not contain parameters if(target&&2>target.split("?").length){var paramsStrings=reference.split("?");//There are parameters, add them to the target 2===paramsStrings.length&&(newURL=newURL+"?"+paramsStrings[1])}return newURL}catch(_unused){console.error("There is an issue creting the url link with: ".concat(target,"."))}};if(!Array.isArray(target))return getNewURL(target,reference);var urls=[];return target.forEach(url=>{urls.push(getNewURL(url,reference))}),urls}/* * Calculate the bounding box of a mesh, values will be * set for cachedBox, b1, v1 and v2 and they need to be * defined. */function getBoundingBox(mesh,cachedBox,b1,v1,v2){var influences=mesh.morphTargetInfluences,attributes=void 0;mesh.geometry&&(attributes=mesh.geometry.morphAttributes);var found=!1;if(influences&&attributes&&attributes.position){v1.set(0,0,0),v2.set(0,0,0);for(var i=0;i{4==request.readyState&&(200==request.status?callback(request.responseText,data):errorCallback(url))},request.send(null)}function loadExternalFiles(urls,callback,errorCallback){// Callback for a single file function partialCallback(text,urlIndex){result[urlIndex]=text,numComplete++,numComplete==numUrls&&callback(result)}for(var numUrls=urls.length,numComplete=0,result=[],i=0;i{var index_in_colors=Math.floor(index/3),remainder=index%3,hex_value=0;0==remainder?hex_value=colors[index_in_colors].r:1==remainder?hex_value=colors[index_in_colors].g:2==remainder&&(hex_value=colors[index_in_colors].b);var mycolor=new THREE.Color(hex_value);return[mycolor.r,mycolor.g,mycolor.b]},exports.updateMorphColorAttribute=function(targetGeometry,morph){if(morph&&targetGeometry&&targetGeometry.morphAttributes&&targetGeometry.morphAttributes.color){var morphColors=targetGeometry.morphAttributes.color,influences=morph.morphTargetInfluences,length=influences.length;targetGeometry.deleteAttribute("morphColor0"),targetGeometry.deleteAttribute("morphColor1");for(var bound=0,morphArray=[],i=0;1>bound||i{var geometry;return geometryIn instanceof THREEGeometry?(options.localTimeEnabled&&!geometryIn.morphNormalsReady&&(null==geometryIn.morphNormals||0==geometryIn.morphNormals.length)&&geometryIn.computeMorphNormals(),geometry=geometryIn.toIndexedBufferGeometry(),options.localMorphColour&©MorphColorsToIndexedBufferGeometry(geometryIn,geometry)):geometryIn instanceof THREE.BufferGeometry&&(geometry=geometryIn.clone()),geometry.colorsNeedUpdate=!0,geometry.computeBoundingBox(),geometry.computeBoundingSphere(),geometryIn._video&&(geometry._video=geometryIn._video),geometry},exports.copyMorphColorsToBufferGeometry=(geometry,bufferGeometry)=>{if(geometry&&geometry.morphColors&&0{if(geometry&&geometry.morphColors&&0[]))}// convert the error tolerance to an amount of decimal places to truncate to for(var decimalShift=Math.log10(1/tolerance),shiftMultiplier=Math.pow(10,decimalShift),i=0;i=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}/** * Create and return a new buffer geometry with the size of length, * and initial coords. */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.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; /***/ }), /* 6 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Face3: () => (/* binding */ Face3), /* harmony export */ Geometry: () => (/* binding */ Geometry) /* harmony export */ }); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_0__); var _m1=new three__WEBPACK_IMPORTED_MODULE_0__.Matrix4,_obj=new three__WEBPACK_IMPORTED_MODULE_0__.Object3D,_offset=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,_temp=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3;function Geometry(){// update flags this.uuid=three__WEBPACK_IMPORTED_MODULE_0__.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.normals=[],this.uvs=[],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1,this.morphNormalsReady=!1}Geometry.prototype=Object.assign(Object.create(three__WEBPACK_IMPORTED_MODULE_0__.EventDispatcher.prototype),{constructor:Geometry,isGeometry:!0,applyMatrix4:function applyMatrix4(matrix){for(var vertex,normalMatrix=new three__WEBPACK_IMPORTED_MODULE_0__.Matrix3().getNormalMatrix(matrix),i=0,il=this.vertices.length;in;n++)if(indices[n]===indices[(n+1)%3]){faceIndicesToRemove.push(_i11);break}}for(var idx,_i12=faceIndicesToRemove.length-1;0<=_i12;_i12--){idx=faceIndicesToRemove[_i12],this.faces.splice(idx,1);for(var j=0,jl=this.faceVertexUvs.length;j 0 ) { // const colorsArray = new Float32Array( colors.length * 3 ); // buffergeometry.setAttribute( 'color', new BufferAttribute( colorsArray, 3 ).copyColorsArray( colors ) ); // } buffergeometry.setIndex(indices),buffergeometry.groups=this.computeGroups()}// morphs if(0 { "use strict"; module.exports = require("three-spritetext"); /***/ }), /* 8 */ /***/ ((module) => { module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==" /***/ }), /* 9 */ /***/ ((__unused_webpack_module, exports) => { /** * Provide additional shaders to render time dependent color. */exports.augmentMorphColor=function(){return function(shader){shader.vertexShader=shader.vertexShader.replace("#include ",["varying vec3 vColor;","attribute vec3 morphColor0;","attribute vec3 morphColor1;"].join("\n")),shader.vertexShader=shader.vertexShader.replace("#include ",["vColor.xyz = color.xyz;","#ifdef USE_MORPHTARGETS","vColor = morphColor0 * morphTargetInfluences[ 0 ];","vColor += morphColor1 * morphTargetInfluences[ 1 ];","#endif"].join("\n"))}}; /***/ }), /* 10 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var THREE=__webpack_require__(4),createBufferGeometry=(__webpack_require__(5).createBufferGeometry),resolveURL=(__webpack_require__(5).resolveURL),uniqueiId=0,getUniqueId=function(){return"pr"+uniqueiId++},ZincObject=function(){// THREE.Mesh /** * Groupname given to this geometry. */ /** * Total duration of the animation, this value interacts with the * {@link Renderer#playRate} to produce the actual duration of the * animation. Actual time in second = duration / playRate. */ //Draw range is only used by primitives added //programatically with addVertices function this.isZincObject=!0,this.geometry=void 0,this.morph=void 0,this.group=new THREE.Group,this._lod=new((__webpack_require__(11).LOD))(this),this.groupName=void 0,this.timeEnabled=!1,this.morphColour=!1,this.inbuildTime=0,this.mixer=void 0,this.animationGroup=void 0,this.duration=6e3,this.clipAction=void 0,this.userData={},this.videoHandler=void 0,this.marker=void 0,this.markerNumber=void 0,this.markerUpdateRequired=!0,this.closestVertexIndex=-1,this.boundingBoxUpdateRequired=!0,this.cachedBoundingBox=new THREE.Box3,this.anatomicalId=void 0,this.region=void 0,this.animationClip=void 0,this.markerMode="inherited",this.uuid=getUniqueId(),this._v1=new THREE.Vector3,this._v2=new THREE.Vector3,this._b1=new THREE.Box3,this.center=new THREE.Vector3,this.radius=0,this.visible=!0,this.drawRange=-1};/** * Provides the base object for other primitive types. * This class contains multiple base methods. * * @class * @author Alan Wu * @return {ZincObject} */ /** * Set the duration of the animation of this object. * * @param {Number} durationIn - Duration of the animation. */ /** * Get the duration of the animation of this object. * * @return {Number} */ /** * Set the region this object belongs to. * * @param {Region} region */ /** * Get the region this object belongs to. * * @return {Region} */ /** * Get the threejs object3D. * * @return {Object} */ /** * Get the threejs object3D. * * @return {Object} */ /** * Set the internal threejs object3D. */ /** * Handle transparent mesh, create a clone for backside rendering if it is * transparent. */ /** * Set the mesh function for zincObject. * * @param {THREE.Mesh} mesh - Mesh to be set for this zinc object. * @param {Boolean} localTimeEnabled - A flag to indicate either the mesh is * time dependent. * @param {Boolean} localMorphColour - A flag to indicate either the colour is * time dependent. */ /** * Set the name for this ZincObject. * * @param {String} groupNameIn - Name to be set. */ /** * Get the local time of this geometry, it returns a value between * 0 and the duration. * * @return {Number} */ /** * Set the local time of this geometry. * * @param {Number} time - Can be any value between 0 to duration. */ /** * Check if the geometry is time varying. * * @return {Boolean} */ /** * Get the visibility of this Geometry. * */ /** * Set the visibility of this Geometry. * * @param {Boolean} visible - a boolean flag indicate the visibility to be set */ /** * Set the opacity of this Geometry. This function will also set the isTransparent * flag according to the provided alpha value. * * @param {Number} alpah - Alpha value to set for this geometry, * can be any value between from 0 to 1.0. */ /** * The rendering will be culled if it is outside of the frustrum * when this flag is set to true, it should be set to false if * morphing is enabled. * * @param {Boolean} flag - Set frustrum culling on/off based on this flag. */ /** * Set rather a zinc object should be displayed using per vertex colour or * not. * * @param {Boolean} vertexColors - Set display with vertex color on/off. */ /** * Get the colour of the mesh. * * @return {THREE.Color} */ /** * Set the colour of the mesh. * * @param {THREE.Color} colour - Colour to be set for this geometry. */ /** * Get the colour of the mesh in hex string form. * * @return {String} */ /** * Set the colour of the mesh using hex in string form. * * @param {String} hex - The colour value in hex form. */ /** * Set the emissive rgb of the mesh using rgb. * * @param {String} colour - The colour value in rgb form. */ /** * Set the material of the geometry. * * @param {THREE.Material} material - Material to be set for this geometry. */ /** * Get the index of the closest vertex to centroid. * * @return {Number} - integer index in the array */ /** * Get the closest vertex to centroid. * * @return {THREE.Vector3} */ /** * Get the bounding box of this geometry. * * @return {THREE.Box3}. */ /** * Clear this geometry and free the memory. */ /** * Check if marker is enabled based on the objects settings with * the provided scene options. * * @return {Boolean} */ /** * Update the marker's position and size based on current viewport. */ /** * Get the windows coordinates. * * @return {Object} - position and rather the closest vertex is on screen. */ /** * Set marker mode for this zinc object which determine rather the * markers should be displayed or not. * * @param {string} mode - There are three options: * "on" - marker is enabled regardless of settings of scene * "off" - marker is disabled regardless of settings of scene * "inherited" - Marker settings on scene will determine the visibility * of the marker. * * @return {Boolean} */ //Update the geometry and colours depending on the morph. /** * Add lod from an url into the lod object. */ /** * Add lod from an url into the lod object. */ /** * Set the objects position. * * @return {THREE.Box3}. */ /** * Set the objects scale. * * @return {THREE.Box3}. */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 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 this._lod.setFrustumCulled(flag)},ZincObject.prototype.setVertexColors=function(vertexColors){//multilayers - set for all this._lod.setVertexColors(vertexColors)},ZincObject.prototype.getColour=function(){return this._lod._material?this._lod._material.color:void 0},ZincObject.prototype.setColour=function(colour){this._lod.setColour(colour)},ZincObject.prototype.getColourHex=function(){return!this.morphColour&&this._lod._material&&this._lod._material.color?this._lod._material.color.getHexString():void 0},ZincObject.prototype.setColourHex=function(hex){this._lod._material.color.setHex(hex),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(hex)},ZincObject.prototype.setEmissiveRGB=function(colour){this._lod._material&&this._lod._material.emissive&&this._lod._material.emissive.setRGB(...colour),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.emissive.setRGB(...colour)},ZincObject.prototype.setMaterial=function(material){this._lod.setMaterial(material)},ZincObject.prototype.getClosestVertexIndex=function(){var closestIndex=-1,morph=this.getMorph();if(morph&&morph.geoemtry){var position=morph.geometry.attributes.position;if(this._b1.setFromBufferAttribute(position),this._b1.getCenter(this._v1),position)for(var distance=-1,currentDistance=0,i=0;icurrentDistance&&(distance=currentDistance,closestIndex=i)}return closestIndex},ZincObject.prototype.getClosestVertex=function(applyMatrixWorld){var position=new THREE.Vector3;-1==this.closestVertexIndex&&(this.closestVertexIndex=this.getClosestVertexIndex());var morph=this.getMorph();if(morph&&morph.geometry&&0<=this.closestVertexIndex){var influences=morph.morphTargetInfluences,attributes=morph.geometry.morphAttributes;if(influences&&attributes&&attributes.position){for(var found=!1,i=0;iposition.x||1position.y)&&(inView=!1),scene.getZincCameraControls().getRelativeCoordsFromNDC(position.x,position.y,position),{position,inView}}},ZincObject.prototype.setMarkerMode=function(mode,options){mode!==this.markerMode&&(this.markerMode="on"===mode||"off"===mode?mode:"inherited",this.region&&(this.region.pickableUpdateRequired=!0)),options&&(this.markerNumber=options.number,this.markerImgURL=options.imgURL)},ZincObject.prototype.render=function(delta,playAnimation,cameraControls,options){if(this.visible&&!(this.timeEnabled&&playAnimation)&&this._lod.update(cameraControls,this.center),!0==playAnimation){if(this.clipAction&&this.isTimeVarying())this.mixer.update(delta);else{var targetTime=this.inbuildTime+delta;targetTime>this.duration&&(targetTime-=this.duration),this.inbuildTime=targetTime}//multilayers this.visible&&0!=delta&&(this.boundingBoxUpdateRequired=!0,1==this.morphColour&&this._lod.updateMorphColorAttribute(!0))}this.updateMarker(playAnimation,options)},ZincObject.prototype.addLOD=function(loader,level,url,index,preload){this._lod.addLevelFromURL(loader,level,url,index,preload)},ZincObject.prototype.addVertices=function(coords){var mesh=this.getMorph(),geometry=void 0;if(!mesh)geometry=createBufferGeometry(500,coords),this.drawRange=coords.length;else if(-1{positionAttribute.setXYZ(this.drawRange,coord[0],coord[1],coord[2]),++this.drawRange}),positionAttribute.needsUpdate=!0,mesh.geometry.setDrawRange(0,this.drawRange),mesh.geometry.computeBoundingBox(),mesh.geometry.computeBoundingSphere(),geometry=mesh.geoemtry,this.boundingBoxUpdateRequired=!0}return geometry},ZincObject.prototype.setPosition=function(x,y,z){var group=this.getGroup();group&&(group.position.set(x,y,z),group.updateMatrix(),this.boundingBoxUpdateRequired=!0)},ZincObject.prototype.loadAdditionalSources=function(primitivesLoader){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))},ZincObject.prototype.setScaleAll=function(scale){var group=this.getGroup();group&&(group.scale.set(scale,scale,scale),group.updateMatrix(),this.boundingBoxUpdateRequired=!0)},exports.ZincObject=ZincObject; /***/ }), /* 11 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var THREE=__webpack_require__(4),updateMorphColorAttribute=(__webpack_require__(5).updateMorphColorAttribute),toBufferGeometry=(__webpack_require__(5).toBufferGeometry),LOD=function(parent){this.levels=[],this._currentLevel=0,this._renderOrder=1,this._material=void 0,this._secondaryMaterial=void 0,this._loader=void 0,this._parent=parent,this.addLevel=(object,distanceIn)=>{if(object){var l,distance=Math.abs(distanceIn);for(l=0;l{if(object){for(var distance=Math.abs(distanceIn),l=0;l{this._loader=loader;var l,distance=this.calculateDistance(level);for(l=0;l{var level=this.levels[index];return level.morph||level.loaded||level.loading||(level.loading=!0,this._loader.load(level.url,this.lodLoader(level.distance),void 0,void 0,{index:level.index})),void 0===level.morph},this.calculateDistance=function(level){this._parent.getBoundingBox();var radius=this._parent.radius,distance=0;return"far"===level?distance=4.5*radius:"medium"===level?distance=2.5*radius:"close"==level&&(distance=0),distance},this.containsLevels=()=>!!(this.levels&&1{var level=this.levels[this._currentLevel];this._material&&(this._material.transparent?(!this._secondaryMaterial&&(this._secondaryMaterial=this._material.clone(),this._secondaryMaterial.side=THREE.FrontSide),this._secondaryMaterial.opacity=this._material.opacity,this._secondaryMaterial.emissive&&this._secondaryMaterial.emissive.copy(this._material.emissive),this._secondaryMaterial.needsUpdate=!0,!level.secondaryMesh&&(level.secondaryMesh=new THREE.Mesh(level.morph.geometry,this._secondaryMaterial),level.secondaryMesh.renderOrder=level.morph.renderOrder+1,level.secondaryMesh.userData=level.morph.userData,level.secondaryMesh.name=level.morph.name),this._material.side=THREE.BackSide,this._material.needsUpdate=!0,!level.secondaryMesh.parent&&(level.morph.add(level.secondaryMesh),this._parent.animationGroup&&this._parent.animationGroup.add(level.secondaryMesh))):(level.secondaryMesh&&(level.morph.remove(level.secondaryMesh),this._parent.animationGroup&&(this._parent.animationGroup.uncache(level.secondaryMesh),this._parent.animationGroup.remove(level.secondaryMesh))),this._material.side=THREE.DoubleSide,this._material.needsUpdate=!0))},this.dispose=()=>{this.levels.forEach(level=>{level.morph&&level.morph.geometry&&level.morph.geometry.dispose()}),this._material&&this._material.dispose(),this._secondaryMaterial&&this._secondaryMaterial.dispose()},this.getCurrentLevel=()=>this._currentLevel,this.getCurrentMorph=()=>{var level=this.levels[this._currentLevel];return level&&level.morph?level.morph:this._parent.morph},this.lodLoader=function(distance){return geometryIn=>{var material=this._material,options={localTimeEnabled:this._parent.timeEnabled,localMorphColour:this._parent.morphColour},geometry=toBufferGeometry(geometryIn,options),mesh=void 0;this._parent.isGeometry?mesh=new THREE.Mesh(geometry,material):this._parent.isLines&&(mesh=new((__webpack_require__(12).LineSegments))(geometry,material)),mesh.userData=this._parent,mesh.renderOrder=this._renderOrder,geometryIn.dispose(),this.levelLoaded(mesh,distance)}},this.updateMorphColorAttribute=currentOnly=>{//Multilayers - set all if(this._material&&(this._material.vertexColors==THREE.VertexColors||!0==this._material.vertexColors))if(currentOnly){var morph=this.getCurrentMorph();updateMorphColorAttribute(morph.geometry,morph)}else this.levels.forEach(level=>{level.morph&&level.morph.geometry&&updateMorphColorAttribute(level.morph.geometry,level.morph)})},this.setColour=colour=>{this._material.color=colour,this._secondaryMaterial&&(this._secondaryMaterial.color=colour),updateGeometryColour()},this.setFrustumCulled=flag=>{this.levels.forEach(level=>{level.morph&&(level.morph.frustumCulled=flag),level.secondaryMesh&&(level.secondaryMesh.frustumCulled=flag)})},this.setMaterial=material=>{material&&(!this._material||this._material.id!==material.id)&&(this._material=material,this._secondaryMaterial&&this._secondaryMaterial.dispose(),this._secondaryMaterial=material.clone(),this._secondaryMaterial.side=THREE.FrontSide,this._secondaryMaterial.transparent=!0,this.levels.forEach(level=>{level.morph&&(level.morph.material=this._material,level.morph.geometry&&(level.morph.geometry.colorsNeedUpdate=!0)),level.secondaryMesh&&(level.secondaryMesh.material=this._secondaryMaterial)}))},this.setName=name=>{this.levels.forEach(level=>{level.morph&&(level.morph.name=name),level.secondaryMesh&&(level.secondaryMesh.name=name)})},this.setRenderOrder=order=>{this._renderOrder=order,this.levels.forEach(level=>{level.morph&&(level.morph.renderOrder=order),level.secondaryMesh&&(level.secondaryMesh.renderOrder=order)})},this.setVertexColors=vertexColors=>{this._material.vertexColors=vertexColors,updateGeometryColour(),this._secondaryMaterial&&(this._secondaryMaterial.vertexColors=vertexColors)},this.update=(camera,center)=>{var levels=this.levels;if(1=levels[i].distance;i++)levels[i].morph?(-1{this.levels.forEach(level=>{level.morph&&(flag?level.morph.add(marker):level.morph.remove(marker))})};var updateGeometryColour=()=>{this.levels.forEach(level=>{level.morph&&level.morph.geometry&&(level.morph.geometry.colorsNeedUpdate=!0)})}};/** * Provides an object which stores meshes at different levels based * on specified distance. * This object is ued by zincObject to provide mesh at different LODs. * A layer is displayed when the distance from the camera is greater * than its specified distance and closest compared to other layers. * This is intended to be an internal object used only by Zinc Object. * * This object assumes the centroid and bounding box are consistent between * different level of layers. * * @class * @author Alan Wu * @return {LOD} */exports.LOD=LOD; /***/ }), /* 12 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LineSegments: () => (/* binding */ LineSegments) /* harmony export */ }); /* harmony import */ var _Line_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_1__); var _start=/*@__PURE__*/new three__WEBPACK_IMPORTED_MODULE_1__.Vector3,_end=/*@__PURE__*/new three__WEBPACK_IMPORTED_MODULE_1__.Vector3;class LineSegments extends _Line_js__WEBPACK_IMPORTED_MODULE_0__.Line{constructor(geometry,material){super(geometry,material),this.type="LineSegments"}computeLineDistances(){var geometry=this.geometry;if(!geometry.isBufferGeometry)geometry.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else// we assume non-indexed geometry if(null===geometry.index){for(var positionAttribute=geometry.attributes.position,lineDistances=[],i=0,l=positionAttribute.count;i { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Line: () => (/* binding */ Line) /* harmony export */ }); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_0__); var _start=/*@__PURE__*/new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,_end=/*@__PURE__*/new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,_inverseMatrix=/*@__PURE__*/new three__WEBPACK_IMPORTED_MODULE_0__.Matrix4,_ray=/*@__PURE__*/new three__WEBPACK_IMPORTED_MODULE_0__.Ray,_sphere=/*@__PURE__*/new three__WEBPACK_IMPORTED_MODULE_0__.Sphere,_morphA=/*@__PURE__*/new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,_morphB=/*@__PURE__*/new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,_tempA=/*@__PURE__*/new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,_tempB=/*@__PURE__*/new three__WEBPACK_IMPORTED_MODULE_0__.Vector3;class Line extends three__WEBPACK_IMPORTED_MODULE_0__.Object3D{constructor(){var geometry=0localThresholdSq)){interRay.applyMatrix4(this.matrixWorld);//Move back to world space for distance calculation var distance=raycaster.ray.origin.distanceTo(interRay);distanceraycaster.far||intersects.push({distance:distance,// What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point:interSegment.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else for(var _start2=Math.max(0,drawRange.start),_end2=Math.min(positionAttribute.count,drawRange.start+drawRange.count),_i=_start2;_i<_end2-1;_i+=step){calculatePosition(vStart,vEnd,this,positionAttribute,morphPosition,_i,_i+1);var _distSq=_ray.distanceSqToSegment(vStart,vEnd,interRay,interSegment);if(!(_distSq>localThresholdSq)){interRay.applyMatrix4(this.matrixWorld);//Move back to world space for distance calculation var _distance=raycaster.ray.origin.distanceTo(interRay);_distanceraycaster.far||intersects.push({distance:_distance,// What do we want? intersection point on the ray or on the segment?? // point: raycaster.ray.at( distance ), point:interSegment.clone().applyMatrix4(this.matrixWorld),index:_i,face:null,faceIndex:null,object:this})}}}else geometry.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}// }updateMorphTargets(){var geometry=this.geometry;if(geometry.isBufferGeometry){var morphAttributes=geometry.morphAttributes,keys=Object.keys(morphAttributes);if(0 { var THREE=__webpack_require__(4),markerImage=new Image(128,128);markerImage.src=__webpack_require__(15);var texture=new THREE.Texture;texture.image=markerImage,texture.needsUpdate=!0;var size=[.02,.03,1],spriteMaterial=new THREE.SpriteMaterial({map:texture,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),createNewSpriteText=(__webpack_require__(5).createNewSpriteText),Marker=function(zincObject){(__webpack_require__(10).ZincObject).call(this),this.texture=texture;var sprite=void 0,userTexture=void 0,userMaterial=void 0,userSprite=void 0,userUrl=void 0,defaultDisplay=!0;this.morph=new THREE.Group,this.group=this.morph,this.parent=zincObject,this.isMarker=!0;var enabled=!1;this.ndc=new THREE.Vector3;var number=void 0,label=void 0,initialise=()=>{sprite=new THREE.Sprite(spriteMaterial),sprite.center.set(.5,0),this.morph.add(sprite),this.morph.position.set(0,0,0),this.morph.renderOrder=1e4,sprite.scale.set(size[0],size[1],size[2]),sprite.userData=this};/** * Set the position of the marker. * * @param {Number} x - x coordinate to be set. * @param {Number} y - y coordinate to be set. * @param {Number} z - z coordinate to be set. */ /** * Set the size of the marker. * * @param {Number} size - size to be set. */ /** * Clean up this object, */ /** * Set the visibility of this Geometry. * * @param {Boolean} visible - a boolean flag indicate the visibility to be set */ /** * Enable and visualise the marker. */ /** * Disable and hide the marker. */this.updateVisual=(min,max)=>{var scale=1,porportion=0;min!==max&&(porportion=1-(this.ndc.z-min)/(max-min),scale=.6+.4*porportion),this.setSpriteSize(scale)},this.updateNDC=camera=>(this.ndc.copy(this.morph.position),this.ndc.project(camera),this.ndc.z=Math.min(Math.max(this.ndc.z,0),1),this.ndc),this.setPosition=(x,y,z)=>{this.morph.position.set(x,y,z)},this.setSpriteSize=size=>{sprite.scale.set(.015,.02,1),sprite.scale.multiplyScalar(size)},this.setUserSprite=()=>{defaultDisplay&&userSprite&&(this.morph.add(userSprite),this.morph.remove(sprite),label&&this.morph.remove(label),defaultDisplay=!1)},this.setImageForUserSprite=(image,size)=>{userSprite&&(this.morph.remove(userSprite),userSprite.dispose()),userTexture&&userTexture.dispose(),userMaterial&&userMaterial.dispose(),userTexture=new THREE.Texture,userTexture.image=image,userTexture.needsUpdate=!0,userMaterial=new THREE.SpriteMaterial({map:userTexture,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),size||(size=[.05,.05,1]),userSprite=new THREE.Sprite(userMaterial),userSprite.center.set(.5,0),userSprite.scale.set(size[0],size[1],size[2]),userSprite.userData=this,this.setUserSprite()},this.setDefaultSprite=()=>{defaultDisplay||(defaultDisplay=!0,this.morph.add(sprite),userSprite&&this.morph.remove(userSprite),label&&this.morph.add(label))},this.loadUserSprite=(url,size)=>{if(url)if(url!==userUrl){userUrl=url;var userImage=new Image(128,128);userImage.crossOrigin="anonymous",userImage.onload=()=>{this.setImageForUserSprite(userImage,size)},userImage.src=url}else this.setUserSprite()},this.dispose=()=>{this.morph&&this.morph.clear(),sprite&&(sprite.clear(),sprite=void 0),label&&(label.material.map.dispose(),label.material.dispose(),label=void 0)},this.isEnabled=()=>enabled,this.setNumber=numberIn=>{(!numberIn||number!=numberIn)&&label&&(this.morph.remove(label),label.material.map.dispose(),label.material.dispose(),label=void 0),!label&&numberIn&&(label=createNewSpriteText(numberIn,.012,"black","Asap",50,500),this.morph.add(label)),number=numberIn},this.getNumber=()=>number?number:1,this.setVisibility=function(visible){visible!==this.visible&&(this.visible=visible,this.group.visible=visible,this.parent.region&&(this.parent.region.pickableUpdateRequired=!0))},this.enable=()=>{enabled=!0,this.morph.visible=!0,this.visible=!0},this.disable=()=>{enabled=!1,this.morph.visible=!1,this.visible=!1},initialise()};/** * A special graphics type with a tear drop shape. * It is currently used to mark the location of a * {@link zincObject}. * * @class * @author Alan Wu * @return {Marker} */Marker.prototype=Object.create((__webpack_require__(10).ZincObject).prototype),exports.Marker=Marker; /***/ }), /* 15 */ /***/ ((module) => { module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgdmlld0JveD0iMCAwIDM2NSA1NjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCAwKSIgaWQ9IjgwOGVkMjgzLTI1MjQtNDQwZi04OGFlLTNiZGI0N2JiNTc0OSIgID4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4NCjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItMTgyLjUiIHk9Ii0yODAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIC8+DQo8L2c+DQo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+DQo8ZyBzdHlsZT0iIiAgID4NCjwvZz4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCA5Ny41KSIgID4NCjxnIHN0eWxlPSIiICAgPg0KPC9nPg0KPC9nPg0KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC45OSAwIDAgMC45OSAxODIuNSAyODApIiAgPg0KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii01NDAiIHk9Ii01NDAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjEwODAiIGhlaWdodD0iMTA4MCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHBhdGggc3R5bGU9InN0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMCw4OSwxMTYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB0cmFuc2Zvcm09IiB0cmFuc2xhdGUoLTE4Mi45LCAtMjc5Ljg1KSIgZD0iTSAxODIuOSA1NTEuNyBDIDE4Mi45IDU1MS44MDAwMDAwMDAwMDAxIDE4My4xIDU1MiAxODMuMSA1NTIgQyAxODMuMSA1NTIgMzU4LjMgMjgzIDM1OC4zIDE5NC42IEMgMzU4LjMgNjQuNSAyNjkuNSA3LjkwMDAwMDAwMDAwMDAwNiAxODIuOSA3LjY5OTk5OTk5OTk5OTk4OSBDIDk2LjMgNy45IDcuNSA2NC41IDcuNSAxOTQuNiBDIDcuNSAyODMgMTgyLjggNTUyIDE4Mi44IDU1MiBDIDE4Mi44IDU1MiAxODIuOSA1NTEuNyAxODIuOSA1NTEuNyB6IE0gMTIyLjIgMTg3LjIgQyAxMjIuMiAxNTMuNiAxNDkuNCAxMjYuMzk5OTk5OTk5OTk5OTkgMTgzIDEyNi4zOTk5OTk5OTk5OTk5OSBDIDIxNi42IDEyNi4zOTk5OTk5OTk5OTk5OSAyNDMuOCAxNTMuNiAyNDMuOCAxODcuMiBDIDI0My44IDIyMC43OTk5OTk5OTk5OTk5OCAyMTYuNSAyNDggMTgyLjkgMjQ4IEMgMTQ5LjQgMjQ4IDEyMi4yIDIyMC44IDEyMi4yIDE4Ny4yIHoiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPg0KPGNpcmNsZSBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwwLDApOyBzdHJva2Utd2lkdGg6IDA7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtZGFzaG9mZnNldDogMDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDQ7IGZpbGw6IHJnYigyNTUsMjU1LDI1NSk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIGN4PSIwIiBjeT0iMCIgcj0iMzUiIC8+DQo8L2c+DQo8L2c+DQo8L2c+DQo8L3N2Zz4=" /***/ }), /* 16 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { 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;/** * Create a glyph using mesh * @param {THREE.Mesh} meshIn - Mesh to create the glyph from * * @returns {Boolean} true if successful */ /** * Get the {Glyphset} containing this glyph. * * @returns {Boolean} true if successful */ /** * Set and update the text containing this glyph. * @param {String} text - Label to be set for this instance */ /** * Display label with the choosen colour. It will replace the current * label. * @param {THREE.Color} colour - Colour for the label. */ /** * Get the label of this glyph * @return {Label} */ /** * Get the mesh of this glyph. * @return {THREE.Mesh} */ /** * Set the transformation of this glyph. * @param {Array} position - Three components vectors containing position of the * transformation. * @param {Array} axis1 - Three components vectors containing axis1 rotation of the * transformation. * @param {Array} axis2 - Three components vectors containing axis2 rotation of the * transformation. * @param {Array} position - Three components vectors containing axis3 rotation of the * transformation. */ /** * Set the color of the glyph and its label. * * @param {THREE.Color} color - Colour to be set. */ /** * Clear and free its memory. */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}};/** * Zinc representation of glyph graphic, it contains the colours, * geometry and transformation of the glyph. * * @param {THREE.Geometry} geometry - Geometry of the glyph . * @param {THREE.Material} materialIn - Material of the glyph. * @param {Number} idIn - Id of the glyph. * * @class * @author Alan Wu * @return {Glyph} */Glyph.prototype=Object.create((__webpack_require__(10).ZincObject).prototype),exports.Glyph=Glyph; /***/ }), /* 17 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var SpriteText=(__webpack_require__(7)["default"]);/** * Bitmap labels, this is used with {@link Glyph} to * provide labels. * * @param {String} textIn - Text to be displayed dwith the label. * @param {THREE.Color} colour - Colour to be set for the label. * * @class * @author Alan Wu * @return {Label} */exports.Label=function(textIn,colour){var text=textIn,sprite=void 0;/** * Get the current position in an array containing the x, y and z * coordinates. * * @return {Array} */ /** * Set the position of the label in 3D coordinates. * * @param {Number} x - x coordinate to be set. * @param {Number} y - y coordinate to be set. * @param {Number} z - z coordinate to be set. */ /** * Set the colour of the label * * @param {THREE.Color} colour - colour to be set */ /** * Scale the label. * * @param {Number} scaling - Scale to be set. */ /** * Free up the memory */ /** * Get the intrnal sprite. * * @return {THREE.Sprite} */ /** * Get the text. * * @return {String} */sprite=colour?new SpriteText(text,.015,colour.getStyle()):new SpriteText(text,.015),sprite.material.sizeAttenuation=!1,sprite.center.x=-.05,sprite.center.y=0,this.getPosition=()=>sprite?[sprite.position.x,sprite.position.y,sprite.position.z]:[0,0,0],this.setPosition=(x,y,z)=>{sprite&&sprite.position.set(x,y,z)},this.setColour=colour=>{sprite.color=colour.getStyle()},this.setScale=scaling=>{sprite&&0{sprite.dispose()},this.getSprite=()=>sprite,this.getString=()=>text}; /***/ }), /* 18 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { 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;/** * Copy glyphset data into this glyphset then load the glyph's geoemtry * with the provided glyphURL. FinishCallback will be called once * glyph is loaded. * * @param {Array} glyphsetData - contains the informations about the glyphs. * @param {String} glyphURL - URL to the geometry which will be applied to all * all the glyphs in the glyphset once loaded. * @param {Function} finishCallback - User's function to be called once glyph's * geometry is loaded. */this.load=(glyphsetData,glyphURL,finishCallback,isInline,displayLabels)=>{axis1s=glyphsetData.axis1,axis2s=glyphsetData.axis2,axis3s=glyphsetData.axis3,positions=glyphsetData.positions,scales=glyphsetData.scale,colors=glyphsetData.colors,labels=glyphsetData.label,morphColours=glyphsetData.metadata.MorphColours,morphVertices=glyphsetData.metadata.MorphVertices,numberOfTimeSteps=glyphsetData.metadata.number_of_time_steps,repeat_mode=glyphsetData.metadata.repeat_mode,numberOfVertices=glyphsetData.metadata.number_of_vertices,"AXES_2D"==repeat_mode||"MIRROR"==repeat_mode?numberOfVertices*=2:"AXES_3D"==repeat_mode&&(numberOfVertices*=3),baseSize=glyphsetData.metadata.base_size,offset=glyphsetData.metadata.offset,scaleFactors=glyphsetData.metadata.scale_factors;var loader=new JSONLoader;this.geometry=new THREE.BufferGeometry;var instancedMesh=new THREE.InstancedMesh(this.geometry,void 0,numberOfVertices);if(this.setMorph(instancedMesh),isInline){var object=loader.parse(glyphURL);meshloader(finishCallback,displayLabels)(object.geometry,object.materials),object.geometry.dispose()}else loader.crossOrigin="Anonymous",loader.load(glyphURL,meshloader(finishCallback,displayLabels))};/** * Calculate the actual transformation value that can be applied * to the transformation matrix. * * @returns {Array} */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{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{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{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{for(var _i5=0;_i5{if(labels!=null&&displayLabels)for(var glyph,_i6=0;_i6{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(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)};/** * Get the index of the closest vertex to centroid. */ /** * Get the closest vertex to centroid. */ /** * Get the bounding box for the whole set of glyphs. * * @return {Three.Box3}; */ /** * Set the local time of this glyphset. * * @param {Number} time - Can be any value between 0 to duration. */ /** * Check if the glyphset is time varying. * * @return {Boolean} */ /** * Get the current inbuild time of the * * @return {Number} */ /** * Clear this glyphset and its list of glyphs which will release them from the memory. */ /** * Update the glyphsets if required the render. */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;_i8currentDistance&&(distance=currentDistance,closestIndex=_i8)}return closestIndex},this.getClosestVertex=function(){if(-1==this.closestVertexIndex&&(this.closestVertexIndex=this.getClosestVertexIndex()),0<=this.closestVertexIndex&&this.morph)/* if (glyphList && glyphList[this.closestVertexIndex]) { glyphList[this.closestVertexIndex].getBoundingBox().getCenter(position); } */{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{this.inbuildTime=time>this.duration?this.duration:0>time?0:time,(morphColours||morphVertices)&&(updateMorphGlyphsets(),morphVertices&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((!1===this.ready||0this.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)}};/** * This is a container of {@link Glyph} and their graphical properties * including transformations, colors, number of time steps, duration of animations * and group name. Please note that all glyphs in the glyphset share the same geometry * however they may have different transformations. * * @class * @author Alan Wu * @return {Glyphset} */Glyphset.prototype=Object.create((__webpack_require__(10).ZincObject).prototype),exports.Glyphset=Glyphset; /***/ }), /* 19 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ JSONLoader: () => (/* binding */ JSONLoader) /* harmony export */ }); var THREE=__webpack_require__(4),Loader=(__webpack_require__(20).Loader),LoaderUtils=THREE.LoaderUtils,AnimationClip=THREE.AnimationClip,Vector3=THREE.Vector3,Vector4=THREE.Vector4,Color=THREE.Color,Vector2=THREE.Vector2,Face3=(__webpack_require__(6).Face3),Geometry=(__webpack_require__(6).Geometry),FileLoader=THREE.FileLoader,DefaultLoadingManager=THREE.DefaultLoadingManager,VideoHandler=(__webpack_require__(21).VideoHandler);/** * @author mrdoob / http://mrdoob.com/ * @author alteredq / http://alteredqualia.com/ */function JSONLoader(manager){"boolean"==typeof manager&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),manager=void 0),this.manager=manager===void 0?DefaultLoadingManager:manager,this.withCredentials=!1,this.paramsString=""}Object.assign(JSONLoader.prototype,{load:function load(url,onLoad,onProgress,onError){var scope=this,texturePath=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:LoaderUtils.extractUrlBase(url),loader=new FileLoader(this.manager),params=url.split("?");//There are parameters, add them to the target this.paramsString=2===url.length?paramsStrings[1]:"",loader.setWithCredentials(this.withCredentials),loader.load(url,function(text){var json=JSON.parse(text),metadata=json.metadata;if(metadata!==void 0){var type=metadata.type;if(type!==void 0&&"object"===type.toLowerCase())return void console.error("THREE.JSONLoader: "+url+" should be loaded with THREE.ObjectLoader instead.")}if(scope&&scope.parse){var object=scope.parse(json,texturePath);onLoad(object.geometry,object.materials)}},onProgress,onError)},setTexturePath:function setTexturePath(value){this.texturePath=value},parse:function(){function parseModel(json,geometry){function isBitSet(value,position){return value&1<j;j++)uvIndex=faces[offset++],u=uvLayer[2*uvIndex],v=uvLayer[2*uvIndex+1],uv=new Vector2(u,v),2!==j&&geometry.faceVertexUvs[i][fi].push(uv),0!==j&&geometry.faceVertexUvs[i][fi+1].push(uv);if(hasFaceNormal&&(normalIndex=3*faces[offset++],faceA.normal.set(normals[normalIndex++],normals[normalIndex++],normals[normalIndex]),faceB.normal.copy(faceA.normal)),hasFaceVertexNormal)for(i=0;4>i;i++)normalIndex=3*faces[offset++],normal=new Vector3(normals[normalIndex++],normals[normalIndex++],normals[normalIndex]),2!==i&&faceA.vertexNormals.push(normal),0!==i&&faceB.vertexNormals.push(normal);if(hasFaceColor&&(colorIndex=faces[offset++],hex=colors[colorIndex],faceA.color.setHex(hex),faceB.color.setHex(hex)),hasFaceVertexColor)for(i=0;4>i;i++)colorIndex=faces[offset++],hex=colors[colorIndex],2!==i&&faceA.vertexColors.push(new Color(hex)),0!==i&&faceB.vertexColors.push(new Color(hex));geometry.faces.push(faceA),geometry.faces.push(faceB)}else{if(face=new Face3,face.a=faces[offset++],face.b=faces[offset++],face.c=faces[offset++],hasMaterial&&(materialIndex=faces[offset++],face.materialIndex=materialIndex),fi=geometry.faces.length,hasFaceVertexUv)for(i=0;ij;j++)uvIndex=faces[offset++],u=uvLayer[2*uvIndex],v=uvLayer[2*uvIndex+1],uv=new Vector2(u,v),geometry.faceVertexUvs[i][fi].push(uv);if(hasFaceNormal&&(normalIndex=3*faces[offset++],face.normal.set(normals[normalIndex++],normals[normalIndex++],normals[normalIndex])),hasFaceVertexNormal)for(i=0;3>i;i++)normalIndex=3*faces[offset++],normal=new Vector3(normals[normalIndex++],normals[normalIndex++],normals[normalIndex]),face.vertexNormals.push(normal);if(hasFaceColor&&(colorIndex=faces[offset++],face.color.setHex(colors[colorIndex])),hasFaceVertexColor)for(i=0;3>i;i++)colorIndex=faces[offset++],face.vertexColors.push(new Color(colors[colorIndex]));geometry.faces.push(face)}}function parseSkin(json,geometry){var influencesPerVertex=json.influencesPerVertex===void 0?2:json.influencesPerVertex;if(json.skinWeights)for(var i=0,l=json.skinWeights.length;i { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Loader: () => (/* binding */ Loader) /* harmony export */ }); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_0__); var THREE=__webpack_require__(4);/** * @author alteredq / http://alteredqualia.com/ */function Loader(){}Loader.Handlers={handlers:[],add:function add(regex,loader){this.handlers.push(regex,loader)},get:function get(file){for(var handlers=this.handlers,i=0,l=handlers.length;ijson.opacity&&(json.transparent=!0),materialLoader.setTextures(textures),materialLoader.parse(json)}}()}); /***/ }), /* 21 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var THREE=__webpack_require__(4);/** * Provide basic functionality to display video as texture. * VideoTexture is used for creating and updating a video projected onto a Three.js texture * * @class * @param {Object} containerIn - Container to create the renderer on. * @author Alan Wu * @return {VideoHandler} */exports.VideoHandler=function(srcIn){var _this=this;this.video=void 0,this.videoTexture=void 0;var lastPlayPos=0,currentPlayPos=0,bufferingDetected=!1;// videoPlaneLoaded connects the video to the video texture once it has loaded //this should be handle by scene... check the sync at this.setMorphTime=function(time,duration){var actualTime=time/duration*_this.video.duration;_this.video.currentTime=actualTime},this.getVideoDuration=function(){return _this.video.duration},this.createCanvasVideoTexture=function(){return _this.videoTexture=new THREE.VideoTexture(_this.video),_this.videoTexture.minFilter=THREE.LinearFilter,_this.videoTexture.magFilter=THREE.LinearFilter,_this.videoTexture.format=THREE.RGBFormat,_this.video.currentTime=0,_this.videoTexture},this.getCurrentTime=function(duration){return _this.video?duration*(_this.video.currentTime/_this.video.duration):0},this.isReadyToPlay=function(){// video.readyState 3 means we have data to load for the current time and foreseeable future return!!(_this.video&&3<=_this.video.readyState)},function initialise(){document&&(_this.video=document.createElement("video"),_this.video.crossOrigin="anonymous",_this.video.src=srcIn,_this.video.load(),_this.video.loop=!0)}()}; /***/ }), /* 22 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var THREE=__webpack_require__(4),Points=(__webpack_require__(23).Points),toBufferGeometry=(__webpack_require__(5).toBufferGeometry),getCircularTexture=(__webpack_require__(5).getCircularTexture),Label=(__webpack_require__(17).Label),Pointset=function(){(__webpack_require__(10).ZincObject).call(this),this.isPointset=!0;var labelSets=[];/** * Create the pointsets using geometry and material. * * @param {THREE.Geomtry} geometryIn - Geometry of points to be rendered. * @param {THREE.Material} materialIn - Material to be set for the lines. * @param {Object} options - Provide various options * @param {Boolean} options.localTimeEnabled - A flag to indicate either the lines is * time dependent. * @param {Boolean} options.localMorphColour - A flag to indicate either the colour is * time dependent. */this.createMesh=(geometryIn,materialIn,options)=>{if(geometryIn&&materialIn){var geometry=toBufferGeometry(geometryIn,options),texture=getCircularTexture();materialIn.map=texture;var point=new Points(geometry,materialIn);this.setMesh(point,options.localTimeEnabled,options.localMorphColour)}};var addLabel=(index,coord,labelText,colourHex)=>{if(labelText){var colour=new THREE.Color(colourHex),label=new Label(labelText,colour);label.setPosition(coord[0],coord[1],coord[2]);var sprite=label.getSprite();sprite.material.sizeAttenuation=!1,sprite.material.alphaTest=.5,sprite.material.transparent=!0,sprite.material.depthWrite=!1,sprite.material.depthTest=!1,this.group.add(sprite),labelSets[index]=label}};/** * Add points to existing mesh if it exists, otherwise * create a new one and add to it. * @param {Array} coords -An array of three components coordinates. * @param {Array|String} labels - An array of strings, these are only added * if the number of coords equals to the number labels provided. * @param {Number} colour - A hex value of the colour for the points */ /** * Set the size of the points. * * @param {Number} size - size to be set. */ /** * Turn size attenuation on/off based on the flag. * * @param {Boolean} flag - Determin either size attenuation * should be on or off. */ /** * Get vertices at index */ /** * Edit Vertice in index. */ /** * Turn size attenuation on/off based on the flag. * * @param {Boolean} flag - Determin either size attenuation * should be on or off. */this.addPoints=(coords,labels,colour)=>{if(coords&&0{this.morph&&this.morph.material&&(this.morph.material.size=size,this.morph.material.needsUpdate=!0)},this.setSizeAttenuation=flag=>{this.morph&&this.morph.material&&(this.morph.material.sizeAttenuation=flag,this.morph.material.needsUpdate=!0)},this.getVerticesByIndex=function(index){if(0<=index&&this.drawRange>index){var positionAttribute=this.getMorph().geometry.getAttribute("position");return[positionAttribute.getX(index),positionAttribute.getY(index),positionAttribute.getZ(index)]}},this.editVertices=function(coords,i){if(coords&&coords.length){var mesh=this.getMorph(),maxIndex=i+coords.length-1;if(!mesh||0>i||maxIndex>=this.drawRange)return;var positionAttribute=mesh.geometry.getAttribute("position"),index=i;coords.forEach(coord=>{var label=labelSets[index];label&&label.setPosition(coord[0],coord[1],coord[2]),positionAttribute.setXYZ(index++,coord[0],coord[1],coord[2])}),positionAttribute.needsUpdate=!0,this.boundingBoxUpdateRequired=!0}},this.render=(delta,playAnimation,cameraControls,options)=>{this.morph&&cameraControls&&(this.morph.sizePerPixel=cameraControls.pixelHeight),Pointset.prototype.render.call(this,delta,playAnimation,cameraControls,options)}};/** * Provides an object which stores points and provides method which controls its position. * This is created when a valid json file containing point is read into a {@link Zinc.Scene} * object. * * @class * @author Alan Wu * @return {Pointset} */Pointset.prototype=Object.create((__webpack_require__(10).ZincObject).prototype),exports.Pointset=Pointset; /***/ }), /* 23 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Points: () => (/* binding */ Points) /* harmony export */ }); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_0__); var _inverseMatrix=/*@__PURE__*/new three__WEBPACK_IMPORTED_MODULE_0__.Matrix4,_ray=/*@__PURE__*/new three__WEBPACK_IMPORTED_MODULE_0__.Ray,_sphere=/*@__PURE__*/new three__WEBPACK_IMPORTED_MODULE_0__.Sphere,_position=/*@__PURE__*/new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,_morphA=/*@__PURE__*/new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,_tempA=/*@__PURE__*/new three__WEBPACK_IMPORTED_MODULE_0__.Vector3;class Points extends three__WEBPACK_IMPORTED_MODULE_0__.Object3D{constructor(){var geometry=0raycaster.far)return;intersects.push({distance:distance,distanceToRay:Math.sqrt(rayPointDistanceSq),point:intersectPoint,index:index,face:null,object:object})}}function calculatePosition(object,position,morphPosition,a){_position.fromBufferAttribute(position,a);var morphInfluences=object.morphTargetInfluences;if(object.material.morphTargets&&morphPosition&&morphInfluences){_morphA.set(0,0,0);for(var i=0,il=morphPosition.length;i { var THREE=__webpack_require__(4),toBufferGeometry=(__webpack_require__(5).toBufferGeometry),Lines=function(){/** * Create the line segements using geometry and material. * * @param {THREE.Geomtry} geometryIn - Geometry of lines to be rendered. * @param {THREE.Material} materialIn - Material to be set for the lines. * @param {Object} options - Provide various options * @param {Boolean} options.localTimeEnabled - A flag to indicate either the lines is * time dependent. * @param {Boolean} options.localMorphColour - A flag to indicate either the colour is * time dependent. */ /** * Set the width for the lines. * * @param {Number} width - Width of the lines. */ /** * Add new lines to existing lines if it exists, otherwise * create a new one and add to it. * @param {Array} coords -An array of three components coordinates. * @param {Number} colour - A hex value of the colour for the points */(__webpack_require__(10).ZincObject).call(this),this.isLines=!0,this.createLineSegment=(geometryIn,materialIn,options)=>{if(geometryIn&&materialIn){var geometry=toBufferGeometry(geometryIn,options);options.localMorphColour&&geometry.morphAttributes.color&&(materialIn.onBeforeCompile=(__webpack_require__(9).augmentMorphColor)());var line=new((__webpack_require__(12).LineSegments))(geometry,materialIn);this.setMesh(line,options.localTimeEnabled,options.localMorphColour)}},this.setWidth=width=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=width,this.morph.material.needsUpdate=!0)},this.addLines=(coords,colour)=>{if(coords&&0 { function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}var gen=fn.apply(self,args);_next(void 0)})}}var THREE=__webpack_require__(4),TextureArray=function(){var _this=this;/** * Read images from an array containg src locations. * * @async * @param {Array} srcArrays - List of source location of the images. */ /** * Get and create the material containing shaders and the textures. * The texture must be read and ready before calling this function. * * * @param {Object} options - Customise the material with the options object. * @param {String} options.fs - string of the fragment shader used for * visualisation. * @param {String} options.vs - string of the vertex shader used for * visualisation. * @param {Object} options.uniforms - Containing the data to be passed into the shaders. * @param {String} options.glslVersion - Version of glsl used for compile this shader. * */(__webpack_require__(26).Texture).call(this),this.isTextureArray=!0,this.loadFromImages=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(srcArrays){var w=1,h=1,d=0;if(srcArrays&&srcArrays.length){_this.isLoading=!0;var image=new Image;image.crossOrigin="Anonymous";for(var data,canvas=document.createElement("canvas"),length=0,dataStacks=Array(srcArrays.length),i=0;i{fullArray.set(data,length),length+=data.length}),_this.impl=new THREE.DataTexture2DArray(fullArray,w,h,d),_this.size={width:w,height:h,depth:d},_this.isLoading=!1,_this.impl.needsUpdate=!0}});return function(){return _ref.apply(this,arguments)}}(),this.getMaterial=options=>{if(this.impl){var material;if(!options)material=new THREE.MeshBasicMaterial({color:new THREE.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:THREE.DoubleSide});else if(options.vs&&options.fs){var transparent=!0;options.transparent&&(transparent=options.transparent);var side=THREE.FrontSide;options.side&&(side=options.side),material=new THREE.ShaderMaterial({transparent,uniforms:options.uniforms,vertexShader:options.vs,fragmentShader:options.fs,side}),options.glslVersion&&(material.glslVersion=options.glslVersion)}if(material)return material.needsUpdate=!0,material}}};/** * Texture array object for holding array of images into * texures unit that can be used by other texture primitives. * * @class * @author Alan Wu * @return {TextureArray} */TextureArray.prototype=Object.create((__webpack_require__(26).Texture).prototype),exports.TextureArray=TextureArray; /***/ }), /* 26 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}var gen=fn.apply(self,args);_next(void 0)})}}var THREE=__webpack_require__(4),Texture=function(){this.isTexture=!0,this.impl=void 0,this.isLoading=!1,this.size={width:1,height:1,depth:0}};/** * Base texture object for importing images and turning them into * texures unit that can be used by other texture primitives. * * @class * @author Alan Wu * @return {Texture} */ /** * Read an image from src. * * @async * @param {Image} img - An image object. * @param {String} src - Source location of the image. * * @return {Promise} img on resolve. */ /** @typedef IMAGE_UINT8_RETURN @type {Set} @property {Uint8Array} array - Array containing the uint8 image value. @property {Number} width - Phyiscal image width. @property {Number} height - Phyiscal image height. */ /** * Read an image from src and turn it into Uint8Array. * * @async * @param {Image} img - An image object. * @param {String} src - Source location of the image. * @param {Canvas} canvas - Canvas html element used for the conversion. * * @return {IMAGE_UNIT8_RETURN} */ /** * Return true if the texture is ready for consumption. * * @return {Boolean} */ /** * Return true if the texture is ready for consumption, otherwise false. * * @return {Boolean} */Texture.prototype.loadImage=function(img,src){return new Promise((resolve,reject)=>{img.onload=()=>resolve(img),img.onerror=reject,img.src=src})},Texture.prototype.imageToUint8Array=/*#__PURE__*/function(){var _ref=_asyncToGenerator(function*(instance,img,src,canvas){yield instance.loadImage(img,src),canvas.width=img.width,canvas.height=img.height;var ctx=canvas.getContext("2d");return ctx.drawImage(img,0,0),{array:new Uint8Array(ctx.getImageData(0,0,canvas.width,canvas.height).data.buffer),width:canvas.width,height:canvas.height}});return function(){return _ref.apply(this,arguments)}}(),Texture.prototype.loadFromImages=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(function*(){});return function(){return _ref2.apply(this,arguments)}}(),Texture.prototype.isReady=function(){return!(!this.impl||this.isLoading)},Texture.prototype.getMaterial=function(){if(this.impl)return new THREE.MeshBasicMaterial({color:new THREE.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:THREE.DoubleSide})},exports.Texture=Texture; /***/ }), /* 27 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var t,r=1;r{slideSettings.forEach(slide=>this.createSlide(slide))};/** * Set the value of the uniforms for a specific mesh in this * texture slide object. * * @param {THREE.Mesh} mesh - Mesh to be modified * @param {SLIDE_SETTINGS} slideSettings - Slide settings. */var setUniformSlideSettingsOfMesh=(mesh,settings)=>{var material=mesh.material,uniforms=material.uniforms;switch(mesh.rotation.x=0,mesh.rotation.y=0,mesh.rotation.z=0,mesh.position.x=0,mesh.position.y=0,mesh.position.z=0,settings.direction){case"x":var rotation=flipY?-Math.PI/2:Math.PI/2;mesh.rotation.y=rotation,uniforms.direction.value=1,uniforms.slide.value.set(settings.value,0,0),mesh.position.x=settings.value;break;case"y":mesh.rotation.x=Math.PI/2,uniforms.direction.value=2,uniforms.slide.value.set(0,settings.value,0),mesh.position.y=settings.value;break;case"z":uniforms.direction.value=3,uniforms.slide.value.set(0,0,settings.value),mesh.position.z=settings.value;break;default:}material.needsUpdate=!0,this.boundingBoxUpdateRequired=!0};/** * Modify the mesh based on a setting * * @param {SLIDE_SETTINGS} settings - s. */this.modifySlideSettings=settings=>{settings&&settings.id&&settings.id in idTextureMap&&idTextureMap[settings.id]&&setUniformSlideSettingsOfMesh(idTextureMap[settings.id],settings)},this.createSlide=settings=>{if(this.texture&&this.texture.isTextureArray&&this.texture.isReady()&&settings&&settings.direction&&void 0!==settings.value){var geometry=new THREE.PlaneGeometry(1,1);geometry.translate(.5,.5,0);var uniforms=shader.getUniforms();uniforms.diffuse.value=this.texture.impl,uniforms.depth.value=this.texture.size.depth,uniforms.flipY.value=flipY;var options={fs:shader.fs,vs:shader.vs,uniforms:uniforms,glslVersion:shader.glslVersion,side:THREE.DoubleSide,transparent:!1},material=this.texture.getMaterial(options);material.needsUpdate=!0;var mesh=new THREE.Mesh(geometry,material);mesh.name=this.groupName,mesh.userData=this;var slideSettings={value:settings.value,direction:settings.direction,id:mesh.id};return textureSettings.push(slideSettings),setUniformSlideSettingsOfMesh(mesh,slideSettings),idTextureMap[mesh.id]=mesh,this.morph.add(mesh),this.boundingBoxUpdateRequired=!0,slideSettings}},this.getTextureSettings=()=>[...textureSettings],this.getTextureSettingsWithId=id=>{for(var i=0;ithis.morph?[...this.morph.children]:[],this.removeSlide=slide=>{slide&&this.removeSlideWithId(slide.id)},this.removeSlideWithId=id=>{if(this.morph&&id in idTextureMap&&idTextureMap[id]){if(this.morph.getObjectById(id)){var slide=idTextureMap[id];this.morph.remove(slide),slide.clear(),slide.geometry&&slide.geometry.dispose(),slide.material&&slide.material.dispose(),this.boundingBoxUpdateRequired=!0}var index=textureSettings.findIndex(item=>item.id===id);-1{this.morph.children.forEach(slide=>{slide.geometry&&slide.geometry.dispose(),slide.material&&slide.material.dispose()}),(__webpack_require__(29).TexturePrimitive).prototype.dispose.call(this),this.boundingBoxUpdateRequired=!0};//Expand the boundingbox with slide settings var expandBoxWithSettings=(box,settings,vector)=>{switch(settings.direction.value){case 1:vector.copy(settings.slide.value),box.expandByPoint(vector),vector.setY(1),vector.setZ(1),box.expandByPoint(vector);break;case 2:vector.copy(settings.slide.value),box.expandByPoint(vector),vector.setX(1),vector.setZ(1),box.expandByPoint(vector);break;case 3:vector.copy(settings.slide.value),box.expandByPoint(vector),vector.setX(1),vector.setY(1),box.expandByPoint(vector);break;default:}};/** * Get the bounding box of this slides. * It uses the max and min of the slides position and the * transformation to calculate the position of the box. * * @return {THREE.Box3}. */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.initialise=(textureData,finishCallback)=>{if(textureData){var locations=textureData.locations;locations&&0 { var THREE=__webpack_require__(4),glslVersion=THREE.GLSL3,fs="\nprecision highp float;\nprecision highp int;\nprecision highp sampler2DArray;\n\nuniform sampler2DArray diffuse;\nin vec3 vUw;\n\nout vec4 outColor;\n\nvoid main() {\n\n vec4 color = texture( diffuse, vUw );\n\n // lighten a bit\n outColor = vec4( color.rgb + .2, 1.0 );\n\n}\n",vs="\nout vec3 vUw;\nuniform float depth;\nuniform vec3 slide;\nuniform int direction;\nuniform bool flipY;\n\nvoid main() {\n\n vec3 slidePos = position.xyz;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position.xyz, 1.0 );\n\n if (direction == 1)\n slidePos = vec3(slide.x, position.y, position.x);\n if (direction == 2)\n slidePos = vec3(position.x, slide.y, position.y);\n if (direction == 3)\n slidePos = vec3(position.x, position.y, slide.z);\n\n if (flipY) \n slidePos.y = 1.0 - slidePos.y;\n\n vUw.xyz = vec3(slidePos.x, slidePos.y, slidePos.z * depth);\n\n}\n",getUniforms=function(){return{diffuse:{value:void 0},depth:{value:1},slide:{value:new THREE.Vector3(0,0,1)},direction:{value:1},flipY:{value:!0}}};exports.fs=fs,exports.vs=vs,exports.glslVersion=glslVersion,exports.getUniforms=getUniforms; /***/ }), /* 29 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var THREE=__webpack_require__(4),resolveURL=(__webpack_require__(5).resolveURL),TexturePrimitive=function(textureIn){/** * Load texture data into this primitves. * * @param {Object} textureData - contains the informations about the textures. * @param {Function} finishCallback - User's function to be called once texture's * is loaded. */ /** * Initialise a texture based on the provided textureData, this should be used * internally only. * * @param {Object} textureData - contains the informations about the textures. * @param {Function} finishCallback - User's function to be called once texture's * is loaded. */(__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)}};/** * Provides a base class object which stores textures and rendering object. * * @class * @author Alan Wu * @return {TexturePrimitive} */TexturePrimitive.prototype=Object.create((__webpack_require__(10).ZincObject).prototype),TexturePrimitive.prototype.constructor=TexturePrimitive,exports.TexturePrimitive=TexturePrimitive; /***/ }), /* 30 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var THREE=__webpack_require__(4),ResizeSensor=__webpack_require__(31);/** * Create a Zinc 3D renderer in the container provided. * The primary function of a Zinc 3D renderer is to display the current * scene (@link Scene} set to the renderer and each scene may contain as * many geometries, glyphset and other primitives as the system can support. * Zinc.Renderer also allows additional scenes to be displayed. * * @param {Object} containerIn - Container to create the renderer on. * @class * @author Alan Wu * @return {Renderer} */exports.Renderer=function(containerIn){var container=containerIn,renderer=void 0,currentScene=void 0,clock=new THREE.Clock(!1);//myGezincGeometriestains a tuple of the threejs mesh, timeEnabled, morphColour flag, unique id and morph this.playAnimation=!0;/* default animation update rate, rate is 1000 and duration is default to 6000, 6s to finish a full animation */var playRate=1e3,preRenderCallbackFunctions=[],preRenderCallbackFunctions_id=0,postRenderCallbackFunctions=[],postRenderCallbackFunctions_id=0,animated_id=void 0,cameraOrtho=void 0,sceneOrtho=void 0,logoSprite=void 0,sceneMap=[],additionalActiveScenes=[],scenesGroup=new THREE.Group,canvas=void 0,sensor=void 0,isRendering=!1,currentSize=[0,0],currentOffset=[0,0];this.getDrawingWidth=()=>{if(container)return container.clientWidth;return canvas?"undefined"==typeof canvas.clientWidth?Math.round(canvas.width):Math.round(canvas.clientWidth):0},this.getDrawingHeight=()=>{if(container)return container.clientHeight;return canvas?"undefined"==typeof canvas.clientHeight?Math.round(canvas.height):Math.round(canvas.clientHeight):0},this.onWindowResize=()=>{currentScene.onWindowResize();var width=this.getDrawingWidth(),height=this.getDrawingHeight();if(renderer!=null){var localRect;container?(localRect=container.getBoundingClientRect(),renderer.setSize(width,height)):canvas&&("undefined"==typeof canvas.getBoundingClientRect?renderer.setSize(width,height,!1):(localRect=canvas.getBoundingClientRect(),canvas.width=width,canvas.height=height,renderer.setSize(width,height,!1))),localRect&&(currentOffset[0]=localRect.left,currentOffset[1]=localRect.top);var target=new THREE.Vector2;renderer.getSize(target),currentSize[0]=target.x,currentSize[1]=target.y}},this.initialiseVisualisation=parameters=>{if(parameters=parameters||{},void 0===parameters.antialias){var onMobile=!1;try{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(onMobile=!0)}catch(err){onMobile=!1}parameters.antialias=!onMobile}parameters.canvas&&(container=void 0,canvas=parameters.canvas),renderer=new THREE.WebGLRenderer(parameters),void 0!==container&&container.appendChild(renderer.domElement),renderer.setClearColor(16777215,1),canvas&&canvas.style&&(canvas.style.height="100%",canvas.style.width="100%"),renderer.autoClear=!1;var scene=this.createScene("default");this.setCurrentScene(scene)},this.getCurrentScene=()=>currentScene,this.setCurrentScene=sceneIn=>{if(sceneIn){this.removeActiveScene(sceneIn);var oldScene=currentScene;currentScene=sceneIn,oldScene&&oldScene.setInteractiveControlEnable(!1),currentScene.setInteractiveControlEnable(!0),currentScene.setAdditionalScenesGroup(scenesGroup),this.onWindowResize()}},this.getSceneByName=name=>sceneMap[name],this.createScene=name=>{if(null==sceneMap[name]){var new_scene;return new_scene=canvas?new((__webpack_require__(32).Scene))(canvas,renderer):new((__webpack_require__(32).Scene))(container,renderer),sceneMap[name]=new_scene,new_scene.sceneName=name,new_scene}};/** * Reset the viewport of the current scene to its original state. */this.resetView=()=>{currentScene.resetView()},this.viewAll=()=>{if(currentScene){var boundingBox=currentScene.getBoundingBox();if(boundingBox){for(var boundingBox2,i=0;i{currentScene.loadModelsURL(urls,colours,opacities,timeEnabled,morphColour,finishCallback)};/** * Load the viewport from an external location provided by the url. This should be * called from {@link Zinc.Scene}; * @param {String} URL - address to the file containing viewport information. * @deprecated */this.loadViewURL=url=>{currentScene.loadViewURL(url)},this.loadFromViewURL=(jsonFilePrefix,finishCallback)=>{currentScene.loadFromViewURL(jsonFilePrefix,finishCallback)},this.updateDirectionalLight=()=>{currentScene.updateDirectionalLight()};var runAnimation=()=>{isRendering?(animated_id=requestAnimationFrame(runAnimation),this.render()):(cancelAnimationFrame(animated_id),animated_id=void 0)};/** * Stop the animation and renderer to get into the render loop. */this.stopAnimate=()=>{isRendering&&(clock.stop(),isRendering=!1)},this.animate=()=>{isRendering||(clock.start(),isRendering=!0,runAnimation())};Date.now();/** * Add a callback function which will be called everytime before the renderer renders its scene. * @param {Function} callbackFunction - callbackFunction to be added. * * @return {Number} */this.addPreRenderCallbackFunction=callbackFunction=>(++preRenderCallbackFunctions_id,preRenderCallbackFunctions[preRenderCallbackFunctions_id]=callbackFunction,preRenderCallbackFunctions_id),this.removePreRenderCallbackFunction=id=>{id in preRenderCallbackFunctions&&delete preRenderCallbackFunctions[id]},this.addPostRenderCallbackFunction=callbackFunction=>(++postRenderCallbackFunctions_id,postRenderCallbackFunctions[postRenderCallbackFunctions_id]=callbackFunction,postRenderCallbackFunctions_id),this.removePostRenderCallbackFunction=id=>{id in postRenderCallbackFunctions&&delete postRenderCallbackFunctions[id]},this.getPlayRate=()=>playRate,this.setPlayRate=playRateIn=>{playRate=playRateIn},this.getCurrentTime=()=>currentScene.getCurrentTime(),this.setMorphsTime=time=>{currentScene.setMorphsTime(time)},this.getZincGeometryByID=id=>currentScene.getZincGeometryByID(id),this.addToScene=object=>{currentScene.addObject(object)},this.addToOrthoScene=object=>{if(null==sceneOrtho&&(sceneOrtho=new THREE.Scene),null==cameraOrtho){var width=this.getDrawingWidth(),height=this.getDrawingHeight();cameraOrtho=new THREE.OrthographicCamera(-width/2,width/2,height/2,-height/2,1,10),cameraOrtho.position.z=10}sceneOrtho.add(object)};var createHUDSprites=logoSprite=>texture=>{texture.needsUpdate=!0;var material=new THREE.SpriteMaterial({map:texture}),imagewidth=material.map.image.width,imageheight=material.map.image.height;logoSprite.material=material,logoSprite.scale.set(imagewidth,imageheight,1);var width=this.getDrawingWidth(),height=this.getDrawingHeight();logoSprite.position.set((width-imagewidth)/2,(-height+imageheight)/2,1),this.addToOrthoScene(logoSprite)};/** * Render the current and all additional scenes. It will first update all geometries and glyphsets * in scenes, clear depth buffer and render the ortho scene, call the preRenderCallbackFunctions stack * , render the scenes then postRenderCallback. */ /** * Get the internal {@link Three.Renderer}, to gain access to ThreeJS APIs. */ /** * Check if a scene is currently active. * @param {Zinc.Scene} sceneIn - Scene to check if it is currently * rendered. */ /** * Add additional active scene for rendering, this scene will also be rendered but * viewport of the currentScene will be used. * @param {Zinc.Scene} additionalScene - Scene to be added to the rendering. */ /** * Remove a currenrtly active scene from the renderer, this scene will also be rendered but * viewport of the currentScene will be used. * @param {Zinc.Scene} additionalScene - Scene to be removed from rendering. */ /** * Clear all additional scenes from rendering except for curentScene. */ /** * Dispose all memory allocated, this will effetively destroy all scenes. */ /** * Transition from the current viewport to the endingScene's viewport in the specified duration. * * @param {Zinc.Scene} endingScene - Viewport of this scene will be used as the destination. * @param {Number} duration - Amount of time to transition from current viewport to the * endingScene's viewport. */this.addLogo=()=>{logoSprite=new THREE.Sprite;THREE.ImageUtils.loadTexture("images/abi_big_logo_transparent_small.png",void 0,createHUDSprites(logoSprite))},this.render=()=>{sensor||(container?0renderer,this.isSceneActive=sceneIn=>{if(currentScene===sceneIn)return!0;for(var sceneItem,i=0;i{this.isSceneActive(additionalScene)||(additionalActiveScenes.push(additionalScene),scenesGroup.add(additionalScene.getThreeJSScene()))},this.removeActiveScene=additionalScene=>{for(var sceneItem,i=0;i{for(var i=0;i{for(var key in isRendering&&cancelAnimationFrame(animated_id),sceneMap)sceneMap.hasOwnProperty(key)&&sceneMap[key].clearAll();sceneMap=[],additionalActiveScenes=[],scenesGroup=new THREE.Group,this.stopAnimate(),preRenderCallbackFunctions=[],preRenderCallbackFunctions_id=0,cameraOrtho=void 0,sceneOrtho=void 0,logoSprite=void 0;var scene=this.createScene("default");this.setCurrentScene(scene),sensor=void 0},this.transitionScene=(endingScene,duration)=>{if(currentScene){var currentCamera=currentScene.getZincCameraControls(),boundingBox=endingScene.getBoundingBox();if(boundingBox){var radius=boundingBox.min.distanceTo(boundingBox.max)/2,centreX=(boundingBox.min.x+boundingBox.max.x)/2,centreY=(boundingBox.min.y+boundingBox.max.y)/2,centreZ=(boundingBox.min.z+boundingBox.max.z)/2,endingViewport=currentCamera.getViewportFromCentreAndRadius(centreX,centreY,centreZ,radius,40,radius*4),startingViewport=currentCamera.getCurrentViewport();currentCamera.cameraTransition(startingViewport,endingViewport,duration),currentCamera.enableCameraTransition()}}},this.isWebGL2=()=>!!renderer&&renderer.capabilities.isWebGL2}; /***/ }), /* 31 */ /***/ ((module) => { "use strict"; module.exports = require("css-element-queries/src/ResizeSensor"); /***/ }), /* 32 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var THREE=__webpack_require__(4),MarkerCluster=(__webpack_require__(33).MarkerCluster),SceneLoader=(__webpack_require__(35).SceneLoader),SceneExporter=(__webpack_require__(41).SceneExporter),Viewport=(__webpack_require__(43).Viewport),createBufferGeometry=(__webpack_require__(5).createBufferGeometry),getCircularTexture=(__webpack_require__(5).getCircularTexture),uniqueiId=0,getUniqueId=function(){return"sc"+uniqueiId++},defaultMetadata=function(){return{Duration:"6 secs",OriginalDuration:"-",TimeStamps:{}}},defaultDuration=6e3;/** * A Scene contains {@link Region},and * {@link CameraControls} which controls the viewport and additional features. * It is the main object used for controlling what is and what is not displayed * on the renderer. * * @class * @param {Object} containerIn - Container to create the renderer on. * @author Alan Wu * @return {Scene} */exports.Scene=function(containerIn,rendererIn){var _this=this,container=containerIn,videoHandler=void 0,sceneLoader=new SceneLoader(this),minimap=void 0,zincObjectAddedCallbacks={},zincObjectAddedCallbacks_id=0,zincObjectRemovedCallbacks={},zincObjectRemovedCallbacks_id=0,scene=new THREE.Scene,rootRegion=new((__webpack_require__(44).Region))(void 0,this);scene.add(rootRegion.getGroup());var tempGroup=new THREE.Group;scene.add(tempGroup),this.directionalLight=void 0,this.ambient=void 0,this.camera=void 0;var duration=6e3,zincCameraControls=void 0;this.sceneName=void 0;var stereoEffectFlag=!1,stereoEffect=void 0;this.autoClearFlag=!0,this.displayMarkers=!1,this.displayMinimap=!1,this.minimapScissor={x_offset:16,y_offset:16,width:128,height:128,align:"top-left",updateRequired:!0};var scissor={x:0,y:0},metadata=defaultMetadata(),_markerTarget=new THREE.Vector2,pickableObjectsList=[];this.forcePickableObjectsUpdate=!1,this.uuid=getUniqueId();var markerCluster=new MarkerCluster(this);markerCluster.disable(),scene.add(markerCluster.group);var getDrawingWidth=()=>container?"undefined"==typeof container.clientWidth?container.width:container.clientWidth:0,getDrawingHeight=()=>container?"undefined"==typeof container.clientHeight?container.height:container.clientHeight:0;/** * This function returns a three component array, which contains * [totalsize, totalLoaded and errorDownload] of all the downloads happening * in this scene. * @returns {Array} */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 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{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{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 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))};/** * Render the scene. * @private */this.render=renderer=>{this.autoClearFlag&&renderer.clear(),stereoEffectFlag&&stereoEffect?stereoEffect.render(scene,this.camera):(renderer.render(scene,this.camera),renderMinimap(renderer))},this.setInteractiveControlEnable=flag=>{!0==flag?zincCameraControls.enable():zincCameraControls.disable()},this.getZincCameraControls=()=>zincCameraControls,this.getThreeJSScene=()=>scene,this.setDuration=durationIn=>{rootRegion.setDuration(durationIn),duration=durationIn,zincCameraControls.setPathDuration(durationIn),sceneLoader.duration=durationIn},this.getDuration=()=>duration,this.setStereoEffectEnable=stereoFlag=>{!0!=stereoFlag||stereoEffect||(stereoEffect=new __webpack_require__(43).StereoEffect(rendererIn)),rendererIn.setSize(getDrawingWidth(),getDrawingHeight()),this.camera.updateProjectionMatrix(),stereoEffectFlag=stereoFlag},this.objectIsInScene=zincObject=>rootRegion.objectIsInRegion(zincObject,!0),this.alignBoundingBoxToCameraView=(boundingBox,transitionTime)=>{if(boundingBox){var center=new THREE.Vector3;boundingBox.getCenter(center);var viewport=this.getZincCameraControls().getCurrentViewport(),target=new THREE.Vector3(viewport.targetPosition[0],viewport.targetPosition[1],viewport.targetPosition[2]),eyePosition=new THREE.Vector3(viewport.eyePosition[0],viewport.eyePosition[1],viewport.eyePosition[2]),newVec1=new THREE.Vector3,newVec2=new THREE.Vector3;newVec1.subVectors(target,eyePosition).normalize(),newVec2.subVectors(target,center).normalize();var newVec3=new THREE.Vector3;newVec3.crossVectors(newVec1,newVec2);var angle=newVec1.angleTo(newVec2);0{if(boundingBox){var oldViewport=this.getZincCameraControls().getCurrentViewport(),viewport=this.getZincCameraControls().getViewportFromBoundingBox(boundingBox,scaleRadius);0{if(this.objectIsInScene(zincObject)){var boundingBox=zincObject.getBoundingBox();this.alignBoundingBoxToCameraView(boundingBox,transitionTime)}},this.setCameraTargetToObject=zincObject=>{if(this.objectIsInScene(zincObject)){var center=new THREE.Vector3,boundingBox=zincObject.getBoundingBox(),viewport=this.getZincCameraControls().getCurrentViewport();boundingBox.getCenter(center);var target=new THREE.Vector3(viewport.targetPosition[0],viewport.targetPosition[1],viewport.targetPosition[2]),eyePosition=new THREE.Vector3(viewport.eyePosition[0],viewport.eyePosition[1],viewport.eyePosition[2]),newVec1=new THREE.Vector3,newVec2=new THREE.Vector3;newVec1.subVectors(eyePosition,target),newVec2.addVectors(center,newVec1),viewport.eyePosition[0]=newVec2.x,viewport.eyePosition[1]=newVec2.y,viewport.eyePosition[2]=newVec2.z,viewport.targetPosition[0]=center.x,viewport.targetPosition[1]=center.y,viewport.targetPosition[2]=center.z,this.getZincCameraControls().setCurrentCameraSettings(viewport),markerCluster.markerUpdateRequired=!0}},this.isStereoEffectEnable=()=>stereoEffectFlag,this.removeZincObject=zincObject=>{rootRegion.removeZincObject(zincObject),zincCameraControls&&zincCameraControls.calculateMaxAllowedDistance(this),markerCluster.markerUpdateRequired=!0},this.updatePickableThreeJSObjects=()=>{pickableObjectsList.length=0,markerCluster.isEnabled&&pickableObjectsList.push(markerCluster.group),rootRegion.getPickableThreeJSObjects(pickableObjectsList,!0),this.forcePickableObjectsUpdate=!1},this.getPickableThreeJSObjects=()=>((this.forcePickableObjectsUpdate||rootRegion.checkPickableUpdateRequred(!0))&&this.updatePickableThreeJSObjects(),pickableObjectsList),this.getNormalisedMinimapCoordinates=(renderer,event)=>{if(this.displayMinimap){var target=new THREE.Vector2;renderer.getSize(target);var offsetY=target.y-event.clientY;if(scissor.x+this.minimapScissor.width>event.clientX&&event.clientX>scissor.x&&scissor.y+this.minimapScissor.height>offsetY&&offsetY>scissor.y){var x=2*((event.clientX-scissor.x)/this.minimapScissor.width)-1,y=2*((offsetY-scissor.y)/this.minimapScissor.height)-1;return{x:x,y:y}}}},this.getMinimapDiffFromNormalised=(x,y)=>minimap?minimap.getDiffFromNormalised(x,y):void 0,this.isWebGL2=()=>rendererIn.isWebGL2(),this.clearAll=()=>{markerCluster.clear(),rootRegion.clear(!0),this.clearZincObjectAddedCallbacks(),this.clearZincObjectRemovedCallbacks(),sceneLoader.toBeDwonloaded=0,zincCameraControls&&zincCameraControls.calculateMaxAllowedDistance(this),markerCluster.markerUpdateRequired=!0},this.addMetadataTimeStamp=(key,time)=>{metadata.TimeStamps[key]=convertDurationObjectTomSec(time)},this.getMetadataTag=key=>metadata[key],this.getMetadata=()=>metadata,this.setMetadataTag=(key,value)=>{metadata[key]=value},this.removeMetadataTag=key=>{delete metadata[key]},this.resetMetadata=()=>{metadata=defaultMetadata()},this.resetDuration=()=>{this.setDuration(defaultDuration)};// Turn the object into a readable string {years: years,months: months, // weeks: weeks, days: days, hours: hours, mins: mins, secs: secs } var convertDurationObjectToString=duration=>[...(duration.years?["".concat(duration.years,"years")]:[]),...(duration.months?["".concat(duration.months,"months")]:[]),...(duration.weeks?["".concat(duration.weeks,"weeks")]:[]),...(duration.days?["".concat(duration.days,"days")]:[]),...(duration.hours?["".concat(duration.hours,"hours")]:[]),...(duration.mins?["".concat(duration.mins,"mins")]:[]),...(duration.secs?["".concat(duration.secs,"secs")]:[])].join(" "),convertDurationObjectTomSec=duration=>duration.years?31536e6*duration.years:0+duration.months?2592e6*duration.months:0+duration.weeks?6048e5*duration.weeks:0+duration.days?864e5*duration.days:0+duration.hours?36e5*duration.hours:0+duration.mins?6e4*duration.mins:0+duration.secs?1e3*duration.secs:0;// Turn the object into a number representing milliesecond {years: years,months: months, // weeks: weeks, days: days, hours: hours, mins: mins, secs: secs } // Set the readable duration and timer using an object // with the following format {years: years,months: months, weeks: weeks, days: days, // hours: hours, mins: mins, secs: secs } // Set the readable original duration using an object // with the following format {years: years,months: months, weeks: weeks, days: days, // hours: hours, mins: mins, secs: secs } /** * Export the scene in GLTF format, it can either return it in * string or binary form. * * @param {Boolean} binary - Indicate it should be exported as binary or * text. * * @return {Promise} The exported data if the promise resolve successfully */ /** * Get the root region of the scene. * * @return {Region} Return the root region of the scene */ /** * Create points in region specified in the path * */ /** * Create points in region specified in the path * */ /** * Add a callback function which will be called everytime zinc object is added. * @param {Function} callbackFunction - callbackFunction to be added. * * @return {Number} */ /** * Add a callback function which will be called everytime zinc object is removed. * @param {Function} callbackFunction - callbackFunction to be added. * * @return {Number} */ /** * Remove a callback function that is previously added to the scene. * @param {Number} id - identifier of the previously added callback function. */ /** * Remove a callback function that is previously added to the scene. * @param {Number} id - identifier of the previously added callback function. */ /** * Clear all zinc object callback function */ /** * Clear all zinc object callback function */ /** * Used to trigger zinc object added callback */ /** * Used to trigger zinc object removed callback */ /* * Add temporary points to the scene which can be removed * with clearTemporaryPrimitives method. */ /* * Add temporary lines to the scene which can be removed * with clearTemporaryPrimitives method. */ /* * Remove object from temporary objects list */ /* * Remove all temporary primitives. * Return number of primitives removed; */ /* * Create primitive based on the bounding box of scene and * add to specify region and group name. */ /* * Create primitive based on the bounding box of scene and * add to specify region and group name. */ /* * Enable marker cluster to work with markers */this.setDurationFromObject=duration=>{var string=convertDurationObjectToString(duration),millisec=convertDurationObjectTomSec(duration);this.setMetadataTag("Duration",string),this.setDuration(millisec)},this.setOriginalDurationFromObject=duration=>{var string=convertDurationObjectToString(duration);this.setMetadataTag("OriginalDuration",string)},this.exportGLTF=binary=>{var exporter=new SceneExporter(this);return exporter.exportGLTF(binary)},this.getRootRegion=()=>rootRegion,this.createLines=(regionPath,groupName,coords,colour)=>{var region=rootRegion.findChildFromPath(regionPath);return void 0===region&&(region=rootRegion.createChildFromPath(regionPath)),region.createLines(groupName,coords,colour)},this.createPoints=(regionPath,groupName,coords,labels,colour)=>{var region=rootRegion.findChildFromPath(regionPath);return void 0===region&&(region=rootRegion.createChildFromPath(regionPath)),region.createPoints(groupName,coords,labels,colour)},this.addZincObjectAddedCallbacks=callbackFunction=>(++zincObjectAddedCallbacks_id,zincObjectAddedCallbacks[zincObjectAddedCallbacks_id]=callbackFunction,zincObjectAddedCallbacks_id),this.addZincObjectRemovedCallbacks=callbackFunction=>(++zincObjectRemovedCallbacks_id,zincObjectRemovedCallbacks[zincObjectRemovedCallbacks_id]=callbackFunction,zincObjectRemovedCallbacks_id),this.removeZincObjectAddedCallbacks=id=>{id in zincObjectAddedCallbacks_id&&delete zincObjectAddedCallbacks[id]},this.removeZincObjectRemovedCallbacks=id=>{id in zincObjectRemovedCallbacks_id&&delete zincObjectRemovedCallbacks[id]},this.clearZincObjectAddedCallbacks=()=>{zincObjectAddedCallbacks={},zincObjectAddedCallbacks_id=0},this.clearZincObjectRemovedCallbacks=()=>{zincObjectRemovedCallbacks={},zincObjectRemovedCallbacks_id=0},this.triggerObjectAddedCallback=zincObject=>{for(var key in zincObjectAddedCallbacks)zincObjectAddedCallbacks.hasOwnProperty(key)&&zincObjectAddedCallbacks[key](zincObject)},this.triggerObjectRemovedCallback=zincObject=>{for(var key in zincObjectRemovedCallbacks)zincObjectRemovedCallbacks.hasOwnProperty(key)&&zincObjectRemovedCallbacks[key](zincObject)},this.addTemporaryPoints=(coords,colour)=>{var geometry=createBufferGeometry(coords.length,coords),material=new THREE.PointsMaterial({alphaTest:.5,size:15,color:colour,sizeAttenuation:!1}),texture=getCircularTexture();material.map=texture;var point=new((__webpack_require__(23).Points))(geometry,material);return tempGroup.add(point),point},this.addTemporaryLines=(coords,colour)=>{var geometry=createBufferGeometry(coords.length,coords),material=new THREE.LineBasicMaterial({color:colour}),line=new((__webpack_require__(12).LineSegments))(geometry,material);return tempGroup.add(line),line},this.removeTemporaryPrimitive=object=>{tempGroup.remove(object),object.geometry.dispose(),object.material.dispose()},this.clearTemporaryPrimitives=()=>{var i=0,children=tempGroup.children;return children.forEach(child=>{child.geometry.dispose(),child.material.dispose(),i++}),tempGroup.clear(),i},this.addBoundingBoxPrimitive=function(regionPath,group,colour,opacity,visibility){var boundingBox=5{var planeGeo;switch(direction){//YZ plane case"x":planeGeo=new THREE.PlaneGeometry(dim.z,dim.y),planeGeo.rotateY(Math.PI/2);// code block break;//XZ plane case"y":planeGeo=new THREE.PlaneGeometry(dim.x,dim.z),planeGeo.rotateX(Math.PI/2);// code block break;//XY plane case"z":planeGeo=new THREE.PlaneGeometry(dim.x,dim.y);// code block break;default:}var primitive=region.createGeometryFromThreeJSGeometry(groups[index],planeGeo,colours[index],opacity,visibility,10001);primitives.push(primitive),index++}),dim.addVectors(box.min,box.max).multiplyScalar(.5),primitives.forEach(primitive=>{primitive.setPosition(dim.x,dim.y,dim.z)}),primitives}},this.enableMarkerCluster=flag=>{flag?(markerCluster.markerUpdateRequired=!0,markerCluster.enable()):(markerCluster.markerUpdateRequired=!1,markerCluster.disable()),this.forcePickableObjectsUpdate=!0}}; /***/ }), /* 33 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var t,r=1;r{sprite.scale.set(.015,.02,1),sprite.scale.multiplyScalar(size)},this.clear=()=>{this.group.clear(),this.markers={}},this.dispose=()=>{this.clear(),this.morph&&this.morph.clear()};var createNewSprite=index=>{//Group is needed to set the position after scaling //the sprite var localGroup=new THREE.Group,sprite=new THREE.Sprite(spriteMaterial);return sprite.clusterIndex=index,sprite.center.set(.5,0),sprite.position.set(0,0,0),sprite.renderOrder=1e4,sprite.scale.set(size[0],size[1],size[2]),sprite.userData=this,localGroup.add(sprite),this.group.add(localGroup),{group:localGroup,marker:sprite,label:void 0,number:0,min:[0,0,0],max:[1,1,1]}},activateSpriteForCluster=(sprite,cluster,number)=>{sprite.group.visible=!0,sprite.group.position.set(cluster.coords[0],cluster.coords[1],cluster.coords[2]),(sprite.label===void 0||number!==sprite.number)&&(sprite.label&&(sprite.group.remove(sprite.label),sprite.label.material.map.dispose(),sprite.label.material.dispose()),sprite.label=createNewSpriteText(number,.012,"black","Asap",50,500),sprite.number=number,sprite.group.add(sprite.label)),sprite.min=cluster.min,sprite.max=cluster.max},drawClusters=clusters=>{var currentIndex=0;for(clusters.forEach(cluster=>{var length=cluster.members.length,number=0;1===length?cluster.members[0].setVisibility(!0):(cluster.members.forEach(marker=>{number+=marker.getNumber(),marker.setVisibility(!1)}),!sprites[currentIndex]&&sprites.push(createNewSprite(currentIndex)),activateSpriteForCluster(sprites[currentIndex],cluster,number),currentIndex++)}),currentIndex;currentIndex{var first=!0,newCluster={members:[],coords:[0,0,0],min:[0,0,0],max:[1,1,1]},dist=0;for(var prop in markersObj)first?(_v21.set(markersObj[prop].ndc.x,markersObj[prop].ndc.y),this._b1.setFromPoints([markersObj[prop].morph.position]),first=!1,newCluster.members.push(markersObj[prop]),newCluster.coords=[markersObj[prop].morph.position.x,markersObj[prop].morph.position.y,markersObj[prop].morph.position.z],clusters.push(newCluster),delete markersObj[prop]):(_v22.set(markersObj[prop].ndc.x,markersObj[prop].ndc.y),dist=_v21.distanceTo(_v22),.1>dist&&(newCluster.members.push(markersObj[prop]),this._b1.expandByPoint(markersObj[prop].morph.position),delete markersObj[prop]));newCluster.min=[this._b1.min.x,this._b1.min.y,this._b1.min.z],newCluster.max=[this._b1.max.x,this._b1.max.y,this._b1.max.z],!0!=first&&getCluster(markersObj,clusters)};//Get clusters based on the ndc coordinate for each cluster. /** * Enable and visualise the marker. */ /** * Disable and hide the marker. */this.calculate=()=>{if(enabled){var current=Date.now();if(500enabled,this.enable=()=>{enabled=!0,this.morph.visible=!0},this.disable=()=>{//turn all markers back on for(var prop in enabled=!1,this.morph.visible=!1,this.markers){var _this$markers$prop;null!==(_this$markers$prop=this.markers[prop])&&void 0!==_this$markers$prop&&_this$markers$prop.isMarker&&this.markers[prop].isEnabled()&&this.markers[prop].setVisibility(!0)}},this.zoomToCluster=index=>!!(void 0!==index&&-1{if(index!==void 0&&-1 { module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIHZpZXdCb3g9IjAgMCAzNjUgNTYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4KPGRlZnM+CjwvZGVmcz4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDApIiBpZD0iODA4ZWQyODMtMjUyNC00NDBmLTg4YWUtM2JkYjQ3YmI1NzQ5IiAgPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii0xODIuNSIgeT0iLTI4MCIgcng9IjAiIHJ5PSIwIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgLz4KPC9nPgo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+CjxnIHN0eWxlPSIiICAgPgo8L2c+CjwvZz4KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMCAwIDAgMCAwIDk3LjUpIiAgPgo8ZyBzdHlsZT0iIiAgID4KPC9nPgo8L2c+CjxnIHRyYW5zZm9ybT0ibWF0cml4KDAuOTkgMCAwIDAuOTkgMTgyLjUgMjgwKSIgID4KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItNTQwIiB5PSItNTQwIiByeD0iMCIgcnk9IjAiIHdpZHRoPSIxMDgwIiBoZWlnaHQ9IjEwODAiIC8+CjwvZz4KCQk8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkiICA+CjxwYXRoIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwxNjUsMCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHRyYW5zZm9ybT0iIHRyYW5zbGF0ZSgtMTgyLjksIC0yNzkuODUpIiBkPSJNIDE4Mi45IDU1MS43IEMgMTgyLjkgNTUxLjgwMDAwMDAwMDAwMDEgMTgzLjEgNTUyIDE4My4xIDU1MiBDIDE4My4xIDU1MiAzNTguMyAyODMgMzU4LjMgMTk0LjYgQyAzNTguMyA2NC41IDI2OS41IDcuOTAwMDAwMDAwMDAwMDA2IDE4Mi45IDcuNjk5OTk5OTk5OTk5OTg5IEMgOTYuMyA3LjkgNy41IDY0LjUgNy41IDE5NC42IEMgNy41IDI4MyAxODIuOCA1NTIgMTgyLjggNTUyIEMgMTgyLjggNTUyIDE4Mi45IDU1MS43IDE4Mi45IDU1MS43IHogTSAxMjIuMiAxODcuMiBDIDEyMi4yIDE1My42IDE0OS40IDEyNi4zOTk5OTk5OTk5OTk5OSAxODMgMTI2LjM5OTk5OTk5OTk5OTk5IEMgMjE2LjYgMTI2LjM5OTk5OTk5OTk5OTk5IDI0My44IDE1My42IDI0My44IDE4Ny4yIEMgMjQzLjggMjIwLjc5OTk5OTk5OTk5OTk4IDIxNi41IDI0OCAxODIuOSAyNDggQyAxNDkuNCAyNDggMTIyLjIgMjIwLjggMTIyLjIgMTg3LjIgeiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiAvPgo8L2c+CgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPgo8Y2lyY2xlIHN0eWxlPSJzdHJva2U6IHJnYigwLDAsMCk7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgY3g9IjAiIGN5PSIwIiByPSIzNSIgLz4KPC9nPgo8L2c+CjwvZz4KPC9zdmc+" /***/ }), /* 35 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { 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);/** * A helper class to help with reading / importing primitives and * settings into a {@link Scene}. * * @class * @param {Object} containerIn - Container to create the renderer on. * @author Alan Wu * @return {SceneLoader} */exports.SceneLoader=function(sceneIn){var scene=sceneIn;this.toBeDownloaded=0,this.progressMap={};var viewLoaded=!1,errorDownload=!1,primitivesLoader=new PrimitivesLoader;/** * This function returns a three component array, which contains * [totalsize, totalLoaded and errorDownload] of all the downloads happening * in this scene. * @returns {Array} */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 one of the external resource: ".concat(null===xhr||void 0===xhr?void 0:xhr.responseURL,".")),finishCallback&&finishCallback()};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 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})}};/** * Load the viewport from an external location provided by the url. * @param {String} URL - address to the file containing viewport information. */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()};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{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(geometry,materials)=>{var newLines=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.anatomicalId=anatomicalId,newLines.setRenderOrder(renderOrder),region.addZincObject(newLines),newLines.setDuration(scene.getDuration()),console.log(lod),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)};/** * Load lines into this scene object. * * @param {Boolean} timeEnabled - Indicate if morphing is enabled. * @param {Boolean} morphColour - Indicate if color morphing is enabled. * @param {STRING} groupName - name to assign the pointset's groupname to. * @param {Function} finishCallback - Callback function which will be called * once the glyphset is succssfully load in. */this.loadLinesURL=(region,url,timeEnabled,morphColour,groupName,finishCallback,options)=>{var localTimeEnabled=0;this.toBeDownloaded+=1;var isInline=!!(options&&options.isInline)&&options.isInline,anatomicalId=options&&options.anatomicalId?options.anatomicalId:void 0,renderOrder=options&&options.renderOrder?options.renderOrder:void 0;null!=timeEnabled&&(localTimeEnabled=!!timeEnabled);var localMorphColour=0;if(null!=morphColour&&(localMorphColour=!!morphColour),isInline){var object=primitivesLoader.parse(url);linesloader(region,localTimeEnabled,localMorphColour,groupName,anatomicalId,renderOrder,options.lod,finishCallback)(object.geometry,object.materials)}else primitivesLoader.load(url,linesloader(region,localTimeEnabled,localMorphColour,groupName,anatomicalId,renderOrder,options.lod,finishCallback),this.onProgress(url),this.onError(finishCallback),options.loaderOptions)};var loadGlyphset=(region,glyphsetData,glyphurl,groupName,finishCallback,options)=>{var isInline=options&&options.isInline?options.isInline:void 0,anatomicalId=options&&options.anatomicalId?options.anatomicalId:void 0,displayLabels=options&&options.displayLabels?options.displayLabels:void 0,renderOrder=options&&options.renderOrder?options.renderOrder:void 0,newGlyphset=new((__webpack_require__(18).Glyphset));newGlyphset.setDuration(scene.getDuration()),newGlyphset.groupName=groupName;var myCallback=()=>{--this.toBeDownloaded,finishCallback!=null&&"function"==typeof finishCallback&&finishCallback(newGlyphset)};++this.toBeDownloaded,isInline?newGlyphset.load(glyphsetData,glyphurl,myCallback,isInline,displayLabels):newGlyphset.load(glyphsetData,resolveURL(glyphurl),myCallback,isInline,displayLabels),newGlyphset.anatomicalId=anatomicalId,newGlyphset.setRenderOrder(renderOrder),region.addZincObject(newGlyphset)},onLoadGlyphsetReady=(region,xmlhttp,glyphurl,groupName,finishCallback,options)=>()=>{if(4==xmlhttp.readyState&&200==xmlhttp.status){var glyphsetData=JSON.parse(xmlhttp.responseText);loadGlyphset(region,glyphsetData,glyphurl,groupName,finishCallback,options)}},pointsetloader=(region,localTimeEnabled,localMorphColour,groupName,anatomicalId,renderOrder,finishCallback)=>(geometry,materials)=>{var newPointset=new((__webpack_require__(22).Pointset)),material=new THREE.PointsMaterial({alphaTest:.5,size:10,sizeAttenuation:!1});materials&&materials[0]&&(1>materials[0].opacity&&(material.transparent=!0),material.opacity=materials[0].opacity,material.color=materials[0].color,material.morphTargets=localTimeEnabled,material.vertexColors=materials[0].vertexColors);var options={};options.localTimeEnabled=localTimeEnabled,options.localMorphColour=localMorphColour,newPointset&&(newPointset.createMesh(geometry,material,options),newPointset.setName(groupName),newPointset.anatomicalId=anatomicalId,region.addZincObject(newPointset),newPointset.setDuration(scene.getDuration()),newPointset.setRenderOrder(renderOrder)),geometry.dispose(),--this.toBeDownloaded,null!=finishCallback&&"function"==typeof finishCallback&&finishCallback(newPointset)};//Load a glyphset into this scene. //Internal loader for zinc pointset. /** * Read a STL file into this scene, the geometry will be presented as * {@link Zinc.Geometry}. * * @param {STRING} url - location to the STL file. * @param {STRING} groupName - name to assign the geometry's groupname to. * @param {Function} finishCallback - Callback function which will be called * once the STL geometry is succssfully loaded. */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))};/** * Load a geometry into this scene, this is a subsequent called from * {@link Zinc.Scene#loadMetadataURL}, although it can be used to read * in geometry into the scene externally. * * @param {String} url - regular json model file providing geometry. * @param {Boolean} timeEnabled - Indicate if geometry morphing is enabled. * @param {Boolean} morphColour - Indicate if color morphing is enabled. * @param {STRING} groupName - name to assign the geometry's groupname to. * @param {STRING} fileFormat - name supported formats are STL, OBJ and JSON. * @param {Function} finishCallback - Callback function which will be called * once the geometry is succssfully loaded in. */var loadSurfaceURL=(region,url,timeEnabled,morphColour,groupName,finishCallback,options)=>{this.toBeDownloaded+=1;var colour=(__webpack_require__(0).defaultMaterialColor),opacity=(__webpack_require__(0).defaultOpacity),localTimeEnabled=0,isInline=!!(options&&options.isInline)&&options.isInline,fileFormat=options&&options.fileFormat?options.fileFormat:void 0,anatomicalId=options&&options.anatomicalId?options.anatomicalId:void 0,renderOrder=options&&options.renderOrder?options.renderOrder:void 0;timeEnabled!=null&&(localTimeEnabled=!!timeEnabled);var localMorphColour=0;morphColour!=null&&(localMorphColour=!!morphColour);var loader=primitivesLoader;if(fileFormat!==void 0)if("STL"==fileFormat)loader=new STLLoader;else if("OBJ"==fileFormat)return loader=new OBJLoader,loader.crossOrigin="Anonymous",void loader.load(url,objloader(region,colour,opacity,localTimeEnabled,localMorphColour,groupName,anatomicalId,finishCallback),this.onProgress(url),this.onError,options.loaderOptions);if(isInline){var object=primitivesLoader.parse(url);meshloader(region,colour,opacity,localTimeEnabled,localMorphColour,groupName,anatomicalId,renderOrder,options,finishCallback)(object.geometry,object.materials)}else loader.crossOrigin="Anonymous",primitivesLoader.load(url,meshloader(region,colour,opacity,localTimeEnabled,localMorphColour,groupName,anatomicalId,renderOrder,options,finishCallback),this.onProgress(url),this.onError(finishCallback),options.loaderOptions)},metaFinishCallback=function metaFinishCallback(numberOfDownloaded,finishCallback,allCompletedCallback){var downloadedItem=0;return zincObject=>{if(++downloadedItem,zincObject&&null!=finishCallback&&"function"==typeof finishCallback){finishCallback(zincObject);var zincCameraControls=scene.getZincCameraControls();zincCameraControls&&zincCameraControls.calculateMaxAllowedDistance(scene)}downloadedItem==numberOfDownloaded&&(!1==viewLoaded&&scene.viewAll(),null!=allCompletedCallback&&"function"==typeof allCompletedCallback&&allCompletedCallback())}};//Object to keep track of number of items downloaded and when all items are downloaded //allCompletedCallback is called /** * Load a pointset into this scene object. * * @param {Boolean} timeEnabled - Indicate if morphing is enabled. * @param {Boolean} morphColour - Indicate if color morphing is enabled. * @param {STRING} groupName - name to assign the pointset's groupname to. * @param {Function} finishCallback - Callback function which will be called * once the glyphset is succssfully load in. */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{--this.toBeDownloaded,null!=finishCallback&&"function"==typeof finishCallback&&finishCallback(newTexture)};++this.toBeDownloaded,newTexture.load(textureData,myCallback,isInline),newTexture.anatomicalId=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. /** * Load a texture into this scene object. * * @param {STRING} groupName - name to assign the pointset's groupname to. * @param {Function} finishCallback - Callback function which will be called * once the glyphset is succssfully load in. */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()}};/** * Add a user provided {THREE.Geometry} into the scene as zinc geometry. * * @param {Three.Geometry} geometry - The threejs geometry to be added as {@link Zinc.Geometry}. * @param {THREE.Color} color - Colour to be assigned to this geometry, overrided if materialIn is provided. * @param {Number} opacity - Opacity to be set for this geometry, overrided if materialIn is provided. * @param {Boolean} localTimeEnabled - Set this to true if morph geometry is present, overrided if materialIn is provided. * @param {Boolean} localMorphColour - Set this to true if morph colour is present, overrided if materialIn is provided. * @param {Boolean} external - Set this to true if morph geometry is present, overrided if materialIn is provided. * @param {Function} finishCallback - Callback once the geometry has been added succssfully. * @param {THREE.Material} materialIn - Material to be set for this geometry if it is present. * * @returns {Zinc.Geometry} */var addZincGeometry=(region,geometryIn,colour,opacity,localTimeEnabled,localMorphColour,finishCallback,materialIn,groupName)=>{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),region&®ion.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);if(zincGeometry.anatomicalId=anatomicalId,zincGeometry.setRenderOrder(renderOrder),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. //Turn ISO 8601 duration string into an array. //Load settings from metadata item. this.loadSettings=item=>{if(item){//duration uses the ISO 8601 standard - PnYnMnDTnHnMnS if(item.Duration){var duration=parseDuration(item.Duration);scene.setDurationFromObject(duration)}if(item.OriginalDuration){var _duration=parseDuration(item.OriginalDuration);scene.setOriginalDurationFromObject(_duration)}if(item.TimeStamps)for(var key in item.TimeStamps){var time=parseDuration(item.TimeStamps[key]);scene.addMetadataTimeStamp(key,time)}}};//Function to process each of the graphical metadata item except for view and //settings. 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,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 /** * Load GLTF into this scene object. * * @param {String} url - URL to the GLTF file * @param {Function} finishCallback - Callback function which will be called * once the glyphset is succssfully load in. */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&®ions.Primitives.forEach(primitive=>{var order=1;primitive.Order&&(order=primitive.Order),readPrimitivesItem(currentRegion,referenceURL,primitive,order,callback)}),regions.Transformation&¤tRegion.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{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 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 // Prioritise the view file and settings before loading anything else for(var numberOfObjects=getNumberOfObjects(metadata),callback=new metaFinishCallback(numberOfObjects,finishCallback,allCompletedCallback),i=0;i{var numberOfObjects=getNumberOfObjects(metadata),callback=new metaFinishCallback(numberOfObjects,finishCallback,allCompletedCallback);// view file does not receive callback metadata.Settings&&this.loadSettings(metadata.Settings),metadata.Views&&loadMultipleViews(referenceURL,metadata.Views,referenceURL),metadata.Regions&&loadRegions(targetRegion,referenceURL,metadata.Regions,callback)};/** * Load a metadata file from the provided URL into this scene. Once * succssful scene proceeds to read each items into scene for visualisations. * * @param {String} url - Location of the metafile * @param {Function} finishCallback - Callback function which will be called * for each glyphset and geometry that has been written in. */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()}}; /***/ }), /* 36 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ STLLoader: () => (/* binding */ STLLoader) /* harmony export */ }); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_0__); /** * Description: A THREE loader for STL ASCII files, as created by Solidworks and other CAD programs. * * Supports both binary and ASCII encoded files, with automatic detection of type. * * The loader returns a non-indexed buffer geometry. * * Limitations: * Binary decoding supports "Magics" color format (http://en.wikipedia.org/wiki/STL_(file_format)#Color_in_binary_STL). * There is perhaps some question as to how valid it is to always assume little-endian-ness. * ASCII decoding assumes file is UTF-8. * * Usage: * const loader = new STLLoader(); * loader.load( './models/stl/slotted_disk.stl', function ( geometry ) { * scene.add( new THREE.Mesh( geometry ) ); * }); * * For binary STLs geometry might contain colors for vertices. To use it: * // use the same code to load STL as above * if (geometry.hasColors) { * material = new THREE.MeshPhongMaterial({ opacity: geometry.alpha, vertexColors: true }); * } else { .... } * const mesh = new THREE.Mesh( geometry, material ); * * For ASCII STLs containing multiple solids, each solid is assigned to a different group. * Groups can be used to assign a different color by defining an array of materials with the same length of * geometry.groups and passing it to the Mesh constructor: * * const mesh = new THREE.Mesh( geometry, material ); * * For example: * * const materials = []; * const nGeometryGroups = geometry.groups.length; * * const colorMap = ...; // Some logic to index colors. * * for (let i = 0; i < nGeometryGroups; i++) { * * const material = new THREE.MeshPhongMaterial({ * color: colorMap[i], * wireframe: false * }); * * } * * materials.push(material); * const mesh = new THREE.Mesh(geometry, materials); */class STLLoader extends three__WEBPACK_IMPORTED_MODULE_0__.Loader{constructor(manager){super(manager)}load(url,onLoad,onProgress,onError){var scope=this,loader=new three__WEBPACK_IMPORTED_MODULE_0__.FileLoader(this.manager);loader.setPath(this.path),loader.setResponseType("arraybuffer"),loader.setRequestHeader(this.requestHeader),loader.setWithCredentials(this.withCredentials),loader.load(url,function(text){try{onLoad(scope.parse(text))}catch(e){onError?onError(e):console.error(e),scope.manager.itemError(url)}},onProgress,onError)}parse(data){function matchDataViewAt(query,reader,offset){// Check if each byte in query matches the corresponding byte from the current offset for(var i=0,il=query.length;ioff;off++)// If "solid" text is matched to the current offset, declare it to be an ASCII STL. if(matchDataViewAt(solid,reader,off))return!1;// Couldn't find "solid" text at the beginning; it is binary STL. return!0}(binData)?function(data){// process STL header // check for default color in header ("COLOR=rgba" sequence). for(var r,g,b,colors,defaultR,defaultG,defaultB,alpha,reader=new DataView(data),faces=reader.getUint32(80,!0),hasColors=!1,index=0;index<80-10;index++)1129270351==reader.getUint32(index,!1)/*COLO*/&&82==reader.getUint8(index+4)/*'R'*/&&61==reader.getUint8(index+5)/*'='*/&&(hasColors=!0,colors=new Float32Array(3*(3*faces)),defaultR=reader.getUint8(index+6)/255,defaultG=reader.getUint8(index+7)/255,defaultB=reader.getUint8(index+8)/255,alpha=reader.getUint8(index+9)/255);for(var geometry=new three__WEBPACK_IMPORTED_MODULE_0__.BufferGeometry,vertices=new Float32Array(3*(3*faces)),normals=new Float32Array(3*(3*faces)),face=0;face>5)/31,b=(31&packedColor>>10)/31):(r=defaultR,g=defaultG,b=defaultB)}for(var i=1;3>=i;i++){var vertexstart=start+12*i,componentIdx=3*(3*face)+3*(i-1);vertices[componentIdx]=reader.getFloat32(vertexstart,!0),vertices[componentIdx+1]=reader.getFloat32(vertexstart+4,!0),vertices[componentIdx+2]=reader.getFloat32(vertexstart+8,!0),normals[componentIdx]=normalX,normals[componentIdx+1]=normalY,normals[componentIdx+2]=normalZ,hasColors&&(colors[componentIdx]=r,colors[componentIdx+1]=g,colors[componentIdx+2]=b)}}return geometry.setAttribute("position",new three__WEBPACK_IMPORTED_MODULE_0__.BufferAttribute(vertices,3)),geometry.setAttribute("normal",new three__WEBPACK_IMPORTED_MODULE_0__.BufferAttribute(normals,3)),hasColors&&(geometry.setAttribute("color",new three__WEBPACK_IMPORTED_MODULE_0__.BufferAttribute(colors,3)),geometry.hasColors=!0,geometry.alpha=alpha),geometry}(binData):function(data){for(var result,geometry=new three__WEBPACK_IMPORTED_MODULE_0__.BufferGeometry,patternSolid=/solid([\s\S]*?)endsolid/g,patternFace=/facet([\s\S]*?)endfacet/g,faceCounter=0,patternFloat=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,patternVertex=new RegExp("vertex"+patternFloat+patternFloat+patternFloat,"g"),patternNormal=new RegExp("normal"+patternFloat+patternFloat+patternFloat,"g"),vertices=[],normals=[],normal=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,groupCount=0,startVertex=0,endVertex=0;null!==(result=patternSolid.exec(data));){startVertex=endVertex;for(var solid=result[0];null!==(result=patternFace.exec(solid));){for(var vertexCountPerFace=0,normalCountPerFace=0,text=result[0];null!==(result=patternNormal.exec(text));)normal.x=parseFloat(result[1]),normal.y=parseFloat(result[2]),normal.z=parseFloat(result[3]),normalCountPerFace++;for(;null!==(result=patternVertex.exec(text));)vertices.push(parseFloat(result[1]),parseFloat(result[2]),parseFloat(result[3])),normals.push(normal.x,normal.y,normal.z),vertexCountPerFace++,endVertex++;// every face have to own ONE valid normal 1!==normalCountPerFace&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+faceCounter),3!==vertexCountPerFace&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+faceCounter),faceCounter++}var start=startVertex,count=endVertex-startVertex;geometry.addGroup(start,count,groupCount),groupCount++}return geometry.setAttribute("position",new three__WEBPACK_IMPORTED_MODULE_0__.Float32BufferAttribute(vertices,3)),geometry.setAttribute("normal",new three__WEBPACK_IMPORTED_MODULE_0__.Float32BufferAttribute(normals,3)),geometry}(function(buffer){return"string"==typeof buffer?buffer:three__WEBPACK_IMPORTED_MODULE_0__.LoaderUtils.decodeText(new Uint8Array(buffer))}(data))}} /***/ }), /* 37 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ OBJLoader: () => (/* binding */ OBJLoader) /* harmony export */ }); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_0__); // o object_name | g group_name var _object_pattern=/^[og]\s*(.+)?/,_material_library_pattern=/^mtllib /,_material_use_pattern=/^usemtl /,_map_use_pattern=/^usemap /,_vA=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,_vB=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,_vC=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,_ab=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,_cb=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3;// mtllib file_reference // usemtl material_name // usemap map_name function ParserState(){var state={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function startObject(name,fromDeclaration){// If the current object (initial from reset) is not from a g/o declaration in the parsed // file. We need to use it for the first parsed g/o to keep things in sync. if(this.object&&!1===this.object.fromDeclaration)return this.object.name=name,void(this.object.fromDeclaration=!1!==fromDeclaration);var previousMaterial=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;// Inherit previous objects material. // Spec tells us that a declared material must be set to all objects until a new material is declared. // If a usemtl declaration is encountered while this new object is being parsed, it will // overwrite the inherited material. Exception being that there was already face declarations // to the inherited material, then it will be preserved for proper MultiMaterial continuation. if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:name||"",fromDeclaration:!1!==fromDeclaration,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function startMaterial(name,libraries){var previous=this._finalize(!1);// New usemtl declaration overwrites an inherited material, except if faces were declared // after the material, then it must be preserved for proper MultiMaterial continuation. previous&&(previous.inherited||0>=previous.groupCount)&&this.materials.splice(previous.index,1);var material={index:this.materials.length,name:name||"",mtllib:Array.isArray(libraries)&&0=this.materials[mi].groupCount&&this.materials.splice(mi,1);// Guarantee at least one empty material, this makes the creation later more straight forward. return end&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),lastMultiMaterial}},previousMaterial&&previousMaterial.name&&"function"==typeof previousMaterial.clone){var declared=previousMaterial.clone(0);declared.inherited=!0,this.object.materials.push(declared)}this.objects.push(this.object)},finalize:function finalize(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function parseVertexIndex(value,len){var index=parseInt(value,10);return 3*(0<=index?index-1:index+len/3)},parseNormalIndex:function parseNormalIndex(value,len){var index=parseInt(value,10);return 3*(0<=index?index-1:index+len/3)},parseUVIndex:function parseUVIndex(value,len){var index=parseInt(value,10);return 2*(0<=index?index-1:index+len/2)},addVertex:function addVertex(a,b,c){var src=this.vertices,dst=this.object.geometry.vertices;dst.push(src[a+0],src[a+1],src[a+2]),dst.push(src[b+0],src[b+1],src[b+2]),dst.push(src[c+0],src[c+1],src[c+2])},addVertexPoint:function addVertexPoint(a){var src=this.vertices,dst=this.object.geometry.vertices;dst.push(src[a+0],src[a+1],src[a+2])},addVertexLine:function addVertexLine(a){var src=this.vertices,dst=this.object.geometry.vertices;dst.push(src[a+0],src[a+1],src[a+2])},addNormal:function addNormal(a,b,c){var src=this.normals,dst=this.object.geometry.normals;dst.push(src[a+0],src[a+1],src[a+2]),dst.push(src[b+0],src[b+1],src[b+2]),dst.push(src[c+0],src[c+1],src[c+2])},addFaceNormal:function addFaceNormal(a,b,c){var src=this.vertices,dst=this.object.geometry.normals;_vA.fromArray(src,a),_vB.fromArray(src,b),_vC.fromArray(src,c),_cb.subVectors(_vC,_vB),_ab.subVectors(_vA,_vB),_cb.cross(_ab),_cb.normalize(),dst.push(_cb.x,_cb.y,_cb.z),dst.push(_cb.x,_cb.y,_cb.z),dst.push(_cb.x,_cb.y,_cb.z)},addColor:function addColor(a,b,c){var src=this.colors,dst=this.object.geometry.colors;void 0!==src[a]&&dst.push(src[a+0],src[a+1],src[a+2]),void 0!==src[b]&&dst.push(src[b+0],src[b+1],src[b+2]),void 0!==src[c]&&dst.push(src[c+0],src[c+1],src[c+2])},addUV:function addUV(a,b,c){var src=this.uvs,dst=this.object.geometry.uvs;dst.push(src[a+0],src[a+1]),dst.push(src[b+0],src[b+1]),dst.push(src[c+0],src[c+1])},addDefaultUV:function addDefaultUV(){var dst=this.object.geometry.uvs;dst.push(0,0),dst.push(0,0),dst.push(0,0)},addUVLine:function addUVLine(a){var src=this.uvs,dst=this.object.geometry.uvs;dst.push(src[a+0],src[a+1])},addFace:function addFace(a,b,c,ua,ub,uc,na,nb,nc){var vLen=this.vertices.length,ia=this.parseVertexIndex(a,vLen),ib=this.parseVertexIndex(b,vLen),ic=this.parseVertexIndex(c,vLen);// normals if(this.addVertex(ia,ib,ic),this.addColor(ia,ib,ic),void 0!==na&&""!==na){var nLen=this.normals.length;ia=this.parseNormalIndex(na,nLen),ib=this.parseNormalIndex(nb,nLen),ic=this.parseNormalIndex(nc,nLen),this.addNormal(ia,ib,ic)}else this.addFaceNormal(ia,ib,ic);// uvs if(void 0!==ua&&""!==ua){var uvLen=this.uvs.length;ia=this.parseUVIndex(ua,uvLen),ib=this.parseUVIndex(ub,uvLen),ic=this.parseUVIndex(uc,uvLen),this.addUV(ia,ib,ic),this.object.geometry.hasUVIndices=!0}else// add placeholder values (for inconsistent face definitions) this.addDefaultUV()},addPointGeometry:function addPointGeometry(vertices){this.object.geometry.type="Points";for(var index,vLen=this.vertices.length,vi=0,l=vertices.length;vi { function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var t,r=1;r{var merge=(geometry1,geometry2)=>{geometry1.merge(geometry2)};if(geometries&&0{var modelData=data[item.index];if(modelData){var obj=jsonLoader.parse(modelData);item.onLoad(obj.geometry,obj.materials)}else processItemError(item,{responseURL:url})},processItemError=item=>{item.onError&&(!error&&(error={responseURL:url}),item.onError(error))};this.downloadCompleted=args=>{try{data=JSON.parse(args[0]),downloading=!1,finished=!0,Array.isArray(data)?items.forEach(item=>processItemDownloaded(item)):items.forEach(item=>processItemError(item))}catch(_unused){items.forEach(item=>processItemError(item))}};var errorHandling=()=>xhr=>{error=xhr,finished=!0,downloading=!1,items.forEach(item=>{processItemError(item)})},progressHandling=()=>xhr=>{items.forEach(item=>{item.onProgress&&item.onProgress(xhr)})};this.load=(index,onLoad,onProgress,onError)=>{var item={index,onLoad,onProgress,onError};finished?data?processItemDownloaded(item):processItemError(error):downloading?items.push(item):(items.push(item),downloading=!0,loader.load(url,onDownloaded,progressHandling,errorHandling))}},MultiSourcesHandler=function MultiSourcesHandler(numberIn,onLoadCallback){var allData=[],number=numberIn,onLoad=onLoadCallback,totalDownloaded=0;this.itemDownloaded=(order,args)=>{if(allData[order]=args,totalDownloaded++,totalDownloaded==number){//All geometries will be merged into the first one for(var materials=allData[0][1],geometries=allData.map(data=>data[0]),geometry=mergeGeometries(geometries),i=1;imaterial.dispose());onLoad(geometry,materials)}}};exports.PrimitivesLoader=function(){var concurrentDownloads=0,MAX_DOWNLOAD=20;this.crossOrigin="Anonymous";var loader=new JSONLoader,waitingList=[],indexedLoaders={},loadFromMultipleSources=(urls,onLoad,onProgress,onError,options)=>{var number=urls.length,msHandler=new MultiSourcesHandler(number,onLoad),order=0;//The order here will give us hint on the sequence on merging the primitives urls.forEach(url=>{var newOptions=options?_objectSpread({},options):{};newOptions.msHandler=msHandler,newOptions.order=order,order++,loadFromSingleSource(url,onLoad,onProgress,onError,newOptions)})},handleIndexedSource=(url,onLoad,onProgress,onError,options)=>{var newOptions=options?_objectSpread({},options):{},indexedLoader=indexedLoaders[url];if(!indexedLoader)if(MAX_DOWNLOAD>concurrentDownloads){var onLoadCallback=new onFinally(void 0,this,newOptions);++concurrentDownloads,indexedLoader=new IndexedSourcesHandler(url,this.crossOrigin,onLoadCallback),indexedLoaders[url]=indexedLoader}else waitingList.push({url,onLoad,onProgress,onError,options});indexedLoader&&(newOptions.isHandler=indexedLoader,indexedLoader.load(options.index,onLoad,onProgress,onError))},loadFromSingleSource=(url,onLoad,onProgress,onError,options)=>{if(options&&options.index!==void 0)handleIndexedSource(url,onLoad,onProgress,onError,options);else//Standard loading if(MAX_DOWNLOAD>concurrentDownloads){++concurrentDownloads;var onLoadCallback=new onFinally(onLoad,this,options),onErrorCallback=new onFinally(onError,this,options);loader.crossOrigin=this.crossOrigin,loader.load(url,onLoadCallback,onProgress,onErrorCallback)}else waitingList.push({url,onLoad,onProgress,onError,options})};//URL to loader pair //Load the first file then the rest will be handled separately this.load=(url,onLoad,onProgress,onError,options)=>{Array.isArray(url)?loadFromMultipleSources(url,onLoad,onProgress,onError,options):loadFromSingleSource(url,onLoad,onProgress,onError,options)},this.loadFromWaitingList=()=>{for(;MAX_DOWNLOAD>concurrentDownloads;){var item=waitingList.shift();if(item)this.load(item.url,item.onLoad,item.onProgress,item.onError,item.options);else return}},this.itemRemainingCheck=()=>{if(0===waitingList.length&&0==concurrentDownloads)for(var key in indexedLoaders)indexedLoaders.hasOwnProperty(key)&&delete indexedLoaders[key]};var onFinally=function onFinally(callback,loader,options){return function(){--concurrentDownloads;for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];null!==options&&void 0!==options&&options.msHandler?options.msHandler.itemDownloaded(options.order,args):null!==options&&void 0!==options&&options.isHandler?options.isHandler.downloadCompleted(args):callback&&callback(...args),loader.loadFromWaitingList(),loader.itemRemainingCheck()}};this.parse=data=>loader.parse(data)}; /***/ }), /* 39 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var THREE=__webpack_require__(4),GLTFLoader=(__webpack_require__(40).GLTFLoader),GLTFToZincJSLoader=function(){var _this=this;/** * Load GLTF into this scene object. * * @param {String} url - URL to the GLTF file * @param {Function} finishCallback - Callback function which will be called * once the glyphset is succssfully load in. */this.parseGLTFObjects=(object,region,depth,finishCallback)=>{var childRegion=region;if(0!==depth)if("Object3D"!==object.type){var zincGeometry;if("Mesh"===object.type?zincGeometry=new((__webpack_require__(3).Geometry)):"LineSegments"===object.type?zincGeometry=new((__webpack_require__(24).Lines)):"Points"===object.type&&(zincGeometry=new((__webpack_require__(22).Pointset))),zincGeometry){var localTimeEnabled=!1,localMorphColour=!1;object.geometry&&object.geometry.morphAttributes&&(localTimeEnabled=!!object.geometry.morphAttributes.position,localMorphColour=!!object.geometry.morphAttributes.color),zincGeometry.setMesh(object.clone(),localTimeEnabled,localMorphColour);var morph=zincGeometry.getMorph();zincGeometry.groupName=morph.name,morph.matrixAutoUpdate=!0,region.addZincObject(zincGeometry),null!=finishCallback&&"function"==typeof finishCallback&&finishCallback(zincGeometry)}}else if(""!==object.name&&(region&&(childRegion=region.findOrCreateChildFromPath(object.name)),childRegion)){var group=childRegion.getGroup();group.position.copy(object.position),group.rotation.copy(object.rotation),group.quaternion.copy(object.quaternion),group.matrixAutoUpdate=!0}depth++,object.children.forEach(child=>{_this.parseGLTFObjects(child,childRegion,depth,finishCallback)})},this.setCamera=scene=>{scene.viewAll();var cameraControls=scene.getZincCameraControls(),viewport=cameraControls.getCurrentViewport();cameraControls.addViewport("default",viewport),cameraControls.setDefaultViewport("default")},this.load=(scene,region,url,finishCallback,allCompletedCallback)=>{var path=url.substring(0,url.lastIndexOf("/")+1),filename=url.substring(url.lastIndexOf("/")+1,url.length),loader=new GLTFLoader().setPath(path);loader.load(filename,function(gltf){console.log(gltf),_this.parseGLTFObjects(gltf.scene,region,0,finishCallback),_this.setCamera(scene),allCompletedCallback!=null&&"function"==typeof allCompletedCallback&&allCompletedCallback()})}};exports.GLTFToZincJSLoader=GLTFToZincJSLoader; /***/ }), /* 40 */ /***/ ((module) => { "use strict"; module.exports = require("three/examples/jsm/loaders/GLTFLoader"); /***/ }), /* 41 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var GLTFExporter=(__webpack_require__(42).GLTFExporter),SceneExporter=function(sceneIn){var scene=sceneIn;this.exportGLTF=binary=>{var rootRegion=scene.getRootRegion(),zincObjects=rootRegion.getAllObjects(!0),animations=[];zincObjects.forEach(zincObject=>{zincObject.animationClip&&animations.push({clip:zincObject.animationClip[0],mesh:zincObject.getMorph()})});var exporter=new GLTFExporter,options={binary,animations};return new Promise(resolve=>{exporter.parse(scene.getThreeJSScene(),function(gltf){resolve(gltf)},options)})}};/** * Provides an object which uses for exporting the scene * * @class * @author Alan Wu * @return {SceneExporter} */exports.SceneExporter=SceneExporter; /***/ }), /* 42 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GLTFExporter: () => (/* binding */ GLTFExporter) /* harmony export */ }); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_0__); class GLTFExporter{constructor(){this.pluginCallbacks=[],this.register(function(writer){return new GLTFLightExtension(writer)}),this.register(function(writer){return new GLTFMaterialsUnlitExtension(writer)}),this.register(function(writer){return new GLTFMaterialsPBRSpecularGlossiness(writer)})}register(callback){return-1===this.pluginCallbacks.indexOf(callback)&&this.pluginCallbacks.push(callback),this}unregister(callback){return-1!==this.pluginCallbacks.indexOf(callback)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(callback),1),this}/** * Parse scenes and generate GLTF output * @param {Scene or [THREE.Scenes]} input Scene or Array of THREE.Scenes * @param {Function} onDone Callback on completed * @param {Object} options options */parse(input,onDone,options){for(var writer=new GLTFWriter,plugins=[],i=0,il=this.pluginCallbacks.length;i} */processBufferViewImage(blob){var writer=this,json=writer.json;return json.bufferViews||(json.bufferViews=[]),new Promise(function(resolve){var reader=new window.FileReader;reader.readAsArrayBuffer(blob),reader.onloadend=function(){var buffer=getPaddedArrayBuffer(reader.result),bufferViewDef={buffer:writer.processBuffer(buffer),byteOffset:writer.byteOffset,byteLength:buffer.byteLength};writer.byteOffset+=buffer.byteLength,resolve(json.bufferViews.push(bufferViewDef)-1)}})}/** * Process attribute to generate an accessor * @param {BufferAttribute} attribute Attribute to process * @param {THREE.BufferGeometry} geometry (Optional) Geometry used for truncated draw range * @param {Integer} start (Optional) * @param {Integer} count (Optional) * @return {Integer|null} Index of the processed accessor on the "accessors" array */processAccessor(attribute,geometry,start,count){var componentType,options=this.options,json=this.json;// Detect the component type of the attribute array (float, uint or ushort) if(attribute.array.constructor===Float32Array)componentType=WEBGL_CONSTANTS.FLOAT;else if(attribute.array.constructor===Uint32Array)componentType=WEBGL_CONSTANTS.UNSIGNED_INT;else if(attribute.array.constructor===Uint16Array)componentType=WEBGL_CONSTANTS.UNSIGNED_SHORT;else if(attribute.array.constructor===Uint8Array)componentType=WEBGL_CONSTANTS.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");// @TODO Indexed buffer geometry with drawRange not supported yet if(void 0===start&&(start=0),void 0===count&&(count=attribute.count),options.truncateDrawRange&&void 0!==geometry&&null===geometry.index){var end=start+count,end2=geometry.drawRange.count===1/0?attribute.count:geometry.drawRange.start+geometry.drawRange.count;start=Math.max(start,geometry.drawRange.start),count=Math.min(end,end2)-start,0>count&&(count=0)}// Skip creating an accessor if the attribute doesn't have data to export if(0===count)return null;var bufferViewTarget,minMax=getMinMax(attribute,start,count);void 0!==geometry&&(bufferViewTarget=attribute===geometry.index?WEBGL_CONSTANTS.ELEMENT_ARRAY_BUFFER:WEBGL_CONSTANTS.ARRAY_BUFFER);var bufferView=this.processBufferView(attribute,componentType,start,count,bufferViewTarget),accessorDef={bufferView:bufferView.id,byteOffset:bufferView.byteOffset,componentType:componentType,count:count,max:minMax.max,min:minMax.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[attribute.itemSize]};return!0===attribute.normalized&&(accessorDef.normalized=!0),json.accessors||(json.accessors=[]),json.accessors.push(accessorDef)-1}/** * Process image * @param {Image} image to process * @param {Integer} format of the image (e.g. RGBFormat, RGBAFormat etc) * @param {Boolean} flipY before writing out the image * @return {Integer} Index of the processed texture in the "images" array */processImage(image,format,flipY){var writer=this,cache=writer.cache,json=writer.json,options=writer.options,pending=writer.pending;cache.images.has(image)||cache.images.set(image,{});var cachedImages=cache.images.get(image),mimeType=format===three__WEBPACK_IMPORTED_MODULE_0__.RGBAFormat?"image/png":"image/jpeg",key=mimeType+":flipY/"+flipY.toString();if(void 0!==cachedImages[key])return cachedImages[key];json.images||(json.images=[]);var imageDef={mimeType:mimeType};if(options.embedImages){var canvas=cachedCanvas=cachedCanvas||document.createElement("canvas");canvas.width=Math.min(image.width,options.maxTextureSize),canvas.height=Math.min(image.height,options.maxTextureSize);var ctx=canvas.getContext("2d");if(!0===flipY&&(ctx.translate(0,canvas.height),ctx.scale(1,-1)),"undefined"!=typeof HTMLImageElement&&image instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&image instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&image instanceof OffscreenCanvas||"undefined"!=typeof ImageBitmap&&image instanceof ImageBitmap)ctx.drawImage(image,0,0,canvas.width,canvas.height);else{format!==three__WEBPACK_IMPORTED_MODULE_0__.RGBAFormat&&format!==three__WEBPACK_IMPORTED_MODULE_0__.RGBFormat&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(image.width>options.maxTextureSize||image.height>options.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",image);var data=new Uint8ClampedArray(4*(image.height*image.width));if(format===three__WEBPACK_IMPORTED_MODULE_0__.RGBAFormat)for(var i=0;ij&&relativeAttribute.setXYZ(j,_attribute.getX(j)-baseAttribute.getX(j),_attribute.getY(j)-baseAttribute.getY(j),_attribute.getZ(j)-baseAttribute.getZ(j));else for(var _j=0,_jl=_attribute.count;_j<_jl;_j++)relativeAttribute.setXYZ(_j,0,0,0);target[gltfAttributeName]=this.processAccessor(relativeAttribute,geometry),cache.attributes.set(this.getUID(baseAttribute),target[gltfAttributeName])}targets.push(target),weights.push(mesh.morphTargetInfluences[_i2]),void 0!==mesh.morphTargetDictionary&&targetNames.push(reverseDictionary[_i2])}meshDef.weights=weights,0=camera.far?.001:camera.far,znear:0>camera.near?0:camera.near}:cameraDef.perspective={aspectRatio:camera.aspect,yfov:three__WEBPACK_IMPORTED_MODULE_0__.MathUtils.degToRad(camera.fov),zfar:0>=camera.far?.001:camera.far,znear:0>camera.near?0:camera.near},""!==camera.name&&(cameraDef.name=camera.type),json.cameras.push(cameraDef)-1}/** * Creates glTF animation entry from AnimationClip object. * * Status: * - Only properties listed in PATH_PROPERTIES may be animated. * * @param {THREE.AnimationClip} clip * @param {THREE.Object3D} root * @return {number|null} */processAnimation(clip,root){var json=this.json,nodeMap=this.nodeMap;json.animations||(json.animations=[]),clip=GLTFExporter.Utils.mergeMorphTargetTracks(clip.clone(),root);for(var tracks=clip.tracks,channels=[],samplers=[],i=0;i} input */processInput(input){var options=this.options;input=input instanceof Array?input:[input],this._invokeAll(function(ext){ext.beforeParse&&ext.beforeParse(input)});for(var objectsWithoutScene=[],i=0;itrack.times[track.times.length-1]){if(Math.abs(track.times[track.times.length-1]-time)time){times.set(track.times.slice(0,_i6+1),0),times[_i6+1]=time,times.set(track.times.slice(_i6+1),_i6+2),values.set(track.values.slice(0,(_i6+1)*valueSize),0),values.set(interpolant.evaluate(time),(_i6+1)*valueSize),values.set(track.values.slice((_i6+1)*valueSize),(_i6+2)*valueSize),index=_i6+1;break}}return track.times=times,track.values=values,index},mergeMorphTargetTracks:function mergeMorphTargetTracks(clip,root){for(var tracks=[],mergedTracks={},sourceTracks=clip.tracks,i=0;i { var THREE=__webpack_require__(4),resolveURL=(__webpack_require__(5).resolveURL),Viewport=function(){this.nearPlane=.168248,this.farPlane=6.82906,this.eyePosition=[.5,-2.86496,.5],this.targetPosition=[.5,.5,.5],this.upVector=[0,0,1];var _this=this;this.setFromObject=_ref=>{var{nearPlane,farPlane,eyePosition,targetPosition,upVector}=_ref;_this.nearPlane=nearPlane,_this.farPlane=farPlane,_this.eyePosition=eyePosition,_this.targetPosition=targetPosition,_this.upVector=upVector}},CameraControls=function(object,domElement,renderer,scene){var MODE={NONE:-1,DEFAULT:0,PATH:1,SMOOTH_CAMERA_TRANSITION:2,AUTO_TUMBLE:3,ROTATE_TRANSITION:4,MINIMAP:5,SYNC_CONTROL:6},STATE={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,SCROLL:6},ROTATE_DIRECTION={NONE:-1,FREE:1,HORIZONTAL:2,VERTICAL:3},CLICK_ACTION={};/** * Actions states. * Available states are NONE, ROTATE, ZOOM, PAN, TOUCH_ROTATE, TOUCH_ZOOM, TOUCH_PAN and SCROLL. * @property {Object} */ /** * Available click actions are MAIN, AUXILIARY and SECONARY. * @property {Object} */CLICK_ACTION.MAIN=STATE.ROTATE,CLICK_ACTION.AUXILIARY=STATE.ZOOM,CLICK_ACTION.SECONDARY=STATE.PAN,this.cameraObject=object,this.domElement=domElement===void 0?document:domElement,this.renderer=renderer,this.scene=scene,this.tumble_rate=1.5,this.pointer_x=0,this.pointer_y=0,this.pointer_x_start=0,this.pointer_y_start=0,this.previous_pointer_x=0,this.previous_pointer_y=0,this.near_plane_fly_debt=0,this.touchZoomDistanceStart=0,this.touchZoomDistanceEnd=0,this.directionalLight=0,this.scrollRate=50,this.pixelHeight=1;var duration=6e3,enabled=!0,inbuildTime=0,cameraPath=void 0,numberOfCameraPoint=void 0,updateLightWithPathFlag=!1,playRate=500,deviceOrientationControl=void 0,defaultViewport="default",currentMode=MODE.DEFAULT,smoothCameraTransitionObject=void 0,rotateCameraTransitionObject=void 0,cameraAutoTumbleObject=void 0,mouseScroll=0,rotateMode=ROTATE_DIRECTION.FREE;this._state=STATE.NONE;var zincRayCaster;this.targetTouchId=-1;var rect=void 0,_a=new THREE.Vector3,_b=new THREE.Vector3,_c=new THREE.Vector3,_new_b=new THREE.Vector3,_new_c=new THREE.Vector3,_axis=new THREE.Vector3,_v=new THREE.Vector3,_rel_eye=new THREE.Vector3,sceneSphere=new THREE.Sphere,_tempEye=new THREE.Vector3,ndcControl=void 0,maxDist=0,viewports={default:new Viewport};viewports.default.nearPlane=.1,viewports.default.farPlane=2e3,viewports.default.eyePosition=[0,0,0],viewports.default.targetPosition=[0,0,-1],viewports.default.upVector=[0,1,0],this.cameraObject.target===void 0&&(this.cameraObject.target=new THREE.Vector3(...viewports.default.targetPosition)),this.calculateMaxAllowedDistance=scene=>{var box=scene.getBoundingBox();if(box){box.getBoundingSphere(sceneSphere),maxDist=6*sceneSphere.radius;var currentDist=0;this.cameraObject&&(currentDist=this.cameraObject.position.distanceTo(sceneSphere.center)),maxDist=currentDist>maxDist?currentDist:maxDist}else maxDist=0},this.addViewport=(viewportName,viewport)=>{viewportName&&viewport&&(viewports[viewportName]=viewport)},this.setDefaultViewport=defaultName=>!!(defaultName&&defaultName in viewports)&&(defaultViewport=defaultName,!0),this.getDefaultViewport=()=>defaultViewport,this.getViewportOfName=name=>viewports[name],this.setCurrentViewport=name=>!!(name in viewports)&&(this.setCurrentCameraSettings(viewports[name]),!0),this.setRotationMode=mode=>{switch(mode){case"none":rotateMode=ROTATE_DIRECTION.NONE;break;case"horizontal":rotateMode=ROTATE_DIRECTION.HORIZONTAL;break;case"vertical":rotateMode=ROTATE_DIRECTION.VERTICAL;break;case"free":default:rotateMode=ROTATE_DIRECTION.FREE}},this.onResize=()=>{rect&&(rect=void 0),ndcControl&&ndcControl.setCurrentCameraSettings(this.cameraObject,viewports[defaultViewport])},this.getVisibleHeightAtZDepth=depth=>{// compensate for cameras not positioned at z=0 var cameraOffset=this.cameraObject.position.distanceTo(this.cameraObject.target);depth{var height=this.getVisibleHeightAtZDepth(0);return this.pixelHeight=height/wHeight,this.pixelHeight},this.getNDCFromDocumentCoords=(x,y,positionIn)=>{updateRect(!1);var position=positionIn?positionIn:new THREE.Vector2,out_x=2*((x-rect.left)/rect.width)-1,out_y=2*-((y-rect.top)/rect.height)+1;return position.set(out_x,out_y)},this.getRelativeCoordsFromNDC=(x,y,positionIn)=>{updateRect(!1);var position=positionIn?positionIn:new THREE.Vector2;return position.x=(x+1)*rect.width/2,position.y=(1-y)*rect.height/2,position},this.setMouseButtonAction=(buttonName,actionName)=>{CLICK_ACTION[buttonName]=STATE[actionName]};//Make sure the camera does not travel beyond limit var checkTravelDistance=()=>{if(0newDist||this.cameraObject.position.distanceTo(sceneSphere.center)>newDist}return!0},translateViewport=translation=>{_tempEye.copy(this.cameraObject.position).add(translation),checkTravelDistance()&&(this.cameraObject.target.add(translation),this.cameraObject.position.add(translation),this.updateDirectionalLight())},onDocumentMouseDown=event=>{updateRect(!1);// Check if mouse event hapens inside the minimap var minimapCoordinates;if(currentMode===MODE.DEFAULT&&(minimapCoordinates=this.scene.getNormalisedMinimapCoordinates(this.renderer,event)),!minimapCoordinates)0==event.button?event.ctrlKey?this._state=CLICK_ACTION.AUXILIARY:event.shiftKey?this._state=CLICK_ACTION.SECONDARY:this._state=CLICK_ACTION.MAIN:1==event.button?(event.preventDefault(),this._state=CLICK_ACTION.AUXILIARY):2==event.button&&(this._state=CLICK_ACTION.SECONDARY),this.pointer_x=event.clientX-rect.left,this.pointer_y=event.clientY-rect.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else{currentMode=MODE.MINIMAP;var translation=this.scene.getMinimapDiffFromNormalised(minimapCoordinates.x,minimapCoordinates.y);translateViewport(translation)}},onDocumentMouseMove=event=>{if(updateRect(!1),rect)if(this.pointer_x=event.clientX-rect.left,this.pointer_y=event.clientY-rect.top,currentMode===MODE.MINIMAP){var minimapCoordinates=this.scene.getNormalisedMinimapCoordinates(this.renderer,event);if(minimapCoordinates){var translation=this.scene.getMinimapDiffFromNormalised(minimapCoordinates.x,minimapCoordinates.y);translateViewport(translation)}}else this._state===STATE.NONE&&void 0!==zincRayCaster&&zincRayCaster.move(this,event.clientX,event.clientY,this.renderer)},onDocumentMouseUp=event=>{this._state=STATE.NONE,currentMode==MODE.MINIMAP&&(currentMode=MODE.DEFAULT),zincRayCaster!==void 0&&this.pointer_x_start==event.clientX-rect.left&&this.pointer_y_start==event.clientY-rect.top&&zincRayCaster.pick(this,event.clientX,event.clientY,this.renderer)},onDocumentMouseLeave=event=>{this._state=STATE.NONE},onDocumentTouchStart=event=>{updateRect(!1);var len=event.touches.length;if(1==len)this._state=STATE.TOUCH_ROTATE,this.pointer_x=event.touches[0].clientX-rect.left,this.pointer_y=event.touches[0].clientY-rect.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else if(2==len){this._state=STATE.TOUCH_ZOOM;var dx=event.touches[0].clientX-event.touches[1].clientX,dy=event.touches[0].clientY-event.touches[1].clientY;this.touchZoomDistanceEnd=this.touchZoomDistanceStart=Math.sqrt(dx*dx+dy*dy)}else 3==len&&(this._state=STATE.TOUCH_PAN,this.targetTouchId=event.touches[0].identifier,this.pointer_x=event.touches[0].clientX-rect.left,this.pointer_y=event.touches[0].clientY-rect.top,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y)},onDocumentTouchMove=event=>{event.preventDefault(),event.stopPropagation();var len=event.touches.length;if(1==len)this.pointer_x=event.touches[0].clientX-rect.left,this.pointer_y=event.touches[0].clientY-rect.top;else if(2==len){if(this._state===STATE.TOUCH_ZOOM){var dx=event.touches[0].clientX-event.touches[1].clientX,dy=event.touches[0].clientY-event.touches[1].clientY;this.touchZoomDistanceEnd=Math.sqrt(dx*dx+dy*dy)}}else if(3==len&&this._state===STATE.TOUCH_PAN)for(var i=0;3>i;i++)event.touches[i].identifier==this.targetTouchId&&(this.pointer_x=event.touches[0].clientX-rect.left,this.pointer_y=event.touches[0].clientY-rect.top)},onDocumentTouchEnd=event=>{var len=event.touches.length;this.touchZoomDistanceStart=this.touchZoomDistanceEnd=0,this.targetTouchId=-1,this._state=STATE.NONE,1==len&&zincRayCaster!==void 0&&this.pointer_x_start==event.touches[0].clientX-rect.left&&this.pointer_y_start==event.touches[0].clientY-rect.top&&zincRayCaster.pick(this.cameraObject,event.touches[0].clientX,event.touches[0].clientY,this.renderer)},onDocumentEnter=()=>{updateRect(!0)},updateRect=forced=>{//Use intersectionObserver to reset the rect for ray tracing. if(forced||rect===void 0){var observer=new IntersectionObserver(entries=>{for(var entry of entries)rect=entry.boundingClientRect;observer.disconnect()});observer.observe(this.domElement)}},onDocumentWheelEvent=event=>{updateRect(!1),this._state=STATE.SCROLL;var changes=0;0event.deltaY&&(changes=-1*this.scrollRate),mouseScroll+=changes,event.preventDefault(),event.stopImmediatePropagation()},translate=()=>{if("undefined"!=typeof this.cameraObject){var height=rect.height,distance=this.cameraObject.position.distanceTo(this.cameraObject.target),fact=0;this.cameraObject.far>this.cameraObject.near&&distance>=this.cameraObject.near&&distance<=this.cameraObject.far&&(fact=(distance-this.cameraObject.near)/(this.cameraObject.far-this.cameraObject.near)),_b.set(this.previous_pointer_x,height-this.previous_pointer_y,0),_c.set(this.previous_pointer_x,height-this.previous_pointer_y,1),_new_b.set(this.pointer_x,height-this.pointer_y,0),_new_c.set(this.pointer_x,height-this.pointer_y,1),_b.unproject(this.cameraObject),_c.unproject(this.cameraObject),_new_b.unproject(this.cameraObject),_new_c.unproject(this.cameraObject);var translate_rate=-.002;_new_b.sub(_b).multiplyScalar(1-fact),_new_c.sub(_c).multiplyScalar(fact),_new_b.add(_new_c).multiplyScalar(translate_rate),translateViewport(_new_b)}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y};this.getVectorsFromRotateAboutLookAtPoints=(axis,angle)=>{axis.normalize(),_v.copy(this.cameraObject.position).sub(this.cameraObject.target),_rel_eye.copy(_v),_v.normalize(),.8{var returned_values=this.getVectorsFromRotateAboutLookAtPoints(axis,angle);this.cameraObject.position.copy(returned_values.position),this.updateDirectionalLight(),this.cameraObject.up.copy(returned_values.up)};var tumble=()=>{if("undefined"!=typeof this.cameraObject){var width=rect.width,height=rect.height;if(0radius?_d=radius:_d<-radius&&(_d=-radius)}var phi=Math.acos(d/radius)-.5*Math.PI,angle=this.tumble_rate*tangent_dist/radius;_a.copy(this.cameraObject.position).sub(this.cameraObject.target).normalize(),_b.copy(this.cameraObject.up).normalize(),_c.copy(_b).cross(_a).normalize().multiplyScalar(dx),_b.multiplyScalar(dy),_axis.addVectors(_c,_b).multiplyScalar(Math.cos(phi)),_a.multiplyScalar(Math.sin(phi)),_axis.add(_a),this.rotateAboutLookAtpoint(_axis,-angle)}}}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y},calculateZoomDelta=()=>{var delta=0;return this._state===STATE.ZOOM?delta=this.previous_pointer_y-this.pointer_y:this._state===STATE.SCROLL?delta=mouseScroll:(delta=-1*(this.touchZoomDistanceEnd-this.touchZoomDistanceStart),this.touchZoomDistanceStart=this.touchZoomDistanceEnd),delta};this.changeZoomByScrollRateUnit=unit=>{var delta_y=unit*this.scrollRate;this.changeZoomByValue(delta_y)},this.changeZoomByValue=delta_y=>{if("undefined"!=typeof this.cameraObject){var width=rect.width,height=rect.height,a=this.cameraObject.position.clone();a.sub(this.cameraObject.target);var dist=a.length(),dy=1.5*delta_y/height;if(.01{var delta_y=calculateZoomDelta();this.changeZoomByValue(delta_y),this._state===STATE.ZOOM&&(this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y),this._state===STATE.SCROLL&&(mouseScroll=0,this._state=STATE.NONE)};this.setDirectionalLight=directionalLightIn=>{this.directionalLight=directionalLightIn},this.updateDirectionalLight=()=>{0!=this.directionalLight&&this.directionalLight.position.set(this.cameraObject.position.x,this.cameraObject.position.y,this.cameraObject.position.z)},this.enable=function(){enabled=!0,this.domElement&&this.domElement.addEventListener&&(this.domElement.addEventListener("mousedown",onDocumentMouseDown,!1),this.domElement.addEventListener("mousemove",onDocumentMouseMove,!1),this.domElement.addEventListener("mouseup",onDocumentMouseUp,!1),this.domElement.addEventListener("mouseleave",onDocumentMouseLeave,!1),this.domElement.addEventListener("touchstart",onDocumentTouchStart,!1),this.domElement.addEventListener("touchmove",onDocumentTouchMove,!1),this.domElement.addEventListener("touchend",onDocumentTouchEnd,!1),this.domElement.addEventListener("wheel",onDocumentWheelEvent,!1),this.domElement.addEventListener("contextmenu",event=>{event.preventDefault()},!1),this.domElement.addEventListener("mouseenter",onDocumentEnter,!1))},this.disable=function(){enabled=!1,this.domElement&&this.domElement.removeEventListener&&(this.domElement.removeEventListener("mousedown",onDocumentMouseDown,!1),this.domElement.removeEventListener("mousemove",onDocumentMouseMove,!1),this.domElement.removeEventListener("mouseup",onDocumentMouseUp,!1),this.domElement.removeEventListener("mouseleave",onDocumentMouseLeave,!1),this.domElement.removeEventListener("touchstart",onDocumentTouchStart,!1),this.domElement.removeEventListener("touchmove",onDocumentTouchMove,!1),this.domElement.removeEventListener("touchend",onDocumentTouchEnd,!1),this.domElement.removeEventListener("wheel",onDocumentWheelEvent,!1),this.domElement.removeEventListener("mouseenter",onDocumentEnter,!1),this.domElement.removeEventListener("contextmenu",event=>{event.preventDefault()},!1))},this.loadPath=pathData=>{cameraPath=pathData.CameraPath,numberOfCameraPoint=pathData.NumberOfPoints},this.loadPathURL=(path_url,finishCallback)=>{var xmlhttp=new XMLHttpRequest;xmlhttp.onreadystatechange=()=>{if(4==xmlhttp.readyState&&200==xmlhttp.status){var pathData=JSON.parse(xmlhttp.responseText);this.loadPath(pathData),finishCallback!=null&&"function"==typeof finishCallback&&finishCallback()}};var requestURL=resolveURL(path_url);xmlhttp.open("GET",requestURL,!0),xmlhttp.send()},this.setPathDuration=durationIn=>{duration=durationIn,smoothCameraTransitionObject&&smoothCameraTransitionObject.setDuration(duration),rotateCameraTransitionObject&&rotateCameraTransitionObject.setDuration(duration)},this.getPlayRate=()=>playRate,this.setPlayRate=playRateIn=>{playRate=playRateIn};/** * Update the internal timer by the set amount, this can * be used to force a time update by setting delta to zero. * * @param {Number} delta - The amount of time to increment * the time by. */var updateTime=delta=>{var targetTime=inbuildTime+delta;targetTime>duration&&(targetTime-=duration),inbuildTime=targetTime};/** * Get the current inbuild time, * * @return {Number} */this.getTime=()=>inbuildTime,this.setTime=timeIn=>{inbuildTime=timeIn>duration?duration:0>timeIn?0:timeIn},this.getNumberOfTimeFrame=()=>numberOfCameraPoint,this.getCurrentTimeFrame=()=>{if(2{2inbuildTime&&(inbuildTime=0),inbuildTime>duration&&(inbuildTime=duration))};/** * Update the progress on the path by the specified amount - delta. * * @param {Number} delta - The amount of time to increment */var updatePath=delta=>{if(currentMode===MODE.PATH&&(updateTime(delta),cameraPath)){for(var time_frame=this.getCurrentTimeFrame(),bottom_frame=time_frame[0],top_frame=time_frame[1],proportion=time_frame[2],bot_pos=[cameraPath[3*bottom_frame],cameraPath[3*bottom_frame+1],cameraPath[3*bottom_frame+2]],top_pos=[cameraPath[3*top_frame],cameraPath[3*top_frame+1],cameraPath[3*top_frame+2]],current_positions=[],i=0;i{updatePath(0)};// handle synchronised control based on information in the idc var handleSyncControl=()=>{this._state===STATE.ROTATE||this._state===STATE.TOUCH_ROTATE?tumble():this._state===STATE.PAN||this._state===STATE.TOUCH_PAN?(translate(),ndcControl.triggerCallback()):(this._state===STATE.ZOOM||this._state===STATE.TOUCH_ZOOM||this._state===STATE.SCROLL)&&(ndcControl.zoom(calculateZoomDelta()),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,this._state===STATE.SCROLL&&(this._state=STATE.NONE),mouseScroll=0,ndcControl.triggerCallback())};/** * Update all controls related changes - including calculation of the viewport. * * @param {Number} timeChanged - Time eclipse since last called. */ /** * Switch to path mode and begin traveling through the camera path. */ /** * Stop playing path and switch back to normal control. */ /** * Check rather the control is currently in path mode. * * @return {Boolean} */ /** * Enable directional light update as the camera * is traveling through path. * * @param {Boolean} flag */ /** * Enable rotation using the devices's accelerometer. */ /** * Disable rotation using the devices's accelerometer. */ /** * Check rather device orientation based on accelerometer is on. */ /** * Reset the viewport settings to the one provided by default viewport. */ /** * Set the current camera settings with the provided viewport. * * @param {Viewport} newViewport - viewport settings. */ /** * Get the viewport based on centre, radius, view_angle and clip distance. * * @param {Number} centreX - x coordinate of the centre. * @param {Number} centreY - y coordinate of the centre. * @param {Number} centreZ - z coordinate of the centre. * @param {Number} radius - radius if the viewport. * @param {Number} view_angle - view angle. * @param {Number} clip_distance - clip_distance between the near and far plane. * * @return {Viewport} */ /** * Get the viewport for the boudning box * * @param {Number} boundingBox - y coordinate of the centre. * @return {Viewport} */ /** * Get the current camera viewport. * * @return {Viewport} */ /** * Setup a smooth transition object which transition the camera from one * viewport to the other in the specified duration. This will not work if * {@link rotateCameraTransition} is active. * To use this object, the transition must be enabled using * {@link enableCameraTransition}. * * @param {Viewport} startingViewport - the starting viewport * @param {Viewport} endingViewport - the viewport ti end the transistion with. * @param {Number} durationIn - duration of the smooth transition. */ /** * Setup a rotate camera transition object which rotate the * camera by the specified the angle in the specified * duration. This will not work if {@link cameraTransition} * is active. * To use this object, the transition must be enabled using * {@link enableCameraTransition}. * * @param {THREE.Vector3} axis - the starting viewport * @param {Number} angle - the viewport ti end the transistion with. * @param {Number} duration - duration of the smooth transition. */ /** * Enable camera transition, {@link rotateCameraTransition} amd * {@link cameraTransition} must be called before camera transition can * be enabled. */ /** * Pause the camera transition. */ /** * Stop the camera transition and remove camera transition * and rotate camera transition. */ /** * Check if camera transition is active. */ /** * Setup auto tumble object of the camera which will rotate the camera * around the target as if the user is rotating the camera by mouse/touch * interaction. * The tumbling will only be enabled with {@link enabelAutoTumble}. * * @param {Array} tumbleDirectionIn - direction of the mouse/touch. * @param {Number} tumbleRateIn - Speed of the tumbling. * @param {Boolean} stopOnCameraInputIn - Disable the tumbling once the user * start interacting with the scene. */ /** * Enable autotumble. */ /** * Disable the autotumble. */ /** * Update the autotumble object. */ /** * Check rather autotumble is active. * * @return {Boolean} */ /** * Create an internal raycaster object and enable it for picking. * * @param {Scene} sceneIn - The scene to pick from, it can be different from the * camera's scene. * @param {requestCallback} callbackFunctionIn - The callback for pick event. * @param {requestCallback} hoverCallbackFunctionIn - The callback for hover * over event. */ /** * Disable raycaster and remove the internal ray caster object. */ /** * Check rather the camera is in syncControl mode. * * @return {Boolean} */ /** * Enable syncControl. */ /** * Disable syncControl. */this.update=timeChanged=>{var delta=timeChanged*playRate,controlEnabled=enabled,updated=!0;return currentMode===MODE.PATH?updatePath(delta):currentMode===MODE.SMOOTH_CAMERA_TRANSITION&&smoothCameraTransitionObject?(smoothCameraTransitionObject.update(delta),smoothCameraTransitionObject.isTransitionCompleted()&&(null==smoothCameraTransitionObject,currentMode=MODE.DEFAULT),controlEnabled=!1):currentMode===MODE.ROTATE_CAMERA_TRANSITION&&rotateCameraTransitionObject?(rotateCameraTransitionObject.update(delta),rotateCameraTransitionObject.isTransitionCompleted()&&(null==rotateCameraTransitionObject,currentMode=MODE.DEFAULT),controlEnabled=!1):currentMode===MODE.AUTO_TUMBLE&&cameraAutoTumbleObject?cameraAutoTumbleObject.update(delta):currentMode===MODE.SYNC_CONTROL&&ndcControl?(handleSyncControl(),controlEnabled=!1):updated=!1,controlEnabled&&(this._state!==STATE.NONE&&(updated=!0),this._state===STATE.ROTATE||this._state===STATE.TOUCH_ROTATE?tumble():this._state===STATE.PAN||this._state===STATE.TOUCH_PAN?translate():(this._state===STATE.ZOOM||this._state===STATE.TOUCH_ZOOM||this._state===STATE.SCROLL)&&flyZoom(),this._state!==STATE.NONE&¤tMode===MODE.AUTO_TUMBLE&&cameraAutoTumbleObject&&cameraAutoTumbleObject.stopOnCameraInput,this._state===STATE.SCROLL&&(this._state=STATE.NONE)),deviceOrientationControl?(updated=!0,deviceOrientationControl.update()):this.cameraObject.lookAt(this.cameraObject.target),updated},this.playPath=()=>{currentMode=MODE.PATH},this.stopPath=()=>{currentMode=MODE.DEFAULT},this.isPlayingPath=()=>currentMode===MODE.PATH,this.enableDirectionalLightUpdateWithPath=flag=>{updateLightWithPathFlag=flag},this.enableDeviceOrientation=()=>{deviceOrientationControl||(deviceOrientationControl=new ModifiedDeviceOrientationControls(this.cameraObject))},this.disableDeviceOrientation=()=>{deviceOrientationControl&&(deviceOrientationControl.dispose(),deviceOrientationControl=void 0)},this.isDeviceOrientationEnabled=()=>!!deviceOrientationControl,this.resetView=()=>{var viewport=viewports[defaultViewport];this.cameraObject.near=viewport.nearPlane,this.cameraObject.far=viewport.farPlane,this.cameraObject.position.set(viewport.eyePosition[0],viewport.eyePosition[1],viewport.eyePosition[2]),this.cameraObject.target.set(viewport.targetPosition[0],viewport.targetPosition[1],viewport.targetPosition[2]),this.cameraObject.up.set(viewport.upVector[0],viewport.upVector[1],viewport.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.setCurrentCameraSettings=newViewport=>{newViewport.nearPlane&&(this.cameraObject.near=newViewport.nearPlane),newViewport.farPlane&&(this.cameraObject.far=newViewport.farPlane),newViewport.eyePosition&&this.cameraObject.position.set(newViewport.eyePosition[0],newViewport.eyePosition[1],newViewport.eyePosition[2]),newViewport.targetPosition&&this.cameraObject.target.set(newViewport.targetPosition[0],newViewport.targetPosition[1],newViewport.targetPosition[2]),newViewport.upVector&&this.cameraObject.up.set(newViewport.upVector[0],newViewport.upVector[1],newViewport.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.getViewportFromCentreAndRadius=(centreX,centreY,centreZ,radius,view_angle,clip_distance)=>{var eyex=this.cameraObject.position.x-this.cameraObject.target.x,eyey=this.cameraObject.position.y-this.cameraObject.target.y,eyez=this.cameraObject.position.z-this.cameraObject.target.z,fact=1/Math.sqrt(eyex*eyex+eyey*eyey+eyez*eyez);eyex*=fact,eyey*=fact,eyez*=fact;/* look at the centre of the sphere */var localTargetPosition=[centreX,centreY,centreZ],eye_distance=radius/Math.tan(view_angle*Math.PI/360),localEyePosition=[centreX+eyex*eye_distance,centreY+eyey*eye_distance,centreZ+eyez*eye_distance],localFarPlane=eye_distance+clip_distance,localNearPlane=0,nearClippingFactor=.95;/* shift the eye position to achieve the desired view_angle */localNearPlane=clip_distance>nearClippingFactor*eye_distance?(1-nearClippingFactor)*eye_distance:eye_distance-clip_distance;var newViewport=new Viewport;return newViewport.nearPlane=localNearPlane,newViewport.farPlane=localFarPlane,newViewport.eyePosition=localEyePosition,newViewport.targetPosition=localTargetPosition,newViewport.upVector=[this.cameraObject.up.x,this.cameraObject.up.y,this.cameraObject.up.z],newViewport},this.getViewportFromBoundingBox=(boundingBox,radiusScale)=>{var radius=boundingBox.min.distanceTo(boundingBox.max)/2*radiusScale,centreX=(boundingBox.min.x+boundingBox.max.x)/2,centreY=(boundingBox.min.y+boundingBox.max.y)/2,centreZ=(boundingBox.min.z+boundingBox.max.z)/2,clip_factor=4,viewport=this.getViewportFromCentreAndRadius(centreX,centreY,centreZ,radius,40,radius*clip_factor);return viewport},this.getCurrentViewport=()=>{var currentViewport=new Viewport;return currentViewport.nearPlane=this.cameraObject.near,currentViewport.farPlane=this.cameraObject.far,currentViewport.eyePosition[0]=this.cameraObject.position.x,currentViewport.eyePosition[1]=this.cameraObject.position.y,currentViewport.eyePosition[2]=this.cameraObject.position.z,currentViewport.targetPosition[0]=this.cameraObject.target.x,currentViewport.targetPosition[1]=this.cameraObject.target.y,currentViewport.targetPosition[2]=this.cameraObject.target.z,currentViewport.upVector[0]=this.cameraObject.up.x,currentViewport.upVector[1]=this.cameraObject.up.y,currentViewport.upVector[2]=this.cameraObject.up.z,currentViewport},this.getDefaultEyePosition=()=>eyePosition,this.getDefaultTargetPosition=()=>targetPosition,this.cameraTransition=(startingViewport,endingViewport,durationIn)=>{rotateCameraTransitionObject==null&&(smoothCameraTransitionObject=new SmoothCameraTransition(startingViewport,endingViewport,this,durationIn))},this.rotateCameraTransition=(axis,angle,duration)=>{smoothCameraTransitionObject==null&&(rotateCameraTransitionObject=new RotateCameraTransition(axis,angle,this,duration))},this.enableCameraTransition=()=>{smoothCameraTransitionObject&&(currentMode=MODE.SMOOTH_CAMERA_TRANSITION),rotateCameraTransitionObject&&(currentMode=MODE.ROTATE_CAMERA_TRANSITION)},this.pauseCameraTransition=()=>{currentMode=MODE.DEFAULT},this.stopCameraTransition=()=>{currentMode=MODE.DEFAULT,smoothCameraTransitionObject=void 0,rotateCameraTransitionObject=void 0},this.isTransitioningCamera=()=>currentMode===MODE.SMOOTH_CAMERA_TRANSITION||currentMode===MODE.ROTATE_CAMERA_TRANSITION,this.autoTumble=(tumbleDirectionIn,tumbleRateIn,stopOnCameraInputIn)=>{cameraAutoTumbleObject=new CameraAutoTumble(tumbleDirectionIn,tumbleRateIn,stopOnCameraInputIn,this)},this.enableAutoTumble=()=>{currentMode=MODE.AUTO_TUMBLE},this.stopAutoTumble=()=>{currentMode=MODE.DEFAULT,cameraAutoTumbleObject=void 0},this.updateAutoTumble=()=>{cameraAutoTumbleObject&&(cameraAutoTumbleObject.requireUpdate=!0)},this.isAutoTumble=()=>currentMode===MODE.AUTO_TUMBLE,this.enableRaycaster=(sceneIn,callbackFunctionIn,hoverCallbackFunctionIn)=>{zincRayCaster==null&&(zincRayCaster=new RayCaster(sceneIn,this.scene,callbackFunctionIn,hoverCallbackFunctionIn,this.renderer))},this.disableRaycaster=()=>{zincRayCaster.disable(),zincRayCaster=void 0},this.isSyncControl=()=>currentMpde===MODE.SYNC_CONTROL,this.enableSyncControl=()=>(currentMode=MODE.SYNC_CONTROL,ndcControl||(ndcControl=new NDCCameraControl),ndcControl.setCurrentCameraSettings(this.cameraObject,viewports[defaultViewport]),ndcControl),this.disableSyncControl=()=>{currentMode=MODE.DEFAULT,this.cameraObject.zoom=1,this.cameraObject.updateProjectionMatrix()},this.enable()},SmoothCameraTransition=function SmoothCameraTransition(startingViewport,endingViewport,targetCameraIn,durationIn){var startingEyePosition=startingViewport.eyePosition,startingTargetPosition=startingViewport.targetPosition,startingUp=startingViewport.upVector,endingEyePosition=endingViewport.eyePosition,endingTargetPosition=endingViewport.targetPosition,endingUp=endingViewport.upVector,targetCamera=targetCameraIn,duration=durationIn,inbuildTime=0,enabled=!0,updateLightWithPathFlag=!0,completed=!1;targetCamera.near=Math.min(startingViewport.nearPlane,endingViewport.nearPlane),targetCamera.far=Math.max(startingViewport.farPlane,endingViewport.farPlane),targetCamera.cameraObject.up.set(endingViewport.upVector[0],endingViewport.upVector[1],endingViewport.upVector[2]),this.setDuration=newDuration=>{duration=newDuration};var updateTime=delta=>{var targetTime=inbuildTime+delta;targetTime>duration&&(targetTime=duration),inbuildTime=targetTime},updateCameraSettings=()=>{var ratio=inbuildTime/duration,eyePosition=[startingEyePosition[0]*(1-ratio)+endingEyePosition[0]*ratio,startingEyePosition[1]*(1-ratio)+endingEyePosition[1]*ratio,startingEyePosition[2]*(1-ratio)+endingEyePosition[2]*ratio],targetPosition=[startingTargetPosition[0]*(1-ratio)+endingTargetPosition[0]*ratio,startingTargetPosition[1]*(1-ratio)+endingTargetPosition[1]*ratio,startingTargetPosition[2]*(1-ratio)+endingTargetPosition[2]*ratio],upVector=[startingUp[0]*(1-ratio)+endingUp[0]*ratio,startingUp[1]*(1-ratio)+endingUp[1]*ratio,startingUp[2]*(1-ratio)+endingUp[2]*ratio];targetCamera.cameraObject.position.set(eyePosition[0],eyePosition[1],eyePosition[2]),targetCamera.cameraObject.target.set(targetPosition[0],targetPosition[1],targetPosition[2])};this.update=delta=>{!1===this.enabled||(updateTime(delta),updateCameraSettings(),inbuildTime==duration&&(completed=!0))},this.isTransitionCompleted=()=>completed},RotateCameraTransition=function RotateCameraTransition(axisIn,angleIn,targetCameraIn,durationIn){var axis=axisIn,angle=angleIn,targetCamera=targetCameraIn,duration=durationIn,inbuildTime=0,enabled=!0,ratio=inbuildTime/duration,completed=!1;this.setDuration=newDuration=>{duration=newDuration};var updateCameraSettings=delta=>{var previousTime=inbuildTime,targetTime=inbuildTime+delta;targetTime>duration&&(targetTime=duration),inbuildTime=targetTime;var actualDelta=inbuildTime-previousTime,ratio=actualDelta/duration,alpha=ratio*angle;targetCamera.rotateAboutLookAtpoint(axis,alpha)};this.update=delta=>{!1===this.enabled||(updateCameraSettings(delta),inbuildTime==duration&&(completed=!0))},this.isTransitionCompleted=()=>completed},RayCaster=function RayCaster(sceneIn,hostSceneIn,callbackFunctionIn,hoverCallbackFunctionIn,rendererIn){var scene=sceneIn,hostScene=hostSceneIn,renderer=rendererIn,callbackFunction=callbackFunctionIn,hoverCallbackFunction=hoverCallbackFunctionIn,enabled=!0,raycaster=new THREE.Raycaster;raycaster.params.Line.threshold=.1,raycaster.params.Points.threshold=1;var mouse=new THREE.Vector2,awaiting=!1,lastHoveredDate=new Date,lastHoveredEmpty=!1,timeDiff=0,pickedObjects=[],lastPosition={zincCamera:void 0,x:-1,y:-1},pickableObjects=void 0;this.enable=()=>{enable=!0},this.disable=()=>{enable=!1},this.getIntersectsObject=zincCamera=>{if(hostScene!==scene){var threejsScene=scene.getThreeJSScene();renderer.render(threejsScene,zincCamera.cameraObject)}var objects=pickableObjects?pickableObjects:scene.getPickableThreeJSObjects();//Reset pickedObjects array return pickedObjects.length=0,raycaster.intersectObjects(objects,!0,pickedObjects)},this.setPickableObjects=zincObjects=>{zincObjects===void 0?pickableObjects=void 0:(pickableObjects=[],zincObjects.forEach(zincObject=>{zincObject.getGroup()&&zincObject.getGroup().visible&&pickableObjects.push(zincObject.getGroup())}))},this.getIntersectsObjectWithOrigin=(zincCamera,origin,direction)=>(raycaster.set(origin,direction),this.getIntersectsObject(zincCamera)),this.getIntersectsObjectWithCamera=(zincCamera,x,y)=>(zincCamera.getNDCFromDocumentCoords(x,y,mouse),raycaster.setFromCamera(mouse,zincCamera.cameraObject),this.getIntersectsObject(zincCamera)),this.pick=(zincCamera,x,y)=>{if(enabled&&renderer&&scene&&zincCamera&&callbackFunction){this.getIntersectsObjectWithCamera(zincCamera,x,y);for(var zincObject,length=pickedObjects.length,i=0;i{if(enabled&&renderer&&scene&&zincCamera&&hoverCallbackFunction){if(this.getIntersectsObjectWithCamera(zincCamera,x,y),lastHoveredDate.setTime(Date.now()),0===pickedObjects.length){//skip hovered callback if the previous one is empty if(lastHoveredEmpty)return;lastHoveredEmpty=!0}else lastHoveredEmpty=!1;hoverCallbackFunction(pickedObjects,x,y)}};this.move=(zincCamera,x,y)=>{enabled&&renderer&&scene&&zincCamera&&hoverCallbackFunction&&(scene.displayMarkers?hovered(zincCamera,x,y):(lastPosition.zincCamera=zincCamera,lastPosition.x=x,lastPosition.y=y,!awaiting&&(timeDiff=lastHoveredDate?Date.now()-lastHoveredDate.getTime():250,250<=timeDiff?hovered(zincCamera,x,y):(awaiting=!0,setTimeout(awaitMove(lastPosition),timeDiff)))))};var awaitMove=lastPosition=>function(){awaiting=!1,hovered(lastPosition.zincCamera,lastPosition.x,lastPosition.y)}},CameraAutoTumble=function CameraAutoTumble(tumbleDirectionIn,tumbleRateIn,stopOnCameraInputIn,targetCameraIn){var tumbleAxis=new THREE.Vector3,angle=-tumbleRateIn,targetCamera=targetCameraIn,enabled=!0,updateLightWithPathFlag=!0,tumbleDirection=tumbleDirectionIn;this.stopOnCameraInput=stopOnCameraInputIn,this.requireUpdate=!0;var b=new THREE.Vector3,c=new THREE.Vector3,computeTumbleAxisAngle=tumbleDirection=>{var tangent_dist=Math.sqrt(tumbleDirection[0]*tumbleDirection[0]+tumbleDirection[1]*tumbleDirection[1]),width=4*Math.abs(tumbleDirection[0]),height=4*Math.abs(tumbleDirection[1]),radius=.25*(width+height),dx=-tumbleDirection[1]/tangent_dist,dy=tumbleDirection[0]/tangent_dist,d=dx*tumbleDirection[0]+dy*-tumbleDirection[1];d>radius?d=radius:d<-radius&&(d=-radius);var phi=Math.acos(d/radius)-.5*Math.PI;/* get axis to rotate about */tumbleAxis.copy(targetCamera.cameraObject.position).sub(targetCamera.cameraObject.target).normalize(),b.copy(targetCamera.cameraObject.up).normalize(),c.crossVectors(b,tumbleAxis).normalize().multiplyScalar(dx),b.multiplyScalar(dy),b.add(c).multiplyScalar(Math.cos(phi)),tumbleAxis.multiplyScalar(Math.sin(phi)).add(b)};this.update=delta=>{!1===this.enabled||(this.requireUpdate&&(computeTumbleAxisAngle(tumbleDirection),this.requireUpdate=!1),targetCamera.rotateAboutLookAtpoint(tumbleAxis,angle*delta/1e3))}},StereoCameraZoomFixed=function StereoCameraZoomFixed(){this.type="StereoCamera",this.aspect=1,this.cameraL=new THREE.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new THREE.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1};/** * Object with containg viewport information used in ZincJS. * * @class * @author Alan Wu * @return {Viewport} */ /** * Provides the basic controls for a scene. * * @class * @author Alan Wu * @return {CameraControls} */ /** * @author mrdoob / http://mrdoob.com/ */Object.assign(StereoCameraZoomFixed.prototype,{update:(()=>{var focus,fov,aspect,near,far,zoom,eyeRight=new THREE.Matrix4,eyeLeft=new THREE.Matrix4;return function update(camera){var needsUpdate=focus!==camera.focus||fov!==camera.fov||aspect!==camera.aspect*this.aspect||near!==camera.near||far!==camera.far||zoom!==camera.zoom;if(needsUpdate){focus=camera.focus,fov=camera.fov,aspect=camera.aspect*this.aspect,near=camera.near,far=camera.far,zoom=camera.zoom;// Off-axis stereoscopic effect based on // http://paulbourke.net/stereographics/stereorender/ var xmin,xmax,projectionMatrix=camera.projectionMatrix.clone(),eyeSep=.064/2,eyeSepOnProjection=eyeSep*near/focus,ymax=near*Math.tan(.5*(THREE.Math.DEG2RAD*fov))/camera.zoom;// translate xOffset // for left eye // for right eye eyeLeft.elements[12]=-eyeSep,eyeRight.elements[12]=eyeSep,xmin=-ymax*aspect+eyeSepOnProjection,xmax=ymax*aspect+eyeSepOnProjection,projectionMatrix.elements[0]=2*near/(xmax-xmin),projectionMatrix.elements[8]=(xmax+xmin)/(xmax-xmin),this.cameraL.projectionMatrix.copy(projectionMatrix),xmin=-ymax*aspect-eyeSepOnProjection,xmax=ymax*aspect-eyeSepOnProjection,projectionMatrix.elements[0]=2*near/(xmax-xmin),projectionMatrix.elements[8]=(xmax+xmin)/(xmax-xmin),this.cameraR.projectionMatrix.copy(projectionMatrix)}this.cameraL.matrixWorld.copy(camera.matrixWorld).multiply(eyeLeft),this.cameraR.matrixWorld.copy(camera.matrixWorld).multiply(eyeRight)}})()});/** the following StereoEffect is written by third party */ /** * @author alteredq / http://alteredqualia.com/ * @authod mrdoob / http://mrdoob.com/ * @authod arodic / http://aleksandarrodic.com/ * @authod fonserbc / http://fonserbc.github.io/ */var StereoEffect=function StereoEffect(renderer){var _stereo=new StereoCameraZoomFixed;_stereo.aspect=.5,this.setSize=(width,height)=>{renderer.setSize(width,height)},this.render=(scene,camera)=>{scene.updateMatrixWorld(),null===camera.parent&&camera.updateMatrixWorld(),_stereo.update(camera);var size=renderer.getSize();renderer.setScissorTest(!0),renderer.clear(),renderer.setScissor(0,0,size.width/2,size.height),renderer.setViewport(0,0,size.width/2,size.height),renderer.render(scene,_stereo.cameraL),renderer.setScissor(size.width/2,0,size.width/2,size.height),renderer.setViewport(size.width/2,0,size.width/2,size.height),renderer.render(scene,_stereo.cameraR),renderer.setScissorTest(!1)}},ModifiedDeviceOrientationControls=function ModifiedDeviceOrientationControls(object){var scope=this;this.object=object,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0;var onDeviceOrientationChangeEvent=event=>{scope.deviceOrientation=event},onScreenOrientationChangeEvent=()=>{"undefined"!=typeof window&&(scope.screenOrientation=window.orientation||0)},setObjectQuaternion=(()=>{var zee=new THREE.Vector3(0,0,1),euler=new THREE.Euler,q0=new THREE.Quaternion,q1=new THREE.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));// - PI/2 around the x-axis return(cameraObject,alpha,beta,gamma,orient)=>{var vector=new THREE.Vector3(0,0,1);vector.subVectors(cameraObject.target,cameraObject.position),euler.set(beta,alpha,-gamma,"YXZ");// 'ZXY' for the device, but 'YXZ' for us var quaternion=new THREE.Quaternion;// orient the device // camera looks out the back of the device, not the top // adjust for screen orientation quaternion.setFromEuler(euler),quaternion.multiply(q1),quaternion.multiply(q0.setFromAxisAngle(zee,-orient)),vector.applyQuaternion(quaternion),vector.addVectors(cameraObject.position,vector),cameraObject.lookAt(vector)}})();// The angles alpha, beta and gamma form a set of intrinsic Tait-Bryan angles of type Z-X'-Y'' this.connect=()=>{onScreenOrientationChangeEvent(),"undefined"!=typeof window&&(window.addEventListener("orientationchange",onScreenOrientationChangeEvent,!1),window.addEventListener("deviceorientation",onDeviceOrientationChangeEvent,!1)),scope.enabled=!0},this.disconnect=()=>{"undefined"!=typeof window&&(window.removeEventListener("orientationchange",onScreenOrientationChangeEvent,!1),window.removeEventListener("deviceorientation",onDeviceOrientationChangeEvent,!1)),scope.enabled=!1},this.update=()=>{if(!1!==scope.enabled){// Z // X' // Y'' // O var alpha=scope.deviceOrientation.alpha?THREE.Math.degToRad(scope.deviceOrientation.alpha):0,beta=scope.deviceOrientation.beta?THREE.Math.degToRad(scope.deviceOrientation.beta):0,gamma=scope.deviceOrientation.gamma?THREE.Math.degToRad(scope.deviceOrientation.gamma):0,orient=scope.screenOrientation?THREE.Math.degToRad(scope.screenOrientation):0;setObjectQuaternion(scope.object,alpha,beta,gamma,orient)}},this.dispose=function(){this.disconnect()},this.connect()},NDCCameraControl=function NDCCameraControl(){var camera=void 0,targetCamera=void 0,defaultViewport=void 0,position=new THREE.Vector3,target=new THREE.Vector3,v1=new THREE.Vector3,v2=new THREE.Vector3,eventCallback=void 0;//return top left and size this.setCurrentCameraSettings=(cameraIn,defaultViewportIn)=>{camera=cameraIn.clone(),targetCamera=cameraIn,defaultViewport=defaultViewportIn,camera.near=defaultViewport.nearPlane,defaultViewport.farPlane&&(camera.far=defaultViewport.farPlane),defaultViewport.eyePosition&&camera.position.set(defaultViewport.eyePosition[0],defaultViewport.eyePosition[1],defaultViewport.eyePosition[2]),defaultViewport.upVector&&camera.up.set(defaultViewport.upVector[0],defaultViewport.upVector[1],defaultViewport.upVector[2]),defaultViewport.targetPosition&&(camera.target=new THREE.Vector3(defaultViewport.targetPosition[0],defaultViewport.targetPosition[1],defaultViewport.targetPosition[2]),camera.lookAt(camera.target)),camera.updateProjectionMatrix(),position.copy(camera.position).project(camera),target.copy(camera.target).project(camera)},this.getCurrentPosition=()=>(target.copy(targetCamera.target).project(camera),[target.x,target.y]),this.zoom=delta=>{var scaledDelta=.002*delta,zoom=Math.max(targetCamera.zoom-scaledDelta,1);targetCamera.zoom=zoom,targetCamera.updateProjectionMatrix()},this.zoomToBox=(box,zoom)=>{box.getCenter(v1),v1.project(camera),this.setCenterZoom([v1.x,v1.y],zoom)},this.getPanZoom=()=>({target:this.getCurrentPosition(),zoom:targetCamera.zoom}),this.setCenterZoom=(center,zoom)=>{v1.set(center[0],center[1],target.z).unproject(camera),v2.copy(v1).sub(targetCamera.target),targetCamera.target.copy(v1),targetCamera.lookAt(targetCamera.target),targetCamera.position.add(v2),targetCamera.zoom=zoom,targetCamera.updateProjectionMatrix()},this.setEventCallback=callback=>{(callback===void 0||"function"==typeof callback)&&(eventCallback=callback)},this.triggerCallback=()=>{eventCallback!==void 0&&"function"==typeof eventCallback&&eventCallback()}};/** * @author richt / http://richt.me * @author WestLangley / http://github.com/WestLangley * * W3C Device Orientation control (http://w3c.github.io/deviceorientation/spec-source-orientation.html) */exports.Viewport=Viewport,exports.CameraControls=CameraControls,exports.SmoothCameraTransition=SmoothCameraTransition,exports.RotateCameraTransition=RotateCameraTransition,exports.RayCaster=RayCaster,exports.CameraAutoTumble=CameraAutoTumble,exports.StereoEffect=StereoEffect,exports.NDCCameraControl=NDCCameraControl; /***/ }), /* 44 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var{Group,Matrix4}=__webpack_require__(4),Pointset=(__webpack_require__(22).Pointset),Lines=(__webpack_require__(24).Lines),Lines2=(__webpack_require__(45).Lines2),Geometry=(__webpack_require__(3).Geometry),THREE=__webpack_require__(4),uniqueiId=0,getUniqueId=function(){return"re"+uniqueiId++},Region=function(parentIn,sceneIn){var parent=parentIn,group=new Group;group.matrixAutoUpdate=!1,group.userData=this;var children=[],name="",zincObjects=[],scene=sceneIn,tMatrix=new Matrix4,duration=3e3;/** * Hide all primitives belong to this region. */ /** * Show all primitives belong to this region. */ /** * Set the visibility and propagate it down the hierarchies * depending on the flag. * * @param {Boolean} flag - A flag indicating either the visibilty to be on/off. */ /** * Get the visibility of the region and its children. * * @return {Boolean} */ /** * Get the {THREE.Group} containing all child regions and their * primitives. * * @return {THREE.Group} */ /** * Set the transformation with a {THREE.Matrix4} matrix, this will affect * all primitives in this and its child regions * * @param {THREE.Matrix4} transformation - The transformation matrix * used for the transformation. */ /** * Set the name of this region. * * @param {String} nameIn - Name to be set for this region. It must be defined * and non-empty. */ /** * Get the name of this region. * * @return {String} */ /** * Get the parent region. * * @return {Region} */ /** * Get the array of each hierarachy from the root region to this region. * * @return {Array} */ /** * Get the full paths from the root region to this region. * * @return {String} */ /** * Create a new child region with the provided name. * @param {String} nameIn - Name to be set for the new child region. * * @return {Region} */ /** * Get the child region with matching childName. * @param {String} childName - Name to be matched. * * @return {Region} */ /** * Find a child region using the path array. * @param {Array} pathArray - Array containing regions' name at each * hierarchy to match. * * @return {Region} */ /** * Find the region using the provided relative path. * * @param {String} path - Relative paths from this region * to the child region. * * @return {Region} */ /** * Create a new child using the path array. All required new regions * down the path will be created. * * @param {Array} pathArray - Array containing regions' name, new regions * will be created along the path if not found. * * @return {Region} */ /** * Create a new child using the path. All required new regions * down the path will be created. * * @param {String} path - Relative paths from the region * to the child region. * * @return {Region} */ /** * Return existing region if it exists, otherwise, create a new * region with the provided path. * * @param {String} path - Relative paths from the region * to the child region. * * @return {Region} */ /** * Add a zinc object into this region, the morph will be added * to the group. * * @param {ZincObject} zincObject - Zinc object to be added into * this region. */ /** * Remove a ZincObject from this region if it presents. This will eventually * destroy the object and free up the memory. * * @param {ZincObject} zincObject - object to be removed from this region. */ /** * Return true if pickable objects require an update. * * @param {Boolean} transverse - Check child regions as well * if this is set to true. * * @return {Boolean} */ /** * Get all pickable objects. */ /** * Set the default duration value for all zinc objects * that are to be loaded into this region. * * @param {Number} durationIn - duration of the scene. */ /** * Get the default duration value. * returns {Number} */ /** * Get the bounding box of all the object in this and child regions only. * Do not include the matrix transformation here, it is done at the primitives * level. * * @returns {THREE.Box3} */ /** * Clear and dispose all objects belong to this region. * * @param {Boolean} transverse - Clear and dispose child regions as well * if this is set to true. */ /** * Check if a zincObject is a member of this region. * * @param {ZincObject} zincObject - The ZincObject to be checked. * @param {Boolean} transverse - Also check the child regions. * * @return {Boolean} */ /** * A function which iterates through the list of geometries and call the callback * function with the geometries as the argument. * * @param {Function} callbackFunction - Callback function with the geometry * as an argument. * @param {Boolean} transverse - Also perform the same callback function for * all child regions if this is set to be true. */ /** * A function which iterates through the list of glyphsets and call the callback * function with the glyphset as the argument. * * @param {Function} callbackFunction - Callback function with the glyphset * as an argument. * @param {Boolean} transverse - Also perform the same callback function for * all child regions if this is set to be true. */ /** * A function which iterates through the list of pointsets and call the callback * function with the pointset as the argument. * * @param {Function} callbackFunction - Callback function with the pointset * as an argument. * @param {Boolean} transverse - Also perform the same callback function for * all child regions if this is set to be true. */ /** * A function which iterates through the list of lines and call the callback * function with the lines as the argument. * * @param {Function} callbackFunction - Callback function with the lines * as an argument. * @param {Boolean} transverse - Also perform the same callback function for * all child regions if this is set to be true. */ /** * Find and return all zinc objects in this and child regions with * the matching GroupName. * * @param {String} groupName - Groupname to match with. * @param {Boolean} transverse - Also look for the object with groupName * in child regions if set to true. * @returns {Array} */ /** * Find and return all geometries in this and child regions with * the matching GroupName. * * @param {String} groupName - Groupname to match with. * @param {Boolean} transverse - Also look for the object with groupName * in child regions if set to true. * @returns {Array} */ /** * Find and return all pointsets in this and child regions with * the matching groupName. * * @param {String} groupName - Groupname to match with. * @param {Boolean} transverse - Also look for the object with groupName * in child regions if set to true. * @returns {Array} */ /** * Find and return all glyphsets in this and child regions with * the matching groupName. * * @param {String} groupName - Groupname to match with. * @param {Boolean} transverse - Also look for the object with groupName * in child regions if set to true. * @returns {Array} */ /** * Find and return all lines in this and child regions with * the matching groupName. * * @param {String} groupName - Groupname to match with. * @param {Boolean} transverse - Also look for the object with groupName * in child regions if set to true. * @returns {Array} */ /** * Get all zinc objects in this region. * * @param {Boolean} transverse - Include zinc objects in child regions if this is * set to true. * @returns {Array} */ /** * Get all child regions. * * @param {Boolean} transverse - Include all regions which are descendants of * this reigon when this is set to true. * @returns {Array} */ /** * Get the current time of the region. * Return -1 if no graphics in the region. * * @return {Number} */ /** * Set the current time of all the objects of this region. * * @param {Number} time - Value to set the time to. * @param {Boolean} transverse - Set the time for chidl regions if * this is set to true. */ /** * Check if any object in this region is time varying. * * @return {Boolean} */ /** * Update geometries and glyphsets based on the calculated time. * @private */ /** * Update geometries and glyphsets based on the calculated time. */ /** * Update geometries and glyphsets based on the calculated time. */ /** * Add a new geometry */tMatrix.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this.pickableUpdateRequired=!0,this.isRegion=!0,this.uuid=getUniqueId(),this.hideAllPrimitives=()=>{children.forEach(child=>child.hideAllPrimitives()),zincObjects.forEach(zincObject=>zincObject.setVisibility(!1))},this.showAllPrimitives=()=>{children.forEach(child=>child.showAllPrimitives()),zincObjects.forEach(zincObject=>zincObject.setVisibility(!0))},this.setVisibility=flag=>{flag!=group.visible&&(group.visible=flag,this.pickableUpdateRequired=!0)},this.getVisibility=()=>group.visible,this.getGroup=()=>group,this.setTransformation=transformation=>{tMatrix.set(...transformation),group.matrix.copy(tMatrix),group.updateMatrixWorld()},this.setName=nameIn=>{nameIn&&""!==nameIn&&(name=nameIn)},this.getName=()=>name,this.getParent=()=>parent,this.getFullSeparatedPath=()=>{var paths=[];if(""!==name){paths.push(name);for(var parentName,p=parent;p!==void 0;)parentName=p.getName(),""!==parentName&&paths.unshift(parentName),p=p.getParent()}return paths},this.getFullPath=()=>{var paths=this.getFullSeparatedPath();if(0{fullPath=fullPath.concat("/",path)}),fullPath}return""},this.createChild=nameIn=>{var childRegion=new Region(this,scene);return childRegion.setName(nameIn),children.push(childRegion),group.add(childRegion.getGroup()),childRegion},this.getChildWithName=childName=>{if(childName)for(var lowerChildName=childName.toLowerCase(),i=0;i{if(pathArray&&0{var pathArray=path.split("/");return this.findChildFromSeparatedPath(pathArray)},this.createChildFromSeparatedPath=pathArray=>{if(0{var pathArray=path.split("/");return this.createChildFromSeparatedPath(pathArray)},this.findOrCreateChildFromPath=path=>{var childRegion=this.findChildFromPath(path);return childRegion||(childRegion=this.createChildFromPath(path)),childRegion},this.addZincObject=zincObject=>{zincObject&&(zincObject.setRegion(this),group.add(zincObject.getGroup()),zincObjects.push(zincObject),this.pickableUpdateRequired=!0,scene&&scene.triggerObjectAddedCallback(zincObject))},this.removeZincObject=zincObject=>{for(var i=0;i{if(this.pickableUpdateRequired)return!0;if(transverse)for(var flag=!1,i=0;i(group.visible&&(zincObjects.forEach(zincObject=>{if(zincObject.getGroup()&&zincObject.getGroup().visible){var marker=zincObject.marker;marker&&marker.isEnabled()&&objectsList.push(marker.getMorph()),objectsList.push(zincObject.getGroup())}}),transverse&&children.forEach(childRegion=>{childRegion.getPickableThreeJSObjects(objectsList,transverse)}),this.pickableUpdateRequired=!1),objectsList),this.setDuration=durationIn=>{duration=durationIn,zincObjects.forEach(zincObject=>zincObject.setDuration(durationIn)),children.forEach(childRegion=>childRegion.setDuration(durationIn))},this.getDuration=()=>duration,this.getBoundingBox=transverse=>{var boundingBox1,boundingBox2;return zincObjects.forEach(zincObject=>{boundingBox2=zincObject.getBoundingBox(),boundingBox2&&(null==boundingBox1?boundingBox1=boundingBox2.clone():boundingBox1.union(boundingBox2))}),transverse&&children.forEach(childRegion=>{boundingBox2=childRegion.getBoundingBox(transverse),boundingBox2&&(null==boundingBox1?boundingBox1=boundingBox2.clone():boundingBox1.union(boundingBox2))}),boundingBox1},this.clear=transverse=>{transverse&&children.forEach(childRegion=>childRegion.clear(transverse)),zincObjects.forEach(zincObject=>{group.remove(zincObject.getGroup()),zincObject.dispose()}),children=[],zincObjects=[]},this.objectIsInRegion=(zincObject,transverse)=>{for(var i=0;i{zincObjects.forEach(zincObject=>{zincObject.isGeometry&&callbackFunction(zincObject)}),transverse&&children.forEach(childRegion=>childRegion.forEachGeometry(callbackFunction,transverse))},this.forEachGlyphset=(callbackFunction,transverse)=>{zincObjects.forEach(zincObject=>{zincObject.isGlyphset&&callbackFunction(zincObject)}),transverse&&children.forEach(childRegion=>childRegion.forEachGlyphset(callbackFunction,transverse))},this.forEachPointset=(callbackFunction,transverse)=>{zincObjects.forEach(zincObject=>{zincObject.isPointset&&callbackFunction(zincObject)}),transverse&&children.forEach(childRegion=>childRegion.forEachPointset(callbackFunction,transverse))},this.forEachLine=(callbackFunction,transverse)=>{zincObjects.forEach(zincObject=>{zincObject.isLines&&callbackFunction(zincObject)}),transverse&&children.forEach(childRegion=>childRegion.forEachLine(callbackFunction,transverse))},this.findObjectsWithAnatomicalId=(anatomicalId,transverse)=>(zincObjects.forEach(zincObject=>{zincObject.anatomicalId===anatomicalId&&objectsArray.push(zincObject)}),transverse&&children.forEach(childRegion=>{var childObjects=childRegion.findObjectsWithAnatomicalId(anatomicalId,transverse);objectsArray.push(...childObjects)}),objectsArray),this.findObjectsWithGroupName=(groupName,transverse)=>{var objectsArray=[];return zincObjects.forEach(zincObject=>{var lowerObjectName=zincObject.groupName?zincObject.groupName.toLowerCase():zincObject.groupName,lowerGroupName=groupName?groupName.toLowerCase():groupName;lowerObjectName===lowerGroupName&&objectsArray.push(zincObject)}),transverse&&children.forEach(childRegion=>{var childObjects=childRegion.findObjectsWithGroupName(groupName,transverse);objectsArray.push(...childObjects)}),objectsArray},this.findGeometriesWithGroupName=(groupName,transverse)=>{var primitivesArray=this.findObjectsWithGroupName(groupName,transverse),geometriesArray=primitivesArray.filter(primitive=>primitive.isGeometry);return geometriesArray},this.findPointsetsWithGroupName=(groupName,transverse)=>{var primitivesArray=this.findObjectsWithGroupName(groupName,transverse),pointsetsArray=primitivesArray.filter(primitive=>primitive.isPointset);return pointsetsArray},this.findGlyphsetsWithGroupName=(groupName,transverse)=>{var primitivesArray=this.findObjectsWithGroupName(groupName,transverse),glyphsetsArray=primitivesArray.filter(primitive=>primitive.isGlyphset);return glyphsetsArray},this.findLinesWithGroupName=(groupName,transverse)=>{var primitivesArray=this.findObjectsWithGroupName(groupName,transverse),linesArray=primitivesArray.filter(primitive=>primitive.isLines);return linesArray},this.getAllObjects=transverse=>{var objectsArray=[...zincObjects];return transverse&&children.forEach(childRegion=>{var childObjects=childRegion.getAllObjects(transverse);objectsArray.push(...childObjects)}),objectsArray},this.getChildRegions=transverse=>{var objectsArray=[...children];return transverse&&children.forEach(childRegion=>{var childObjects=childRegion.getChildRegions(transverse);objectsArray.push(...childObjects)}),objectsArray},this.getCurrentTime=()=>{if(zincObjects[0]!=null)return zincObjects[0].getCurrentTime();for(var time,i=0;i{zincObjects.forEach(zincObject=>{zincObject.setMorphTime(time)}),transverse&&children.forEach(childRegion=>{childRegion.setMorphTime(time)})},this.isTimeVarying=()=>{for(var i=0;i{var _options$markerCluste,allObjects=this.getAllObjects(transverse);// Let video dictates the progress if one is present allObjects.forEach(zincObject=>{zincObject.render(playRate*delta,playAnimation,cameraControls,options)}),options&&!1===playAnimation&&null!==(_options$markerCluste=options.markerCluster)&&void 0!==_options$markerCluste&&_options$markerCluste.markerUpdateRequired&&options.markerCluster.calculate()},this.createPoints=(groupName,coords,labels,colour)=>{var isNew=!1,zincObjects=this.findObjectsWithGroupName(groupName,!1),index=zincObjects.findIndex(zincObject=>zincObject.isPointset),pointset=-1{var isNew=!1,zincObjects=this.findObjectsWithGroupName(groupName,!1),index=zincObjects.findIndex(zincObject=>zincObject.isLines),lines=-1{var zincGeometry=new Geometry,material=new THREE.MeshPhongMaterial({color:colour,morphTargets:!1,morphNormals:!1,transparent:!0,opacity:opacity,side:THREE.DoubleSide});return zincGeometry.createMesh(geometry,material,{localTimeEnabled:!1,localMorphColour:!1}),zincGeometry.getMorph()?(zincGeometry.setVisibility(!1),zincGeometry.setName(groupName),zincGeometry.setRenderOrder(renderOrder),this.addZincObject(zincGeometry),zincGeometry):void 0}};/** * Provides a hierachical structure to objects, Each region * may contain multiple child regions and {@link ZincObject}. * * @class * @author Alan Wu * @return {Region} */exports.Region=Region; /***/ }), /* 45 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var THREE=__webpack_require__(4),toBufferGeometry=(__webpack_require__(5).toBufferGeometry),LineSegments2=(__webpack_require__(46).LineSegments2),LineMaterial=(__webpack_require__(48).LineMaterial),LineSegmentsGeometry=(__webpack_require__(47).LineSegmentsGeometry),Lines2=function(){(__webpack_require__(24).Lines).call(this),this.isLines2=!0;var positions=Array(300);/** * Create the line segements using geometry and material. * * @param {Array} arrayIn - Geometry of lines to be rendered. * @param {THREE.Material} materialIn - Material to be set for the lines. * @param {Object} options - Provide various options * @param {Boolean} options.localTimeEnabled - A flag to indicate either the lines is * time dependent. * @param {Boolean} options.localMorphColour - A flag to indicate either the colour is * time dependent. */ /** * Set the width for the lines. * * @param {Number} width - Width of the lines. */ /** * Add new vertices into the array */ /** * Get the vertices by face index */ /** * Edit Vertice in index. */ /** * Add new lines to existing lines if it exists, otherwise * create a new one and add to it. * @param {Array} coords -An array of three components coordinates. * @param {Number} colour - A hex value of the colour for the points */this.createLineSegment=(arrayIn,materialIn,options)=>{if(arrayIn&&materialIn){var linesGeometry=new LineSegmentsGeometry;linesGeometry.setPositions(arrayIn),linesGeometry.colorsNeedUpdate=!0;var line=new LineSegments2(linesGeometry,materialIn);line.scale.set(1,1,1),line.computeLineDistances(),this.setMesh(line,options.localTimeEnabled,options.localMorphColour)}},this.setWidth=width=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=width,this.morph.material.needsUpdate=!0)},this.addVertices=function(coords){if(coords&&coords.length){var mesh=this.getMorph();mesh||(this.drawRange=0);var index=3*this.drawRange;//fill the rest of the array. if(coords.forEach(coord=>{positions[index++]=coord[0],positions[index++]=coord[1],positions[index++]=coord[2],this.drawRange++}),!mesh)for(;300>index;)positions[index++]=coords[0][0],positions[index++]=coords[0][1],positions[index++]=coords[0][2];mesh&&(mesh.geometry.setPositions(positions),mesh.computeLineDistances(),this.boundingBoxUpdateRequired=!0)}return positions},this.getVerticesByFaceIndex=function(faceIndex){var vIndex=3*(2*faceIndex),mesh=this.getMorph();if(mesh&&3*this.drawRange>vIndex){var position=mesh.geometry.getAttribute("instanceStart");return[[position.data.array[vIndex],position.data.array[++vIndex],position.data.array[++vIndex]],[position.data.array[++vIndex],position.data.array[++vIndex],position.data.array[++vIndex]]]}return[]},this.editVertices=function(coords,i){if(coords&&coords.length){var mesh=this.getMorph(),maxIndex=i+coords.length-1;if(!mesh||0>i||maxIndex>=this.drawRange)return;var index=3*i;for(coords.forEach(coord=>{positions[index++]=coord[0],positions[index++]=coord[1],positions[index++]=coord[2]}),index=3*this.drawRange;300>index;)positions[index++]=coords[0][0],positions[index++]=coords[0][1],positions[index++]=coords[0][2];mesh.geometry.setPositions(positions),mesh.computeLineDistances(),this.boundingBoxUpdateRequired=!0}return positions},this.addLines=(coords,colour)=>{if(coords&&0{var material=this.getMorph().material;material.resolution.set(window.innerWidth,window.innerHeight)}};/** * Provides an object which stores lines. * This is created when a valid json file containing lines is read into a {@link Zinc.Scene} * object. * * @class * @author Alan Wu * @return {Lines} */Lines2.prototype=Object.create((__webpack_require__(24).Lines).prototype),Lines2.prototype.constructor=Lines2,exports.Lines2=Lines2; /***/ }), /* 46 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LineSegments2: () => (/* binding */ LineSegments2) /* harmony export */ }); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _LineSegmentsGeometry_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(47); /* harmony import */ var _LineMaterial_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(48); var _start=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,_end=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,_start4=new three__WEBPACK_IMPORTED_MODULE_0__.Vector4,_end4=new three__WEBPACK_IMPORTED_MODULE_0__.Vector4,_ssOrigin=new three__WEBPACK_IMPORTED_MODULE_0__.Vector4,_ssOrigin3=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,_mvMatrix=new three__WEBPACK_IMPORTED_MODULE_0__.Matrix4,_line=new three__WEBPACK_IMPORTED_MODULE_0__.Line3,_closestPoint=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,_box=new three__WEBPACK_IMPORTED_MODULE_0__.Box3,_sphere=new three__WEBPACK_IMPORTED_MODULE_0__.Sphere,_clipToWorldVector=new three__WEBPACK_IMPORTED_MODULE_0__.Vector4;class LineSegments2 extends three__WEBPACK_IMPORTED_MODULE_0__.Mesh{constructor(){var geometry=0near&&_end4.z>near;if(!isBehindCameraNear){// trim the segment if it extends behind camera near if(_start4.z>near){var deltaDist=_start4.z-_end4.z,t=(_start4.z-near)/deltaDist;_start4.lerp(_end4,t)}else if(_end4.z>near){var _deltaDist=_end4.z-_start4.z,_t=(_end4.z-near)/_deltaDist;_end4.lerp(_start4,_t)}// clip space _start4.applyMatrix4(projectionMatrix),_end4.applyMatrix4(projectionMatrix),_start4.multiplyScalar(1/_start4.w),_end4.multiplyScalar(1/_end4.w),_start4.x*=resolution.x/2,_start4.y*=resolution.y/2,_end4.x*=resolution.x/2,_end4.y*=resolution.y/2,_line.start.copy(_start4),_line.start.z=0,_line.end.copy(_end4),_line.end.z=0;// get closest point on ray to segment var param=_line.closestPointToPointParameter(_ssOrigin3,!0);_line.at(param,_closestPoint);// check if the intersection point is within clip space var zPos=three__WEBPACK_IMPORTED_MODULE_0__.MathUtils.lerp(_start4.z,_end4.z,param),isInClipSpace=-1<=zPos&&1>=zPos,isInside=_ssOrigin3.distanceTo(_closestPoint)<.5*lineWidth;if(isInClipSpace&&isInside){_line.start.fromBufferAttribute(instanceStart,i),_line.end.fromBufferAttribute(instanceEnd,i),_line.start.applyMatrix4(matrixWorld),_line.end.applyMatrix4(matrixWorld);var pointOnLine=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3,point=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3;ray.distanceSqToSegment(_line.start,_line.end,point,pointOnLine),intersects.push({point:point,pointOnLine:pointOnLine,distance:ray.origin.distanceTo(point),object:this,face:null,faceIndex:i,uv:null,uv2:null})}}}}// // pick a point 1 unit out along the ray to avoid the ray origin // sitting at the camera origin which will cause "w" to be 0 when // applying the projection matrix. }// // check if we intersect the box bounds }}LineSegments2.prototype.LineSegments2=!0; /***/ }), /* 47 */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LineSegmentsGeometry: () => (/* binding */ LineSegmentsGeometry) /* harmony export */ }); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_0__); var _box=new three__WEBPACK_IMPORTED_MODULE_0__.Box3,_vector=new three__WEBPACK_IMPORTED_MODULE_0__.Vector3;class LineSegmentsGeometry extends three__WEBPACK_IMPORTED_MODULE_0__.InstancedBufferGeometry{constructor(){super(),this.type="LineSegmentsGeometry";this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new three__WEBPACK_IMPORTED_MODULE_0__.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new three__WEBPACK_IMPORTED_MODULE_0__.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(matrix){var start=this.attributes.instanceStart,end=this.attributes.instanceEnd;return void 0!==start&&(start.applyMatrix4(matrix),end.applyMatrix4(matrix),start.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(array){var lineSegments;array instanceof Float32Array?lineSegments=array:Array.isArray(array)&&(lineSegments=new Float32Array(array));var instanceBuffer=new three__WEBPACK_IMPORTED_MODULE_0__.InstancedInterleavedBuffer(lineSegments,6,1);// xyz, xyz return this.setAttribute("instanceStart",new three__WEBPACK_IMPORTED_MODULE_0__.InterleavedBufferAttribute(instanceBuffer,3,0)),this.setAttribute("instanceEnd",new three__WEBPACK_IMPORTED_MODULE_0__.InterleavedBufferAttribute(instanceBuffer,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(array){var colors;array instanceof Float32Array?colors=array:Array.isArray(array)&&(colors=new Float32Array(array));var instanceColorBuffer=new three__WEBPACK_IMPORTED_MODULE_0__.InstancedInterleavedBuffer(colors,6,1);// rgb, rgb // rgb return this.setAttribute("instanceColorStart",new three__WEBPACK_IMPORTED_MODULE_0__.InterleavedBufferAttribute(instanceColorBuffer,3,0)),this.setAttribute("instanceColorEnd",new three__WEBPACK_IMPORTED_MODULE_0__.InterleavedBufferAttribute(instanceColorBuffer,3,3)),this}fromWireframeGeometry(geometry){return this.setPositions(geometry.attributes.position.array),this}fromEdgesGeometry(geometry){return this.setPositions(geometry.attributes.position.array),this}fromMesh(mesh){// set colors, maybe return this.fromWireframeGeometry(new three__WEBPACK_IMPORTED_MODULE_0__.WireframeGeometry(mesh.geometry)),this}fromLineSegments(lineSegments){var geometry=lineSegments.geometry;return geometry.isGeometry?void console.error("THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead."):(geometry.isBufferGeometry&&this.setPositions(geometry.attributes.position.array),this);// set colors, maybe }computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new three__WEBPACK_IMPORTED_MODULE_0__.Box3);var start=this.attributes.instanceStart,end=this.attributes.instanceEnd;start!==void 0&&end!==void 0&&(this.boundingBox.setFromBufferAttribute(start),_box.setFromBufferAttribute(end),this.boundingBox.union(_box))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new three__WEBPACK_IMPORTED_MODULE_0__.Sphere),null===this.boundingBox&&this.computeBoundingBox();var start=this.attributes.instanceStart,end=this.attributes.instanceEnd;if(start!==void 0&&end!==void 0){var center=this.boundingSphere.center;this.boundingBox.getCenter(center);for(var maxRadiusSq=0,i=0,il=start.count;i { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LineMaterial: () => (/* binding */ LineMaterial) /* harmony export */ }); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_0__); /** * parameters = { * color: , * linewidth: , * dashed: , * dashScale: , * dashSize: , * dashOffset: , * gapSize: , * resolution: , // to be set by renderer * } */three__WEBPACK_IMPORTED_MODULE_0__.UniformsLib.line={linewidth:{value:1},resolution:{value:new three__WEBPACK_IMPORTED_MODULE_0__.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},dashOffset:{value:0},gapSize:{value:1},// todo FIX - maybe change to totalSize opacity:{value:1}},three__WEBPACK_IMPORTED_MODULE_0__.ShaderLib.line={uniforms:three__WEBPACK_IMPORTED_MODULE_0__.UniformsUtils.merge([three__WEBPACK_IMPORTED_MODULE_0__.UniformsLib.common,three__WEBPACK_IMPORTED_MODULE_0__.UniformsLib.fog,three__WEBPACK_IMPORTED_MODULE_0__.UniformsLib.line]),vertexShader:/* glsl */"\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\n\t\t}",fragmentShader:/* glsl */"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float dashOffset;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include \n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tfloat alpha = opacity;\n\n\t\t\t#ifdef ALPHA_TO_COVERAGE\n\n\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\tfloat a = vUv.x;\n\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\tfloat len2 = a * a + b * b;\n\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t}\n\n\t\t\t#else\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\t#endif\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t#include \n\t\t\t#include \n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\n\t\t}"};class LineMaterial extends three__WEBPACK_IMPORTED_MODULE_0__.ShaderMaterial{constructor(parameters){super({type:"LineMaterial",uniforms:three__WEBPACK_IMPORTED_MODULE_0__.UniformsUtils.clone(three__WEBPACK_IMPORTED_MODULE_0__.ShaderLib.line.uniforms),vertexShader:three__WEBPACK_IMPORTED_MODULE_0__.ShaderLib.line.vertexShader,fragmentShader:three__WEBPACK_IMPORTED_MODULE_0__.ShaderLib.line.fragmentShader,clipping:!0// required for clipping support }),Object.defineProperties(this,{color:{enumerable:!0,get:function get(){return this.uniforms.diffuse.value},set:function set(value){this.uniforms.diffuse.value=value}},linewidth:{enumerable:!0,get:function get(){return this.uniforms.linewidth.value},set:function set(value){this.uniforms.linewidth.value=value}},dashed:{enumerable:!0,get:function get(){return!!("USE_DASH"in this.defines)},set(value){!!value!==!!("USE_DASH"in this.defines)&&(this.needsUpdate=!0),!0===value?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function get(){return this.uniforms.dashScale.value},set:function set(value){this.uniforms.dashScale.value=value}},dashSize:{enumerable:!0,get:function get(){return this.uniforms.dashSize.value},set:function set(value){this.uniforms.dashSize.value=value}},dashOffset:{enumerable:!0,get:function get(){return this.uniforms.dashOffset.value},set:function set(value){this.uniforms.dashOffset.value=value}},gapSize:{enumerable:!0,get:function get(){return this.uniforms.gapSize.value},set:function set(value){this.uniforms.gapSize.value=value}},opacity:{enumerable:!0,get:function get(){return this.uniforms.opacity.value},set:function set(value){this.uniforms.opacity.value=value}},resolution:{enumerable:!0,get:function get(){return this.uniforms.resolution.value},set:function set(value){this.uniforms.resolution.value.copy(value)}},alphaToCoverage:{enumerable:!0,get:function get(){return!!("ALPHA_TO_COVERAGE"in this.defines)},set:function set(value){!!value!==!!("ALPHA_TO_COVERAGE"in this.defines)&&(this.needsUpdate=!0),!0===value?(this.defines.ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(parameters)}}LineMaterial.prototype.isLineMaterial=!0; /***/ }), /* 49 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var THREE=__webpack_require__(4);/** * This provide a full scale minimap. It will always * display the whole map. * * @class * @author Alan Wu * @return {Minimap} */exports.Minimap=function(sceneIn){var targetScene=sceneIn;this.camera=new THREE.OrthographicCamera(-.5,.5,.5,-.5,.01,10),this.helper=void 0;var geometry=new THREE.BufferGeometry,vertices=new Float32Array([-1,-1,1,1,-1,1,1,1,1,1,1,1,-1,1,1,-1,-1,1]),positionAttributes=new THREE.BufferAttribute(vertices,3);geometry.setAttribute("position",positionAttributes);var material=new THREE.MeshBasicMaterial({color:3355443,depthTest:!1,depthWrite:!1,opacity:.5,transparent:!0});this.mask=new THREE.Mesh(geometry,material);var _box=new THREE.Box3,_center=new THREE.Vector3;this.getDiffFromNormalised=(x,y)=>{_box.setFromBufferAttribute(positionAttributes).getCenter(_center);var coord=_center.clone().project(this.camera),new_coord=new THREE.Vector3(x,y,coord.z).unproject(this.camera);return new_coord.sub(_center)};var setCurrentCameraSettings=(diameter,newViewport)=>{targetScene.camera.near&&(this.camera.near=targetScene.camera.near),newViewport.farPlane&&(this.camera.far=newViewport.farPlane),newViewport.eyePosition&&this.camera.position.set(newViewport.eyePosition[0],newViewport.eyePosition[1],newViewport.eyePosition[2]),newViewport.upVector&&this.camera.up.set(newViewport.upVector[0],newViewport.upVector[1],newViewport.upVector[2]),newViewport.targetPosition&&this.camera.lookAt(new THREE.Vector3(newViewport.targetPosition[0],newViewport.targetPosition[1],newViewport.targetPosition[2])),this.camera.zoom=1/diameter,this.camera.updateProjectionMatrix()};this.getBoundary=()=>{var target=new THREE.Vector3().copy(targetScene.camera.target).project(targetScene.camera),v1=new THREE.Vector3(-1,-1,target.z).unproject(targetScene.camera),v2=new THREE.Vector3(1,-1,target.z).unproject(targetScene.camera),v3=new THREE.Vector3(1,1,target.z).unproject(targetScene.camera),v4=new THREE.Vector3(-1,1,target.z).unproject(targetScene.camera);positionAttributes.copyVector3sArray([v1,v2,v3,v3,v4,v1]),positionAttributes.needsUpdate=!0},this.updateCamera=()=>{this.getBoundary();var cameraControl=targetScene.getZincCameraControls(),boundingBox=targetScene.getBoundingBox();if(boundingBox){// enlarge radius to keep image within edge of window var diameter=boundingBox.min.distanceTo(boundingBox.max),radius=diameter/2,centreX=(boundingBox.min.x+boundingBox.max.x)/2,centreY=(boundingBox.min.y+boundingBox.max.y)/2,centreZ=(boundingBox.min.z+boundingBox.max.z)/2,viewport=cameraControl.getViewportFromCentreAndRadius(centreX,centreY,centreZ,radius,40,radius*4);setCurrentCameraSettings(diameter,viewport)}}}; /***/ }), /* 50 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var THREE=__webpack_require__(4),ThreeBSP=__webpack_require__(51)(THREE),Geometry=(__webpack_require__(3).Geometry),work=__webpack_require__(52),Promise=(__webpack_require__(53)["default"]),JSONLoader=THREE.BufferGeometryLoader,GeometryCSG=function(hostIn){//ZincGeoemtry of the main geometry var host;hostIn&&hostIn.isGeometry&&(host=hostIn);var core=void 0,worker=void 0,onProgress=!1,myResolve=void 0,createGeometryFromJSON=json=>{var material=host.getMorph().material.clone();material.morphTargets=!1;var newGeometry=new Geometry,JSONParser=new JSONLoader,geometry=JSONParser.parse(json),mesh=new THREE.Mesh(geometry.geometry,material);return newGeometry.geometry=mesh.geometry,mesh.userData=newGeometry,newGeometry.setMorph(mesh),newGeometry},workerEventHandler=ev=>{switch(ev.data.action){case"message":console.log(ev.data.message);break;case"result":var csg=new GeometryCSG(createGeometryFromJSON(ev.data.object));myResolve&&myResolve(csg),myResolve=void 0,onProgress=!1;break;default:throw"Cannot handle specified action."}},initialise=hostIn=>{if(void 0!==work&&(worker=work(/*require.resolve*/(54))),!worker)core=new((__webpack_require__(55).GeometryCSGInternal))(hostIn);else if(hostIn&&hostIn.isGeometry){var mesh=hostIn.getMorph(),json=mesh.geometry.clone().applyMatrix(mesh.matrix).toJSON();worker.addEventListener("message",function(ev){workerEventHandler(ev)}),worker.postMessage({action:"initialise",object:json})}};this.getHostGeometry=()=>{var tempCSG=new ThreeBSP(host.getMorph());return new createZincGeometry(tempCSG)},this.getGeometry=()=>host;var createZincGeometry=csgMesh=>{var material=host.getMorph().material.clone();material.morphTargets=!1;var newMesh=csgMesh.toMesh(material),newGeometry=new Geometry;return newGeometry.geometry=newMesh.geometry,newMesh.userData=newGeometry,newGeometry.setMorph(newMesh),newGeometry};this.setCSG=CSG=>{core.setCSG(CSG)};var sendToWork=(guestGeometry,action,resolve,reject)=>{if(!onProgress){var mesh=guestGeometry.getMorph(),json=mesh.geometry.clone().applyMatrix(mesh.matrix).toJSON();myResolve=resolve,onProgress=!0,worker.postMessage({action:action,object:json})}else reject("On progress")};this.intersect=guestGeometry=>new Promise((resolve,reject)=>{if(worker)sendToWork(guestGeometry,"intersect",resolve,reject);else{var result=core.intersect(guestGeometry),newCSG=new GeometryCSG(createZincGeometry(result));newCSG.setCSG(result),resolve(newCSG)}}),this.subtract=guestGeometry=>new Promise((resolve,reject)=>{if(worker)sendToWork(guestGeometry,"intersect",resolve,reject);else{var result=core.subtract(guestGeometry),newCSG=new GeometryCSG(createZincGeometry(result));newCSG.setCSG(result),resolve(newCSG)}}),this.union=guestGeometry=>new Promise((resolve,reject)=>{if(worker)sendToWork(guestGeometry,"intersect",resolve,reject);else{var result=core.union(guestGeometry),newCSG=new GeometryCSG(createZincGeometry(result));newCSG.setCSG(result),resolve(newCSG)}}),this.terminateWorker=()=>{worker&&worker.terminate()},initialise(hostIn)};//const work = undefined; exports.GeometryCSG=GeometryCSG; /***/ }), /* 51 */ /***/ ((module) => { "use strict"; var ThreeBSP,EPSILON=1e-5,COPLANAR=0,FRONT=1,BACK=2,SPANNING=3;module.exports=function(THREE){var ThreeBSP=function(geometry){// Convert THREE.Geometry to ThreeBSP var i,_length_i,face,vertex,faceVertexUvs,uvs,polygon,polygons=[];if(geometry.isBufferGeometry&&(geometry=new THREE.Geometry().fromBufferGeometry(geometry)),geometry instanceof THREE.Geometry)this.matrix=new THREE.Matrix4;else if(geometry.isMesh)geometry.updateMatrix(),this.matrix=geometry.matrix.clone(),geometry=geometry.geometry,geometry.isBufferGeometry&&(geometry=new THREE.Geometry().fromBufferGeometry(geometry)),geometry.mergeVertices(),geometry.computeVertexNormals(!1);else{if(geometry instanceof ThreeBSP.Node)return this.tree=geometry,this.matrix=new THREE.Matrix4,this;throw"ThreeBSP: Given geometry is unsupported"}for(i=0,_length_i=geometry.faces.length;i<_length_i;i++){if(face=geometry.faces[i],faceVertexUvs=geometry.faceVertexUvs[0][i],polygon=new ThreeBSP.Polygon,face instanceof THREE.Face3)vertex=geometry.vertices[face.a],uvs=faceVertexUvs?new THREE.Vector2(faceVertexUvs[0].x,faceVertexUvs[0].y):null,vertex=new ThreeBSP.Vertex(vertex.x,vertex.y,vertex.z,face.vertexNormals[0],uvs),vertex.applyMatrix4(this.matrix),polygon.vertices.push(vertex),vertex=geometry.vertices[face.b],uvs=faceVertexUvs?new THREE.Vector2(faceVertexUvs[1].x,faceVertexUvs[1].y):null,vertex=new ThreeBSP.Vertex(vertex.x,vertex.y,vertex.z,face.vertexNormals[2],uvs),vertex.applyMatrix4(this.matrix),polygon.vertices.push(vertex),vertex=geometry.vertices[face.c],uvs=faceVertexUvs?new THREE.Vector2(faceVertexUvs[2].x,faceVertexUvs[2].y):null,vertex=new ThreeBSP.Vertex(vertex.x,vertex.y,vertex.z,face.vertexNormals[2],uvs),vertex.applyMatrix4(this.matrix),polygon.vertices.push(vertex);else if(typeof THREE.Face4)vertex=geometry.vertices[face.a],uvs=faceVertexUvs?new THREE.Vector2(faceVertexUvs[0].x,faceVertexUvs[0].y):null,vertex=new ThreeBSP.Vertex(vertex.x,vertex.y,vertex.z,face.vertexNormals[0],uvs),vertex.applyMatrix4(this.matrix),polygon.vertices.push(vertex),vertex=geometry.vertices[face.b],uvs=faceVertexUvs?new THREE.Vector2(faceVertexUvs[1].x,faceVertexUvs[1].y):null,vertex=new ThreeBSP.Vertex(vertex.x,vertex.y,vertex.z,face.vertexNormals[1],uvs),vertex.applyMatrix4(this.matrix),polygon.vertices.push(vertex),vertex=geometry.vertices[face.c],uvs=faceVertexUvs?new THREE.Vector2(faceVertexUvs[2].x,faceVertexUvs[2].y):null,vertex=new ThreeBSP.Vertex(vertex.x,vertex.y,vertex.z,face.vertexNormals[2],uvs),vertex.applyMatrix4(this.matrix),polygon.vertices.push(vertex),vertex=geometry.vertices[face.d],uvs=faceVertexUvs?new THREE.Vector2(faceVertexUvs[3].x,faceVertexUvs[3].y):null,vertex=new ThreeBSP.Vertex(vertex.x,vertex.y,vertex.z,face.vertexNormals[3],uvs),vertex.applyMatrix4(this.matrix),polygon.vertices.push(vertex);else throw"Invalid face type at index "+i;polygon.calculateProperties(),polygons.push(polygon)}this.tree=new ThreeBSP.Node(polygons)};return ThreeBSP.prototype.subtract=function(other_tree){var a=this.tree.clone(),b=other_tree.tree.clone();return a.invert(),a.clipTo(b),b.clipTo(a),b.invert(),b.clipTo(a),b.invert(),a.build(b.allPolygons()),a.invert(),a=new ThreeBSP(a),a.matrix=this.matrix,a},ThreeBSP.prototype.union=function(other_tree){var a=this.tree.clone(),b=other_tree.tree.clone();return a.clipTo(b),b.clipTo(a),b.invert(),b.clipTo(a),b.invert(),a.build(b.allPolygons()),a=new ThreeBSP(a),a.matrix=this.matrix,a},ThreeBSP.prototype.intersect=function(other_tree){var a=this.tree.clone(),b=other_tree.tree.clone();return a.invert(),b.clipTo(a),b.invert(),a.clipTo(b),b.clipTo(a),a.build(b.allPolygons()),a.invert(),a=new ThreeBSP(a),a.matrix=this.matrix,a},ThreeBSP.prototype.toGeometry=function(){var i,j,polygon,polygon_vertice_count,vertex_idx_a,vertex_idx_b,vertex_idx_c,vertex,face,verticeUvs,matrix=new THREE.Matrix4().getInverse(this.matrix),geometry=new THREE.Geometry,polygons=this.tree.allPolygons(),polygon_count=polygons.length,vertice_dict={};for(i=0;iEPSILON?FRONT:COPLANAR},ThreeBSP.Polygon.prototype.classifySide=function(polygon){var i,vertex,classification,num_positive=0,num_negative=0,vertice_count=polygon.vertices.length;for(i=0;i { "use strict"; module.exports = require("webworkify-webpack"); /***/ }), /* 53 */ /***/ ((module) => { "use strict"; module.exports = require("promise-polyfill"); /***/ }), /* 54 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Geometry=(__webpack_require__(3).Geometry),THREE=__webpack_require__(4),JSONLoader=THREE.BufferGeometryLoader;module.exports=function(self){var core=void 0,geometryFromJSON=function geometryFromJSON(object){var JSONParser=new JSONLoader,geometry=JSONParser.parse(object),material=new THREE.MeshPhongMaterial,mesh=new THREE.Mesh(geometry.geometry,material),host=new Geometry;return host.setMorph(mesh),host},initialise=function initialise(object){var host=geometryFromJSON(object);core=new((__webpack_require__(55).GeometryCSGInternal))(host),self.postMessage({action:"message",message:"Initialised"})},intersect=function intersect(object){if(core){var guest=geometryFromJSON(object),result=core.intersect(guest),json=result.toBufferGeometry().toJSON();self.postMessage({action:"result",object:json})}},subtract=function subtract(object){if(core){var guest=geometryFromJSON(object),result=core.subtract(guest),json=result.toBufferGeometry().toJSON();self.postMessage({action:"result",object:json})}},union=function union(object){if(core){var guest=geometryFromJSON(object),result=core.union(guest),json=result.toBufferGeometry().toJSON();self.postMessage({action:"result",object:json})}};self.addEventListener("message",function(ev){switch(ev.data.action){case"initialise":initialise(ev.data.object);break;case"intersect":intersect(ev.data.object);break;case"subtract":subtract(ev.data.object);break;case"union":union(ev.data.object);break;default:throw"Cannot handle specified action."}})}; /***/ }), /* 55 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var THREE=__webpack_require__(4),ThreeBSP=__webpack_require__(51)(THREE),Geometry=(__webpack_require__(3).Geometry),GeometryCSG=(__webpack_require__(50).GeometryCSG),GeometryCSGInternal=function(hostIn){//ZincGeoemtry of the main geometry var host;hostIn&&hostIn.isGeometry&&(host=hostIn);var hostCSG;this.setGeometry=hostIn=>{hostIn&&hostIn.isGeometry&&(host=hostIn),hostCSG=void 0},this.setCSG=csg=>{hostCSG=csg};var prepareCSG=guestGeometry=>{if(host&&host.morph&&guestGeometry&&guestGeometry.morph){hostCSG===void 0&&(hostCSG=new ThreeBSP(host.morph));var guestCSG=new ThreeBSP(guestGeometry.morph);return guestCSG}};this.intersect=guestGeometry=>{var guestCSG=prepareCSG(guestGeometry);return hostCSG&&guestCSG?hostCSG.intersect(guestCSG):void 0},this.subtract=guestGeometry=>{var guestCSG=prepareCSG(guestGeometry);return hostCSG&&guestCSG?hostCSG.subtract(guestCSG):void 0},this.union=guestGeometry=>{var guestCSG=prepareCSG(guestGeometry);return hostCSG&&guestCSG?hostCSG.union(guestCSG):void 0}};exports.GeometryCSGInternal=GeometryCSGInternal; /***/ }), /* 56 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var THREE=__webpack_require__(4),ThreeBSP=__webpack_require__(51)(THREE),Glyphset=(__webpack_require__(18).Glyphset),GlyphsetCSG=function(hostIn){var host;hostIn&&hostIn.isGlyphset&&(host=hostIn);var hostCSGs=[];this.setGlyphset=hostIn=>{hostIn&&hostIn.isGlyphset&&(host=hostIn),hostCSG=void 0},this.getGlyphset=()=>host;var prepareCSGForGlyphs=()=>glyph=>{var mesh=glyph.getMesh(),label=glyph.getLabel();if(mesh){var csg=new ThreeBSP(mesh.geometry.clone().applyMatrix(mesh.matrix)),store=[];store.csg=csg,store.label=label,mesh.material&&(store.material=mesh.material.clone()),hostCSGs.push(store)}},prepareCSG=guestGeometry=>{if(host&&guestGeometry&&guestGeometry.getMorph()){0==hostCSGs.length&&host.forEachGlyph(prepareCSGForGlyphs());var guestCSG=new ThreeBSP(guestGeometry.getMorph());return guestCSG}};this.intersect=guestGeometry=>{var guestCSG=prepareCSG(guestGeometry);if(0 { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ /******/ /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module is referenced by other modules so it can't be inlined /******/ var __webpack_exports__ = __webpack_require__(0); /******/ /******/ return __webpack_exports__; /******/ })() ; }); //# sourceMappingURL=zinc.js.map