zincjs 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/zinc.frontend.js +1 -1
- package/build/zinc.js +52 -54
- package/build/zinc.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/mapMarker.svg +33 -10
- package/src/primitives/marker.js +31 -2
- package/src/primitives/markerCluster.js +9 -19
- package/src/primitives/texturePrimitive.js +0 -1
- package/src/primitives/zincObject.js +6 -2
- package/src/region.js +12 -10
- package/src/utilities.js +13 -0
package/build/zinc.js
CHANGED
|
@@ -13,7 +13,7 @@ return /******/ (() => { // webpackBootstrap
|
|
|
13
13
|
/* 0 */
|
|
14
14
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
15
15
|
|
|
16
|
-
__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
|
+
__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.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)};/**
|
|
17
17
|
* Provides a global namespace for the Zinc javascript library and some default parameters for it.
|
|
18
18
|
*
|
|
19
19
|
* @namespace
|
|
@@ -32,14 +32,14 @@ module.exports = require("url-polyfill");
|
|
|
32
32
|
/***/ ((module) => {
|
|
33
33
|
|
|
34
34
|
"use strict";
|
|
35
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"zincjs","version":"1.
|
|
35
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"zincjs","version":"1.7.0","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}');
|
|
36
36
|
|
|
37
37
|
/***/ }),
|
|
38
38
|
/* 3 */
|
|
39
39
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
40
40
|
|
|
41
41
|
var THREE=__webpack_require__(4),toBufferGeometry=(__webpack_require__(5).toBufferGeometry),createMeshForGeometry=(geometryIn,materialIn,options)=>{// First copy the geometry
|
|
42
|
-
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__(
|
|
42
|
+
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
|
|
43
43
|
/**
|
|
44
44
|
* Create the mesh for rendering
|
|
45
45
|
*
|
|
@@ -63,7 +63,7 @@ var geometry=toBufferGeometry(geometryIn,options),isTransparent=!1;1>options.opa
|
|
|
63
63
|
* @param {Boolean} wireframe - Flag to turn on/off wireframe display.
|
|
64
64
|
*/ /**
|
|
65
65
|
* Edit Vertice in index.
|
|
66
|
-
*/(__webpack_require__(
|
|
66
|
+
*/(__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
|
|
67
67
|
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.geometry.faces.length;i++){var v1=this.geometry.vertices[this.geometry.faces[i].a],v2=this.geometry.vertices[this.geometry.faces[i].b],v3=this.geometry.vertices[this.geometry.faces[i].c];geometry.faceVertexUvs[0].push([new THREE.Vector2((v1.x+offset.x)/range.x,(v1.y+offset.y)/range.y),new THREE.Vector2((v2.x+offset.x)/range.x,(v2.y+offset.y)/range.y),new THREE.Vector2((v3.x+offset.x)/range.x,(v3.y+offset.y)/range.y)])}geometry.uvsNeedUpdate=!0},this.checkTransparentMesh=function(){this._lod.checkTransparentMesh()},this.setWireframe=wireframe=>{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}}};/**
|
|
68
68
|
* Provides an object which stores geometry and provides method which controls its animations.
|
|
69
69
|
* This is created when a valid json file containging geometry is read into a {@link Zinc.Scene}
|
|
@@ -72,7 +72,7 @@ if(!(this.morph&&this.morph.geometry&&null!=geometryIn)){var mesh=createMeshForG
|
|
|
72
72
|
* @class
|
|
73
73
|
* @author Alan Wu
|
|
74
74
|
* @return {Geometry}
|
|
75
|
-
*/Geometry.prototype=Object.create((__webpack_require__(
|
|
75
|
+
*/Geometry.prototype=Object.create((__webpack_require__(10).ZincObject).prototype),exports.Geometry=Geometry;
|
|
76
76
|
|
|
77
77
|
/***/ }),
|
|
78
78
|
/* 4 */
|
|
@@ -85,7 +85,7 @@ module.exports = require("three");
|
|
|
85
85
|
/* 5 */
|
|
86
86
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
87
87
|
|
|
88
|
-
function _readOnlyError(name){throw new TypeError("\""+name+"\" is read-only")}var THREE=__webpack_require__(4),THREEGeometry=(__webpack_require__(6).Geometry);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 newURL=new URL(target,reference).href;//Make sure the target url does not contain parameters
|
|
88
|
+
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 newURL=new URL(target,reference).href;//Make sure the target url does not contain parameters
|
|
89
89
|
if(target&&2>target.split("?").length){var paramsStrings=reference.split("?");//There are parameters, add them to the target
|
|
90
90
|
2===paramsStrings.length&&(newURL=newURL+"?"+paramsStrings[1])}return newURL}/*
|
|
91
91
|
* Calculate the bounding box of a mesh, values will be
|
|
@@ -112,7 +112,7 @@ if(oldAttribute.isInterleavedBufferAttribute?attribute=new THREE.BufferAttribute
|
|
|
112
112
|
var cons=Uint8Array;newIndices.length>=Math.pow(2,8)&&(cons=Uint16Array),newIndices.length>=Math.pow(2,16)&&(cons=Uint32Array);var newIndexBuffer=new cons(newIndices),newIndices=null;return null===indices?newIndices=new THREE.BufferAttribute(newIndexBuffer,1):(newIndices=geometry.getIndex().clone(),newIndices.setArray(newIndexBuffer)),result.setIndex(newIndices),result};function PhongToToon(materialIn){if(materialIn.isMeshPhongMaterial){var material=new THREE.MeshToonMaterial({color:materialIn.color.clone(),morphTargets:materialIn.morphTargets,morphNormals:materialIn.morphNormals,vertexColors:materialIn.vertexColors,transparent:materialIn.transparent,opacity:materialIn.opacity,side:materialIn.side});return materialIn.map&&(material.map=materialIn.map),material}return materialIn}/**
|
|
113
113
|
* Create and return a new buffer geometry with the size of length,
|
|
114
114
|
* and initial coords.
|
|
115
|
-
*/function createBufferGeometry(length,coords){if(coords&&length>=coords.length){var geometry=new THREE.BufferGeometry,vertices=new Float32Array(3*length),i=0;return coords.forEach(coord=>{vertices[i++]=coord[0],vertices[i++]=coord[1],vertices[i++]=coord[2]}),geometry.setAttribute("position",new THREE.BufferAttribute(vertices,3)),geometry.setDrawRange(0,coords.length),geometry}}function getCircularTexture(){var image=new Image;image.src=__webpack_require__(
|
|
115
|
+
*/function createBufferGeometry(length,coords){if(coords&&length>=coords.length){var geometry=new THREE.BufferGeometry,vertices=new Float32Array(3*length),i=0;return coords.forEach(coord=>{vertices[i++]=coord[0],vertices[i++]=coord[1],vertices[i++]=coord[2]}),geometry.setAttribute("position",new THREE.BufferAttribute(vertices,3)),geometry.setDrawRange(0,coords.length),geometry}}function getCircularTexture(){var image=new Image;image.src=__webpack_require__(8);var texture=new THREE.Texture;return texture.image=image,texture.needsUpdate=!0,texture}function createNewSpriteText(text,height,colour,font,pixel,weight){var sprite=new SpriteText(text,height,colour,font,pixel,weight);return sprite.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;
|
|
116
116
|
|
|
117
117
|
/***/ }),
|
|
118
118
|
/* 6 */
|
|
@@ -218,10 +218,17 @@ hasSkinIndices&&this.skinIndices.push(skinIndices[face.a],skinIndices[face.b],sk
|
|
|
218
218
|
/* 7 */
|
|
219
219
|
/***/ ((module) => {
|
|
220
220
|
|
|
221
|
-
|
|
221
|
+
"use strict";
|
|
222
|
+
module.exports = require("three-spritetext");
|
|
222
223
|
|
|
223
224
|
/***/ }),
|
|
224
225
|
/* 8 */
|
|
226
|
+
/***/ ((module) => {
|
|
227
|
+
|
|
228
|
+
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=="
|
|
229
|
+
|
|
230
|
+
/***/ }),
|
|
231
|
+
/* 9 */
|
|
225
232
|
/***/ ((__unused_webpack_module, exports) => {
|
|
226
233
|
|
|
227
234
|
/**
|
|
@@ -229,7 +236,7 @@ module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABz
|
|
|
229
236
|
*/exports.augmentMorphColor=function(){return function(shader){shader.vertexShader=shader.vertexShader.replace("#include <color_pars_vertex>",["varying vec3 vColor;","attribute vec3 morphColor0;","attribute vec3 morphColor1;"].join("\n")),shader.vertexShader=shader.vertexShader.replace("#include <color_vertex>",["vColor.xyz = color.xyz;","#ifdef USE_MORPHTARGETS","vColor = morphColor0 * morphTargetInfluences[ 0 ];","vColor += morphColor1 * morphTargetInfluences[ 1 ];","#endif"].join("\n"))}};
|
|
230
237
|
|
|
231
238
|
/***/ }),
|
|
232
|
-
/*
|
|
239
|
+
/* 10 */
|
|
233
240
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
234
241
|
|
|
235
242
|
var THREE=__webpack_require__(4),createBufferGeometry=(__webpack_require__(5).createBufferGeometry),uniqueiId=0,getUniqueId=function(){return"pr"+uniqueiId++},ZincObject=function(){// THREE.Mesh
|
|
@@ -241,7 +248,7 @@ var THREE=__webpack_require__(4),createBufferGeometry=(__webpack_require__(5).cr
|
|
|
241
248
|
* animation. Actual time in second = duration / playRate.
|
|
242
249
|
*/ //Draw range is only used by primitives added
|
|
243
250
|
//programatically with addVertices function
|
|
244
|
-
this.isZincObject=!0,this.geometry=void 0,this.morph=void 0,this.group=new THREE.Group,this._lod=new((__webpack_require__(
|
|
251
|
+
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};/**
|
|
245
252
|
* Provides the base object for other primitive types.
|
|
246
253
|
* This class contains multiple base methods.
|
|
247
254
|
*
|
|
@@ -400,18 +407,18 @@ this.isZincObject=!0,this.geometry=void 0,this.morph=void 0,this.group=new THREE
|
|
|
400
407
|
*
|
|
401
408
|
* @return {THREE.Box3}.
|
|
402
409
|
*/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
|
|
403
|
-
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)}
|
|
410
|
+
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
|
|
404
411
|
this._lod.setFrustumCulled(flag)},ZincObject.prototype.setVertexColors=function(vertexColors){//multilayers - set for all
|
|
405
412
|
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;i<position.count;i++)this._v2.fromArray(position.array,3*i),currentDistance=this._v2.distanceTo(this._v1),-1==distance?distance=currentDistance:distance>currentDistance&&(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;i<influences.length;i++)0<influences[i]&&(found=!0,this._v1.fromArray(attributes.position[i].array,3*this.closestVertexIndex),position.add(this._v1.multiplyScalar(influences[i])));if(found)return applyMatrixWorld?position.applyMatrix4(morph.matrixWorld):position}else return position.fromArray(morph.geometry.attributes.position.array,3*this.closestVertexIndex),applyMatrixWorld?position.applyMatrix4(morph.matrixWorld):position}return this.getBoundingBox(),position.copy(this.center),applyMatrixWorld?position.applyMatrix4(this.morph.matrixWorld):position},ZincObject.prototype.getBoundingBox=function(){if(this.visible){var morph=this._lod.getCurrentMorph();if(morph&&morph.visible)return this.boundingBoxUpdateRequired&&((__webpack_require__(5).getBoundingBox)(morph,this.cachedBoundingBox,this._b1,this._v1,this._v2),this.cachedBoundingBox.getCenter(this.center),this.radius=this.center.distanceTo(this.cachedBoundingBox.max),this.boundingBoxUpdateRequired=!1),this.cachedBoundingBox}},ZincObject.prototype.dispose=function(){//multilayyers
|
|
406
|
-
this._lod.dispose(),this.animationGroup=void 0,this.mixer=void 0,this.morph=void 0,this.group=void 0,this.clipAction=void 0,this.groupName=void 0},ZincObject.prototype.markerIsRequired=function(options){return!!(this.visible&&("on"===this.markerMode||options&&options.displayMarkers&&"inherited"===this.markerMode))},ZincObject.prototype.updateMarker=function(playAnimation,options){if(!1==playAnimation&&this.markerIsRequired(options)){var ndcToBeUpdated=options.ndcToBeUpdated;if(this.groupName){if(this.marker||(this.marker=new((__webpack_require__(
|
|
407
|
-
this._lod.setRenderOrder(renderOrder)},ZincObject.prototype.getClosestVertexDOMElementCoords=function(scene){if(scene&&scene.camera){var inView=!0,position=this.getClosestVertex(!0);return position.project(scene.camera),position.z=Math.min(Math.max(position.z,0),1),(1<position.x||-1>position.x||1<position.y||-1>position.y)&&(inView=!1),scene.getZincCameraControls().getRelativeCoordsFromNDC(position.x,position.y,position),{position,inView}}},ZincObject.prototype.setMarkerMode=function(mode){mode!==this.markerMode&&(this.markerMode="on"===mode||"off"===mode?mode:"inherited",this.region&&(this.region.pickableUpdateRequired=!0))},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
|
|
413
|
+
this._lod.dispose(),this.animationGroup=void 0,this.mixer=void 0,this.morph=void 0,this.group=void 0,this.clipAction=void 0,this.groupName=void 0},ZincObject.prototype.markerIsRequired=function(options){return!!(this.visible&&("on"===this.markerMode||options&&options.displayMarkers&&"inherited"===this.markerMode))},ZincObject.prototype.updateMarker=function(playAnimation,options){if(!1==playAnimation&&this.markerIsRequired(options)){var ndcToBeUpdated=options.ndcToBeUpdated;if(this.groupName){if(this.marker||(this.marker=new((__webpack_require__(14).Marker))(this),this.markerUpdateRequired=!0),this.markerUpdateRequired){var position=this.getClosestVertex(!1);position&&(this.marker.setPosition(position.x,position.y,position.z),this.markerUpdateRequired=!1)}this.marker.isEnabled()||(options.markersList&&!(this.marker.uuid in options.markersList)&&(ndcToBeUpdated=!0,options.markersList[this.marker.uuid]=this.marker),this.marker.enable(),this.group.add(this.marker.morph)),this.marker.setNumber(this.markerNumber),options&&options.camera&&(ndcToBeUpdated||options.markerCluster.markerUpdateRequired)&&(this.marker.updateNDC(options.camera.cameraObject),options.markerCluster.markerUpdateRequired=!0)}}else this.marker&&this.marker.isEnabled()&&(this.marker.disable(),this.group.remove(this.marker.morph),options.markersList&&this.marker.uuid in options.markersList&&(options.markerCluster.markerUpdateRequired=!0,delete options.markersList[this.marker.uuid])),this.markerUpdateRequired=!0},ZincObject.prototype.processMarkerVisual=function(min,max){this.marker&&this.marker.isEnabled()&&this.marker.updateVisual(min,max)},ZincObject.prototype.initiateMorphColor=function(){1==this.morphColour&&this._lod.updateMorphColorAttribute(!1)},ZincObject.prototype.setRenderOrder=function(renderOrder){//multiilayers
|
|
414
|
+
this._lod.setRenderOrder(renderOrder)},ZincObject.prototype.getClosestVertexDOMElementCoords=function(scene){if(scene&&scene.camera){var inView=!0,position=this.getClosestVertex(!0);return position.project(scene.camera),position.z=Math.min(Math.max(position.z,0),1),(1<position.x||-1>position.x||1<position.y||-1>position.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)},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
|
|
408
415
|
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,preload){this._lod.addLevelFromURL(loader,level,url,preload)},ZincObject.prototype.addVertices=function(coords){var mesh=this.getMorph(),geometry=void 0;if(!mesh)geometry=createBufferGeometry(coords.length+500,coords),this.drawRange=coords.length;else if(-1<this.drawRange){var positionAttribute=mesh.geometry.getAttribute("position");coords.forEach(coord=>{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.setScaleAll=function(scale){var group=this.getGroup();group&&(group.scale.set(scale,scale,scale),group.updateMatrix(),this.boundingBoxUpdateRequired=!0)},exports.ZincObject=ZincObject;
|
|
409
416
|
|
|
410
417
|
/***/ }),
|
|
411
|
-
/*
|
|
418
|
+
/* 11 */
|
|
412
419
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
413
420
|
|
|
414
|
-
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<this.levels.length&&!(distance<this.levels[l].distance);l++);this.levels.splice(l,0,{distance:distance,morph:object,loaded:!0,loading:!1,url:""}),object.renderOrder=this._renderOrder}},this.levelLoaded=(object,distanceIn)=>{if(object){for(var distance=Math.abs(distanceIn),l=0;l<this.levels.length;l++)if(distance===this.levels[l].distance){this._parent.group.add(object),this.levels[l].morph=object,this.levels[l].loaded=!0,this.levels[l].loading=!1;break}this.checkTransparentMesh()}},this.addLevelFromURL=(loader,level,url,preload)=>{this._loader=loader;var l,distance=this.calculateDistance(level);for(l=0;l<this.levels.length&&!(distance<this.levels[l].distance);l++);this.levels.splice(l,0,{distance:distance,morph:void 0,loaded:!1,loading:!1,url:url}),preload&&this.loadLevel(l)},this.loadLevel=index=>{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)),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<this.levels.length),this.checkTransparentMesh=()=>{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__(
|
|
421
|
+
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<this.levels.length&&!(distance<this.levels[l].distance);l++);this.levels.splice(l,0,{distance:distance,morph:object,loaded:!0,loading:!1,url:""}),object.renderOrder=this._renderOrder}},this.levelLoaded=(object,distanceIn)=>{if(object){for(var distance=Math.abs(distanceIn),l=0;l<this.levels.length;l++)if(distance===this.levels[l].distance){this._parent.group.add(object),this.levels[l].morph=object,this.levels[l].loaded=!0,this.levels[l].loading=!1;break}this.checkTransparentMesh()}},this.addLevelFromURL=(loader,level,url,preload)=>{this._loader=loader;var l,distance=this.calculateDistance(level);for(l=0;l<this.levels.length&&!(distance<this.levels[l].distance);l++);this.levels.splice(l,0,{distance:distance,morph:void 0,loaded:!1,loading:!1,url:url}),preload&&this.loadLevel(l)},this.loadLevel=index=>{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)),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<this.levels.length),this.checkTransparentMesh=()=>{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
|
|
415
422
|
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.length){var i,l,distance=camera.cameraObject.position.distanceTo(center),visibleIndex=-1,optimalIndex=-1;//Found a visible index that is within range of the LOD
|
|
416
423
|
for(i=0,l=levels.length;i<l&&distance>=levels[i].distance;i++)levels[i].morph?(-1<visibleIndex&&levels[visibleIndex].morph&&(levels[visibleIndex].morph.visible=!1),visibleIndex=i,levels[i].morph.visible=!0,optimalIndex=-1):optimalIndex=i;for(-1<optimalIndex&&this.loadLevel(optimalIndex);i<l;i++)levels[i].morph&&(-1<visibleIndex?levels[i].morph.visible=!1:(levels[i].morph.visible=!0,visibleIndex=i));this._currentLevel!=visibleIndex&&(this._currentLevel=visibleIndex,this.checkTransparentMesh())}},this.toggleMarker=(marker,flag)=>{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)})}};/**
|
|
417
424
|
* Provides an object which stores meshes at different levels based
|
|
@@ -430,7 +437,7 @@ for(i=0,l=levels.length;i<l&&distance>=levels[i].distance;i++)levels[i].morph?(-
|
|
|
430
437
|
*/exports.LOD=LOD;
|
|
431
438
|
|
|
432
439
|
/***/ }),
|
|
433
|
-
/*
|
|
440
|
+
/* 12 */
|
|
434
441
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
435
442
|
|
|
436
443
|
"use strict";
|
|
@@ -438,14 +445,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
438
445
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
439
446
|
/* harmony export */ LineSegments: () => (/* binding */ LineSegments)
|
|
440
447
|
/* harmony export */ });
|
|
441
|
-
/* harmony import */ var _Line_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
448
|
+
/* harmony import */ var _Line_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13);
|
|
442
449
|
/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
|
443
450
|
/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_1__);
|
|
444
451
|
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
|
|
445
452
|
if(null===geometry.index){for(var positionAttribute=geometry.attributes.position,lineDistances=[],i=0,l=positionAttribute.count;i<l;i+=2)_start.fromBufferAttribute(positionAttribute,i),_end.fromBufferAttribute(positionAttribute,i+1),lineDistances[i]=0==i?0:lineDistances[i-1],lineDistances[i+1]=lineDistances[i]+_start.distanceTo(_end);geometry.setAttribute("lineDistance",new three__WEBPACK_IMPORTED_MODULE_1__.Float32BufferAttribute(lineDistances,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}LineSegments.prototype.isLineSegments=!0;
|
|
446
453
|
|
|
447
454
|
/***/ }),
|
|
448
|
-
/*
|
|
455
|
+
/* 13 */
|
|
449
456
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
450
457
|
|
|
451
458
|
"use strict";
|
|
@@ -467,10 +474,10 @@ point:interSegment.clone().applyMatrix4(this.matrixWorld),index:_i,face:null,fac
|
|
|
467
474
|
}updateMorphTargets(){var geometry=this.geometry;if(geometry.isBufferGeometry){var morphAttributes=geometry.morphAttributes,keys=Object.keys(morphAttributes);if(0<keys.length){var morphAttribute=morphAttributes[keys[0]];if(morphAttribute!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var name,m=0,ml=morphAttribute.length;m<ml;m++)name=morphAttribute[m].name||m+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[name]=m}}}else{var morphTargets=geometry.morphTargets;morphTargets!==void 0&&0<morphTargets.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function calculatePosition(vStart,vEnd,object,position,morphPosition,a,b){vStart.fromBufferAttribute(position,a),vEnd.fromBufferAttribute(position,b);var morphInfluences=object.morphTargetInfluences;if(object.material.morphTargets&&morphPosition&&morphInfluences){_morphA.set(0,0,0),_morphB.set(0,0,0);for(var i=0,il=morphPosition.length;i<il;i++){var influence=morphInfluences[i],morphAttribute=morphPosition[i];0!==influence&&(_tempA.fromBufferAttribute(morphAttribute,a),_tempB.fromBufferAttribute(morphAttribute,b),_morphA.addScaledVector(_tempA.sub(vStart),influence),_morphB.addScaledVector(_tempB.sub(vEnd),influence))}vStart.add(_morphA),vEnd.add(_morphB)}}Line.prototype.isLine=!0;
|
|
468
475
|
|
|
469
476
|
/***/ }),
|
|
470
|
-
/*
|
|
477
|
+
/* 14 */
|
|
471
478
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
472
479
|
|
|
473
|
-
var THREE=__webpack_require__(4),markerImage=new Image(128,128);markerImage.src=__webpack_require__(
|
|
480
|
+
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;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};/**
|
|
474
481
|
* Set the position of the marker.
|
|
475
482
|
*
|
|
476
483
|
* @param {Number} x - x coordinate to be set.
|
|
@@ -490,7 +497,7 @@ var THREE=__webpack_require__(4),markerImage=new Image(128,128);markerImage.src=
|
|
|
490
497
|
* Enable and visualise the marker.
|
|
491
498
|
*/ /**
|
|
492
499
|
* Disable and hide the marker.
|
|
493
|
-
*/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.dispose=()=>{this.morph&&this.morph.clear(),sprite&&(sprite.clear(),sprite=void 0)},this.isEnabled=()=>enabled,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()};/**
|
|
500
|
+
*/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.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()};/**
|
|
494
501
|
* A special graphics type with a tear drop shape.
|
|
495
502
|
* It is currently used to mark the location of a
|
|
496
503
|
* {@link zincObject}.
|
|
@@ -498,19 +505,19 @@ var THREE=__webpack_require__(4),markerImage=new Image(128,128);markerImage.src=
|
|
|
498
505
|
* @class
|
|
499
506
|
* @author Alan Wu
|
|
500
507
|
* @return {Marker}
|
|
501
|
-
*/Marker.prototype=Object.create((__webpack_require__(
|
|
508
|
+
*/Marker.prototype=Object.create((__webpack_require__(10).ZincObject).prototype),exports.Marker=Marker;
|
|
502
509
|
|
|
503
510
|
/***/ }),
|
|
504
|
-
/*
|
|
511
|
+
/* 15 */
|
|
505
512
|
/***/ ((module) => {
|
|
506
513
|
|
|
507
|
-
module.exports = "data:image/svg+xml;base64,
|
|
514
|
+
module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgdmlld0JveD0iMCAwIDM2NSA1NjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCAwKSIgaWQ9IjgwOGVkMjgzLTI1MjQtNDQwZi04OGFlLTNiZGI0N2JiNTc0OSIgID4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4NCjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItMTgyLjUiIHk9Ii0yODAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIC8+DQo8L2c+DQo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+DQo8ZyBzdHlsZT0iIiAgID4NCjwvZz4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCA5Ny41KSIgID4NCjxnIHN0eWxlPSIiICAgPg0KPC9nPg0KPC9nPg0KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC45OSAwIDAgMC45OSAxODIuNSAyODApIiAgPg0KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii01NDAiIHk9Ii01NDAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjEwODAiIGhlaWdodD0iMTA4MCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHBhdGggc3R5bGU9InN0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMCw4OSwxMTYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB0cmFuc2Zvcm09IiB0cmFuc2xhdGUoLTE4Mi45LCAtMjc5Ljg1KSIgZD0iTSAxODIuOSA1NTEuNyBDIDE4Mi45IDU1MS44MDAwMDAwMDAwMDAxIDE4My4xIDU1MiAxODMuMSA1NTIgQyAxODMuMSA1NTIgMzU4LjMgMjgzIDM1OC4zIDE5NC42IEMgMzU4LjMgNjQuNSAyNjkuNSA3LjkwMDAwMDAwMDAwMDAwNiAxODIuOSA3LjY5OTk5OTk5OTk5OTk4OSBDIDk2LjMgNy45IDcuNSA2NC41IDcuNSAxOTQuNiBDIDcuNSAyODMgMTgyLjggNTUyIDE4Mi44IDU1MiBDIDE4Mi44IDU1MiAxODIuOSA1NTEuNyAxODIuOSA1NTEuNyB6IE0gMTIyLjIgMTg3LjIgQyAxMjIuMiAxNTMuNiAxNDkuNCAxMjYuMzk5OTk5OTk5OTk5OTkgMTgzIDEyNi4zOTk5OTk5OTk5OTk5OSBDIDIxNi42IDEyNi4zOTk5OTk5OTk5OTk5OSAyNDMuOCAxNTMuNiAyNDMuOCAxODcuMiBDIDI0My44IDIyMC43OTk5OTk5OTk5OTk5OCAyMTYuNSAyNDggMTgyLjkgMjQ4IEMgMTQ5LjQgMjQ4IDEyMi4yIDIyMC44IDEyMi4yIDE4Ny4yIHoiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPg0KPGNpcmNsZSBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwwLDApOyBzdHJva2Utd2lkdGg6IDA7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtZGFzaG9mZnNldDogMDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDQ7IGZpbGw6IHJnYigyNTUsMjU1LDI1NSk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIGN4PSIwIiBjeT0iMCIgcj0iMzUiIC8+DQo8L2c+DQo8L2c+DQo8L2c+DQo8L3N2Zz4="
|
|
508
515
|
|
|
509
516
|
/***/ }),
|
|
510
|
-
/*
|
|
517
|
+
/* 16 */
|
|
511
518
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
512
519
|
|
|
513
|
-
var THREE=__webpack_require__(4),Glyph=function(geometry,materialIn,idIn,glyphsetIn){(__webpack_require__(
|
|
520
|
+
var THREE=__webpack_require__(4),Glyph=function(geometry,materialIn,idIn,glyphsetIn){(__webpack_require__(10).ZincObject).call(this);var material;materialIn&&(material=materialIn.clone(),material.vertexColors=THREE.FaceColors);this.id=idIn;var label=void 0,labelString=void 0;/**
|
|
514
521
|
* Create a glyph using mesh
|
|
515
522
|
* @param {THREE.Mesh} meshIn - Mesh to create the glyph from
|
|
516
523
|
*
|
|
@@ -548,7 +555,7 @@ var THREE=__webpack_require__(4),Glyph=function(geometry,materialIn,idIn,glyphse
|
|
|
548
555
|
* @param {THREE.Color} color - Colour to be set.
|
|
549
556
|
*/ /**
|
|
550
557
|
* Clear and free its memory.
|
|
551
|
-
*/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__(
|
|
558
|
+
*/this.isGlyph=!0,this.fromMesh=meshIn=>!!(meshIn&&meshIn.isMesh)&&(this.morph=meshIn.clone(),this.morph.userData=this,this.group.add(this.morph),!0),geometry&&material&&this.fromMesh(new THREE.Mesh(geometry,material)),this.getGlyphset=function(){return glyphsetIn},this.setLabel=text=>{text&&("string"==typeof text||text instanceof String)&&(labelString=text,this.morph&&(this.morph.name=text)),label&&this.showLabel()},this.showLabel=colour=>{if(label&&(position=label.getPosition(),this.group.remove(label.getSprite()),label.dispose(),label=void 0),labelString&&("string"==typeof labelString||labelString instanceof String)){var _position=[0,0,0];label=new((__webpack_require__(17).Label))(labelString,colour),label.setPosition(_position[0],_position[1],_position[2]),this.group.add(label.getSprite())}},this.getLabel=()=>labelString,this.getMesh=()=>this.morph,this.setTransformation=(position,axis1,axis2,axis3)=>{this.morph&&(this.morph.matrix.elements[0]=axis1[0],this.morph.matrix.elements[1]=axis1[1],this.morph.matrix.elements[2]=axis1[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=axis2[0],this.morph.matrix.elements[5]=axis2[1],this.morph.matrix.elements[6]=axis2[2],this.morph.matrix.elements[7]=0,this.morph.matrix.elements[8]=axis3[0],this.morph.matrix.elements[9]=axis3[1],this.morph.matrix.elements[10]=axis3[2],this.morph.matrix.elements[11]=0,this.morph.matrix.elements[12]=position[0],this.morph.matrix.elements[13]=position[1],this.morph.matrix.elements[14]=position[2],this.morph.matrix.elements[15]=1,this.morph.matrixAutoUpdate=!1),label&&label.setPosition(position[0],position[1],position[2])},this.setColour=color=>{label&&label.setColour(color),this.secondaryMesh&&this.secondaryMesh.material&&(this.secondaryMesh.material.color=colour),this.geometry.colorsNeedUpdate=!0},this.dispose=()=>{this.material&&this.material.dispose(),this.morph=void 0}};/**
|
|
552
559
|
* Zinc representation of glyph graphic, it contains the colours,
|
|
553
560
|
* geometry and transformation of the glyph.
|
|
554
561
|
*
|
|
@@ -559,13 +566,13 @@ var THREE=__webpack_require__(4),Glyph=function(geometry,materialIn,idIn,glyphse
|
|
|
559
566
|
* @class
|
|
560
567
|
* @author Alan Wu
|
|
561
568
|
* @return {Glyph}
|
|
562
|
-
*/Glyph.prototype=Object.create((__webpack_require__(
|
|
569
|
+
*/Glyph.prototype=Object.create((__webpack_require__(10).ZincObject).prototype),exports.Glyph=Glyph;
|
|
563
570
|
|
|
564
571
|
/***/ }),
|
|
565
|
-
/*
|
|
572
|
+
/* 17 */
|
|
566
573
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
567
574
|
|
|
568
|
-
var SpriteText=(__webpack_require__(
|
|
575
|
+
var SpriteText=(__webpack_require__(7)["default"]);/**
|
|
569
576
|
* Bitmap labels, this is used with {@link Glyph} to
|
|
570
577
|
* provide labels.
|
|
571
578
|
*
|
|
@@ -606,18 +613,11 @@ var SpriteText=(__webpack_require__(17)["default"]);/**
|
|
|
606
613
|
* @return {String}
|
|
607
614
|
*/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<scaling&&sprite.scale.set(scaling,scaling,1)},this.dispose=()=>{sprite.dispose()},this.getSprite=()=>sprite,this.getString=()=>text};
|
|
608
615
|
|
|
609
|
-
/***/ }),
|
|
610
|
-
/* 17 */
|
|
611
|
-
/***/ ((module) => {
|
|
612
|
-
|
|
613
|
-
"use strict";
|
|
614
|
-
module.exports = require("three-spritetext");
|
|
615
|
-
|
|
616
616
|
/***/ }),
|
|
617
617
|
/* 18 */
|
|
618
618
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
619
619
|
|
|
620
|
-
function _readOnlyError(name){throw new TypeError("\""+name+"\" is read-only")}var THREE=__webpack_require__(4),JSONLoader=(__webpack_require__(19).JSONLoader),Glyphset=function(){(__webpack_require__(
|
|
620
|
+
function _readOnlyError(name){throw new TypeError("\""+name+"\" is read-only")}var THREE=__webpack_require__(4),JSONLoader=(__webpack_require__(19).JSONLoader),Glyphset=function(){(__webpack_require__(10).ZincObject).call(this);var glyphList=[],axis1s=void 0,axis2s=void 0,axis3s=void 0,positions=void 0,scales=void 0,colors=void 0,labels=void 0,numberOfTimeSteps=0,numberOfVertices=0,baseSize=[0,0,0],offset=[0,0,0],scaleFactors=[0,0,0],repeat_mode="NONE";this.ready=!1;var morphColours=!1,morphVertices=!1;this.isGlyphset=!0;for(var _transformMatrix=new THREE.Matrix4,_bot_colour=new THREE.Color,_top_colour=new THREE.Color,_boundingBox1=new THREE.Box3,_boundingBox2=new THREE.Box3,_boundingBox3=new THREE.Box3,_points=[],_current_positions=[],_current_axis1s=[],_current_axis2s=[],_current_axis3s=[],_current_scales=[],_current_colors=[],_glyph_axis_array=[],i=0;8>i;i++)_points[i]=new THREE.Vector3;/**
|
|
621
621
|
* Copy glyphset data into this glyphset then load the glyph's geoemtry
|
|
622
622
|
* with the provided glyphURL. FinishCallback will be called once
|
|
623
623
|
* glyph is loaded.
|
|
@@ -650,12 +650,12 @@ function _readOnlyError(name){throw new TypeError("\""+name+"\" is read-only")}v
|
|
|
650
650
|
* Create the glyphs in the glyphset.
|
|
651
651
|
*
|
|
652
652
|
* @param {Boolean} displayLabels -Flag to determine either the labels should be display or not.
|
|
653
|
-
*/var createGlyphs=displayLabels=>{if(labels!=null&&displayLabels)for(var glyph,_i6=0;_i6<numberOfVertices;_i6++)glyph=new((__webpack_require__(
|
|
653
|
+
*/var createGlyphs=displayLabels=>{if(labels!=null&&displayLabels)for(var glyph,_i6=0;_i6<numberOfVertices;_i6++)glyph=new((__webpack_require__(16).Glyph))(void 0,void 0,_i6,this),null!=labels&&null!=labels[_i6]&&glyph.setLabel(labels[_i6]),0<numberOfTimeSteps&&glyph.setFrustumCulled(!1),glyphList[_i6]=glyph,this.morph.add(glyph.getGroup());//Update the transformation of the glyphs.
|
|
654
654
|
labels!=null&&displayLabels&&this.showLabel(this.morph.material?this.morph.material.color:void 0),updateGlyphsetTransformation(positions[0],axis1s[0],axis2s[0],axis3s[0],scales[0]),colors!=null&&updateGlyphsetHexColors(colors[0]),this.ready=!0,this.boundingBoxUpdateRequired=!0};/**
|
|
655
655
|
* Add a custom {@link Glyph} to this {@link Glyphset}.
|
|
656
656
|
*
|
|
657
657
|
* @param {Glyph} Glyph to be added.
|
|
658
|
-
*/this.addCustomGlyph=glyph=>{glyph.isGlyph&&glyphList.push(glyph),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(mesh,id)=>{if(mesh.isMesh){var glyph=new((__webpack_require__(
|
|
658
|
+
*/this.addCustomGlyph=glyph=>{glyph.isGlyph&&glyphList.push(glyph),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(mesh,id)=>{if(mesh.isMesh){var glyph=new((__webpack_require__(16).Glyph))(void 0,void 0,id,this);return glyph.fromMesh(mesh),glyphList.push(glyph),this.morph.add(glyph.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,glyph}},this.forEachGlyph=callbackFunction=>{for(var _i7=0;_i7<glyphList.length;_i7++)callbackFunction(glyphList[_i7])};var meshloader=(finishCallback,displayLabels)=>(geometry,materials)=>{var tempGeometry=geometry.toBufferGeometry();this.geometry.copy(tempGeometry),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),tempGeometry.dispose(),materials&&materials[0]&&(this.morph.material=materials[0]),createGlyphs(displayLabels),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),geometry.dispose(),null!=finishCallback&&"function"==typeof finishCallback&&finishCallback(this)};/**
|
|
659
659
|
* Get the index of the closest vertex to centroid.
|
|
660
660
|
*/ /**
|
|
661
661
|
* Get the closest vertex to centroid.
|
|
@@ -692,7 +692,7 @@ labels!=null&&displayLabels&&this.showLabel(this.morph.material?this.morph.mater
|
|
|
692
692
|
* @class
|
|
693
693
|
* @author Alan Wu
|
|
694
694
|
* @return {Glyphset}
|
|
695
|
-
*/Glyphset.prototype=Object.create((__webpack_require__(
|
|
695
|
+
*/Glyphset.prototype=Object.create((__webpack_require__(10).ZincObject).prototype),exports.Glyphset=Glyphset;
|
|
696
696
|
|
|
697
697
|
/***/ }),
|
|
698
698
|
/* 19 */
|
|
@@ -778,7 +778,7 @@ var THREE=__webpack_require__(4),Points=(__webpack_require__(23).Points),toBuffe
|
|
|
778
778
|
*
|
|
779
779
|
* @param {Boolean} flag - Determin either size attenuation
|
|
780
780
|
* should be on or off.
|
|
781
|
-
*/(__webpack_require__(
|
|
781
|
+
*/(__webpack_require__(10).ZincObject).call(this),this.isPointset=!0,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)}},this.addPoints=(coords,labels,colour)=>{if(coords&&0<coords.length){var geometry=this.addVertices(coords),mesh=this.getMorph();if(!mesh){var material=new THREE.PointsMaterial({alphaTest:.5,size:10,color:colour,sizeAttenuation:!1});geometry.colorsNeedUpdate=!0,this.createMesh(geometry,material,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}},this.setSize=size=>{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)}};/**
|
|
782
782
|
* Provides an object which stores points and provides method which controls its position.
|
|
783
783
|
* This is created when a valid json file containing point is read into a {@link Zinc.Scene}
|
|
784
784
|
* object.
|
|
@@ -786,7 +786,7 @@ var THREE=__webpack_require__(4),Points=(__webpack_require__(23).Points),toBuffe
|
|
|
786
786
|
* @class
|
|
787
787
|
* @author Alan Wu
|
|
788
788
|
* @return {Pointset}
|
|
789
|
-
*/Pointset.prototype=Object.create((__webpack_require__(
|
|
789
|
+
*/Pointset.prototype=Object.create((__webpack_require__(10).ZincObject).prototype),exports.Pointset=Pointset;
|
|
790
790
|
|
|
791
791
|
/***/ }),
|
|
792
792
|
/* 23 */
|
|
@@ -827,7 +827,7 @@ var THREE=__webpack_require__(4),toBufferGeometry=(__webpack_require__(5).toBuff
|
|
|
827
827
|
* @param {Array} coords -An array of three components coordinates.
|
|
828
828
|
|
|
829
829
|
* @param {Number} colour - A hex value of the colour for the points
|
|
830
|
-
*/(__webpack_require__(
|
|
830
|
+
*/(__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<coords.length){var geometry=this.addVertices(coords),mesh=this.getMorph();if(!mesh){var material=new THREE.LineBasicMaterial({color:colour});geometry.colorsNeedUpdate=!0,this.createLineSegment(geometry,material,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}}};/**
|
|
831
831
|
* Provides an object which stores lines.
|
|
832
832
|
* This is created when a valid json file containing lines is read into a {@link Zinc.Scene}
|
|
833
833
|
* object.
|
|
@@ -835,7 +835,7 @@ var THREE=__webpack_require__(4),toBufferGeometry=(__webpack_require__(5).toBuff
|
|
|
835
835
|
* @class
|
|
836
836
|
* @author Alan Wu
|
|
837
837
|
* @return {Lines}
|
|
838
|
-
*/Lines.prototype=Object.create((__webpack_require__(
|
|
838
|
+
*/Lines.prototype=Object.create((__webpack_require__(10).ZincObject).prototype),exports.Lines=Lines;
|
|
839
839
|
|
|
840
840
|
/***/ }),
|
|
841
841
|
/* 25 */
|
|
@@ -982,13 +982,13 @@ var THREE=__webpack_require__(4),resolveURL=(__webpack_require__(5).resolveURL),
|
|
|
982
982
|
* @param {Object} textureData - contains the informations about the textures.
|
|
983
983
|
* @param {Function} finishCallback - User's function to be called once texture's
|
|
984
984
|
* is loaded.
|
|
985
|
-
*/(__webpack_require__(
|
|
985
|
+
*/(__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)}};/**
|
|
986
986
|
* Provides a base class object which stores textures and rendering object.
|
|
987
987
|
*
|
|
988
988
|
* @class
|
|
989
989
|
* @author Alan Wu
|
|
990
990
|
* @return {TexturePrimitive}
|
|
991
|
-
*/TexturePrimitive.prototype=Object.create((__webpack_require__(
|
|
991
|
+
*/TexturePrimitive.prototype=Object.create((__webpack_require__(10).ZincObject).prototype),TexturePrimitive.prototype.constructor=TexturePrimitive,exports.TexturePrimitive=TexturePrimitive;
|
|
992
992
|
|
|
993
993
|
/***/ }),
|
|
994
994
|
/* 30 */
|
|
@@ -1137,19 +1137,19 @@ var convertDurationObjectToString=duration=>[...(duration.years?["".concat(durat
|
|
|
1137
1137
|
* add to specify region and group name.
|
|
1138
1138
|
*/ /*
|
|
1139
1139
|
* Enable marker cluster to work with markers
|
|
1140
|
-
*/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.removeZincObjectAddedCallbacks=id=>{id in zincObjectAddedCallbacks_id&&delete zincObjectAddedCallbacks[id]},this.clearZincObjectAddedCallbacks=()=>{zincObjectAddedCallbacks={},zincObjectAddedCallbacks_id=0},this.triggerObjectAddedCallback=zincObject=>{for(var key in zincObjectAddedCallbacks)zincObjectAddedCallbacks.hasOwnProperty(key)&&zincObjectAddedCallbacks[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__(
|
|
1140
|
+
*/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.removeZincObjectAddedCallbacks=id=>{id in zincObjectAddedCallbacks_id&&delete zincObjectAddedCallbacks[id]},this.clearZincObjectAddedCallbacks=()=>{zincObjectAddedCallbacks={},zincObjectAddedCallbacks_id=0},this.triggerObjectAddedCallback=zincObject=>{for(var key in zincObjectAddedCallbacks)zincObjectAddedCallbacks.hasOwnProperty(key)&&zincObjectAddedCallbacks[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 children=tempGroup.children;children.forEach(child=>{child.geometry.dispose(),child.material.dispose()}),tempGroup.clear()},this.addBoundingBoxPrimitive=function(regionPath,group,colour,opacity,visibility){var boundingBox=5<arguments.length&&void 0!==arguments[5]?arguments[5]:void 0,region=rootRegion.findChildFromPath(regionPath);void 0===region&&(region=rootRegion.createChildFromPath(regionPath));var box=boundingBox?boundingBox:_this.getBoundingBox(),dim=new THREE.Vector3().subVectors(box.max,box.min),boxGeo=new THREE.BoxGeometry(dim.x,dim.y,dim.z);dim.addVectors(box.min,box.max).multiplyScalar(.5);var primitive=region.createGeometryFromThreeJSGeometry(group,boxGeo,colour,opacity,visibility,1e4);return primitive.setPosition(dim.x,dim.y,dim.z),primitive},this.enableMarkerCluster=flag=>{flag?(markerCluster.markerUpdateRequired=!0,markerCluster.enable()):(markerCluster.markerUpdateRequired=!1,markerCluster.disable()),this.forcePickableObjectsUpdate=!0}};
|
|
1141
1141
|
|
|
1142
1142
|
/***/ }),
|
|
1143
1143
|
/* 33 */
|
|
1144
1144
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1145
1145
|
|
|
1146
|
-
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<arguments.length;r++)t=null==arguments[r]?{}:arguments[r],r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))});return e}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==typeof i?i:i+""}function _toPrimitive(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var THREE=__webpack_require__(4),
|
|
1146
|
+
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<arguments.length;r++)t=null==arguments[r]?{}:arguments[r],r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))});return e}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==typeof i?i:i+""}function _toPrimitive(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var THREE=__webpack_require__(4),markerImage=new Image(128,128);markerImage.src=__webpack_require__(34);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),MarkerCluster=function(sceneIn){(__webpack_require__(10).ZincObject).call(this),this.texture=texture;var sprite=void 0;this.morph=new THREE.Group,this.group=this.morph,this.isMarkerCluster=!0;var enabled=!0,sprites=[];this.markers={};var _v21=new THREE.Vector2,_v22=new THREE.Vector2,start=Date.now();/**
|
|
1147
1147
|
* Set the size of the marker.
|
|
1148
1148
|
*
|
|
1149
1149
|
* @param {Number} size - size to be set.
|
|
1150
1150
|
*/this.setSpriteSize=size=>{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
|
|
1151
1151
|
//the sprite
|
|
1152
|
-
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,
|
|
1152
|
+
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<sprites.length;currentIndex++)sprites[currentIndex].group.visible=!1},getCluster=(markersObj,clusters)=>{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.
|
|
1153
1153
|
/**
|
|
1154
1154
|
* Enable and visualise the marker.
|
|
1155
1155
|
*/ /**
|
|
@@ -1162,7 +1162,7 @@ for(var prop in enabled=!1,this.morph.visible=!1,this.markers){var _this$markers
|
|
|
1162
1162
|
* @class
|
|
1163
1163
|
* @author Alan Wu
|
|
1164
1164
|
* @return {Marker}
|
|
1165
|
-
*/MarkerCluster.prototype=Object.create((__webpack_require__(
|
|
1165
|
+
*/MarkerCluster.prototype=Object.create((__webpack_require__(10).ZincObject).prototype),exports.MarkerCluster=MarkerCluster;
|
|
1166
1166
|
|
|
1167
1167
|
/***/ }),
|
|
1168
1168
|
/* 34 */
|
|
@@ -2146,9 +2146,7 @@ var{Group,Matrix4}=__webpack_require__(4),Pointset=(__webpack_require__(22).Poin
|
|
|
2146
2146
|
*/ /**
|
|
2147
2147
|
* Add a new geometry
|
|
2148
2148
|
*/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<paths.length){var fullPath=paths.shift();return paths.forEach(path=>{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<children.length;i++)if(children[i].getName().toLowerCase()===lowerChildName)return children[i]},this.findChildFromSeparatedPath=pathArray=>{if(pathArray&&0<pathArray.length&&""===pathArray[0]&&pathArray.shift(),pathArray&&0<pathArray.length){var childRegion=this.getChildWithName(pathArray[0]);return childRegion?(pathArray.shift(),childRegion.findChildFromSeparatedPath(pathArray)):void 0}return this},this.findChildFromPath=path=>{var pathArray=path.split("/");return this.findChildFromSeparatedPath(pathArray)},this.createChildFromSeparatedPath=pathArray=>{if(0<pathArray.length&&""===pathArray[0]&&pathArray.shift(),0<pathArray.length){var childRegion=this.getChildWithName(pathArray[0]);return childRegion||(childRegion=this.createChild(pathArray[0])),pathArray.shift(),childRegion.createChildFromSeparatedPath(pathArray)}return this},this.createChildFromPath=path=>{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<zincObjects.length;i++)if(zincObject===zincObjects[i])return group.remove(zincObject.getGroup()),zincObjects.splice(i,1),void zincObject.dispose()},this.checkPickableUpdateRequred=transverse=>{if(this.pickableUpdateRequired)return!0;if(transverse)for(var flag=!1,i=0;i<children.length;i++)if(flag=children[i].checkPickableUpdateRequred(transverse),flag)return!0;return!1},this.getPickableThreeJSObjects=(objectsList,transverse)=>(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.length;i++)if(zincObject===zincObjects[i])return!0;if(transverse)for(var _i=0;_i<children.length;_i++)if(children[_i].objectIsInRegion(zincObject,transverse))return!0;return!1},this.forEachGeometry=(callbackFunction,transverse)=>{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<children.length;i++)if(time=children[i].getCurrentTime(),-1!==time)return time;return-1},this.setMorphTime=(time,transverse)=>{zincObjects.forEach(zincObject=>{zincObject.setMorphTime(time)}),transverse&&children.forEach(childRegion=>{childRegion.setMorphTime(time)})},this.isTimeVarying=()=>{for(var i=0;i<zincObjects.length;i++)if(zincObjects[i].isTimeVarying())return!0;for(var _i2=0;_i2<children.length;_i2++)if(children[_i2].isTimeVarying())return!0;return!1},this.renderGeometries=(playRate,delta,playAnimation,cameraControls,options,transverse)=>{var _options$markerCluste,allObjects=this.getAllObjects(transverse);// Let video dictates the progress if one is present
|
|
2149
|
-
|
|
2150
|
-
//one entry in markersList is greater than 1, markers have been enabled.
|
|
2151
|
-
if(allObjects.forEach(zincObject=>{zincObject.render(playRate*delta,playAnimation,cameraControls,options)}),options&&!1===playAnimation&&null!==options&&void 0!==options&&null!==(_options$markerCluste=options.markerCluster)&&void 0!==_options$markerCluste&&_options$markerCluste.markerUpdateRequired){var markerDepths=Object.values(options.markersList).map(marker=>marker.ndc.z);if(1<markerDepths.length){var min=Math.min(...markerDepths),max=Math.max(...markerDepths);allObjects.forEach(zincObject=>{zincObject.processMarkerVisual(min,max)})}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<index?zincObjects[index]:new Pointset;return pointset.addPoints(coords,labels,colour),-1===index?(pointset.setName(groupName),this.addZincObject(pointset),isNew=!0):this.pickableUpdateRequired=!0,{zincObject:pointset,isNew}},this.createLines=(groupName,coords,colour)=>{var isNew=!1,zincObjects=this.findObjectsWithGroupName(groupName,!1),index=zincObjects.findIndex(zincObject=>zincObject.isLines),lines=-1<index?zincObjects[index]:new Lines2;return lines.addLines(coords,colour),-1===index?(lines.setName(groupName),this.addZincObject(lines),isNew=!0):this.pickableUpdateRequired=!0,{zincObject:lines,isNew}},this.createGeometryFromThreeJSGeometry=(groupName,geometry,colour,opacity,visibility,renderOrder)=>{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}};/**
|
|
2149
|
+
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<index?zincObjects[index]:new Pointset;return pointset.addPoints(coords,labels,colour),-1===index?(pointset.setName(groupName),this.addZincObject(pointset),isNew=!0):this.pickableUpdateRequired=!0,{zincObject:pointset,isNew}},this.createLines=(groupName,coords,colour)=>{var isNew=!1,zincObjects=this.findObjectsWithGroupName(groupName,!1),index=zincObjects.findIndex(zincObject=>zincObject.isLines),lines=-1<index?zincObjects[index]:new Lines2;return lines.addLines(coords,colour),-1===index?(lines.setName(groupName),this.addZincObject(lines),isNew=!0):this.pickableUpdateRequired=!0,{zincObject:lines,isNew}},this.createGeometryFromThreeJSGeometry=(groupName,geometry,colour,opacity,visibility,renderOrder)=>{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}};/**
|
|
2152
2150
|
* Provides a hierachical structure to objects, Each region
|
|
2153
2151
|
* may contain multiple child regions and {@link ZincObject}.
|
|
2154
2152
|
*
|