@xeokit/xeokit-sdk 2.6.51 → 2.6.53
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/dist/xeokit-sdk.cjs.js +56 -41
- package/dist/xeokit-sdk.es.js +56 -41
- package/dist/xeokit-sdk.es5.js +68 -70
- package/dist/xeokit-sdk.min.cjs.js +1 -1
- package/dist/xeokit-sdk.min.es.js +1 -1
- package/dist/xeokit-sdk.min.es5.js +1 -1
- package/package.json +1 -1
- package/src/plugins/StoreyViewsPlugin/StoreyViewsPlugin.js +36 -15
- package/src/plugins/TreeViewPlugin/TreeViewPlugin.js +20 -19
package/dist/xeokit-sdk.es5.js
CHANGED
|
@@ -26494,7 +26494,7 @@ var sca=Math.abs(diag/Math.tan(fitFOV*math.DEGTORAD));var orthoScale2=diag*1.3;v
|
|
|
26494
26494
|
* @param {Number} [options.height=300] Image height in pixels, as an alternative to width. Width will be automatically determined from this, if not given.
|
|
26495
26495
|
* @param {String} [options.format="png"] Image format. Accepted values are "png" and "jpeg".
|
|
26496
26496
|
* @returns {StoreyMap} The StoreyMap.
|
|
26497
|
-
*/},{key:"createStoreyMap",value:function createStoreyMap(storeyId){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var storey=this.storeys[storeyId];if(!storey){this.error("IfcBuildingStorey not found with this ID: "+storeyId);return EMPTY_IMAGE;}var viewer=this.viewer;var scene=viewer.scene;var format=options.format||"png";var aabb=this._fitStoreyMaps?storey.storeyAABB:storey.modelAABB;var aspect=Math.abs((aabb[5]-aabb[2])/(aabb[3]-aabb[0]));var padding=options.padding||0;var width;var height;if(options.width&&options.height){width=options.width;height=options.height;}else if(options.height){height=options.height;width=Math.round(height/aspect);}else if(options.width){width=options.width;height=Math.round(width*aspect);}else{width=300;height=Math.round(width*aspect);}this._objectsMemento.saveObjects(scene);this._cameraMemento.saveCamera(scene);this.showStoreyObjects(storeyId,utils.apply(options,{hideOthers:true}));this._arrangeStoreyMapCamera(storey);var src=viewer.getSnapshot({width:width,height:height,format:format});this._objectsMemento.restoreObjects(scene);this._cameraMemento.restoreCamera(scene);return new StoreyMap(storeyId,src,format,width,height,padding);}},{key:"_arrangeStoreyMapCamera",value:function _arrangeStoreyMapCamera(storey){var viewer=this.viewer;var scene=viewer.scene;var camera=scene.camera;var aabb=this._fitStoreyMaps?storey.storeyAABB:storey.modelAABB;var look=math.getAABB3Center(aabb);var sca=0.5;var eye=tempVec3a$2;eye[0]=look[0]+camera.worldUp[0]*sca;eye[1]=look[1]+camera.worldUp[1]*sca;eye[2]=look[2]+camera.worldUp[2]*sca;var up=camera.worldForward;viewer.cameraFlight.jumpTo({eye:eye,look:look,up:up});var xHalfSize=(aabb[3]-aabb[0])/2;var yHalfSize=(aabb[4]-aabb[1])/2;var zHalfSize=(aabb[5]-aabb[2])/2;var xmin=-xHalfSize;var xmax=+xHalfSize;var ymin=-yHalfSize;var ymax=+yHalfSize;var zmin=-zHalfSize;var zmax=+zHalfSize;viewer.camera.customProjection.matrix=math.orthoMat4c(xmin,xmax,zmin,zmax,ymin,ymax,tempMat4);viewer.camera.projection="customProjection";}/**
|
|
26497
|
+
*/},{key:"createStoreyMap",value:function createStoreyMap(storeyId){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var storey=this.storeys[storeyId];if(!storey){this.error("IfcBuildingStorey not found with this ID: "+storeyId);return EMPTY_IMAGE;}var viewer=this.viewer;var scene=viewer.scene;var format=options.format||"png";var aabb=this._fitStoreyMaps?storey.storeyAABB:storey.modelAABB;var aspect=Math.abs((aabb[5]-aabb[2])/(aabb[3]-aabb[0]));var padding=options.padding||0;var width;var height;if(options.width&&options.height){width=options.width;height=options.height;}else if(options.height){height=options.height;width=Math.round(height/aspect);}else if(options.width){width=options.width;height=Math.round(width*aspect);}else{width=300;height=Math.round(width*aspect);}var mask={visible:true};this._objectsMemento.saveObjects(scene,mask);this._cameraMemento.saveCamera(scene);this.showStoreyObjects(storeyId,utils.apply(options,{hideOthers:true}));this._arrangeStoreyMapCamera(storey);var src=viewer.getSnapshot({width:width,height:height,format:format});this._objectsMemento.restoreObjects(scene,mask);this._cameraMemento.restoreCamera(scene);return new StoreyMap(storeyId,src,format,width,height,padding);}},{key:"_arrangeStoreyMapCamera",value:function _arrangeStoreyMapCamera(storey){var viewer=this.viewer;var scene=viewer.scene;var camera=scene.camera;var aabb=this._fitStoreyMaps?storey.storeyAABB:storey.modelAABB;var look=math.getAABB3Center(aabb);var sca=0.5;var eye=tempVec3a$2;eye[0]=look[0]+camera.worldUp[0]*sca;eye[1]=look[1]+camera.worldUp[1]*sca;eye[2]=look[2]+camera.worldUp[2]*sca;var up=camera.worldForward;viewer.cameraFlight.jumpTo({eye:eye,look:look,up:up});var xHalfSize=(aabb[3]-aabb[0])/2;var yHalfSize=(aabb[4]-aabb[1])/2;var zHalfSize=(aabb[5]-aabb[2])/2;var xmin=-xHalfSize;var xmax=+xHalfSize;var ymin=-yHalfSize;var ymax=+yHalfSize;var zmin=-zHalfSize;var zmax=+zHalfSize;viewer.camera.customProjection.matrix=math.orthoMat4c(xmin,xmax,zmin,zmax,ymin,ymax,tempMat4);viewer.camera.projection="customProjection";}/**
|
|
26498
26498
|
* Attempts to pick an {@link Entity} at the given pixel coordinates within a StoreyMap image.
|
|
26499
26499
|
*
|
|
26500
26500
|
* @param {StoreyMap} storeyMap The StoreyMap.
|
|
@@ -26515,7 +26515,7 @@ pickSurface:options.pickSurface,pickInvisible:true,matrix:matrix});return pickRe
|
|
|
26515
26515
|
* @returns {String} ID of the storey containing the position, or null if the position falls outside all the storeys.
|
|
26516
26516
|
*/},{key:"getStoreyInVerticalRange",value:function getStoreyInVerticalRange(worldPos){for(var storeyId in this.storeys){var storey=this.storeys[storeyId];var aabb=[0,0,0,0,0,0],pos=[0,0,0];aabb[1]=storey.storeyAABB[1];aabb[4]=storey.storeyAABB[4];pos[1]=worldPos[1];if(math.point3AABB3AbsoluteIntersect(aabb,pos)){return storeyId;}}return null;}/**
|
|
26517
26517
|
* Returns whether a position is above or below a building
|
|
26518
|
-
*
|
|
26518
|
+
*
|
|
26519
26519
|
* @param {Number[]} worldPos 3D World-space position.
|
|
26520
26520
|
* @returns {String} ID of the lowest/highest story or null.
|
|
26521
26521
|
*/},{key:"isPositionAboveOrBelowBuilding",value:function isPositionAboveOrBelowBuilding(worldPos){var keys=Object.keys(this.storeys);var ids=[keys[0],keys[keys.length-1]];if(worldPos[1]<this.storeys[ids[0]].storeyAABB[1])return ids[0];else if(worldPos[1]>this.storeys[ids[1]].storeyAABB[4])return ids[1];return null;}/**
|
|
@@ -26540,7 +26540,7 @@ imagePos[0]=Math.floor(storeyMap.width-(worldPos[0]-xmin)*ratioX);imagePos[1]=Ma
|
|
|
26540
26540
|
* Gets Storeys in a list, spatially sorted on the vertical World axis, the lowest Storey first.
|
|
26541
26541
|
*
|
|
26542
26542
|
* @returns {null}
|
|
26543
|
-
*/},{key:"storeysList",get:function get(){if(!this._storeysList){this._storeysList=Object.values(this.storeys);this._storeysList.sort(this._getSpatialSortFunc());}return this._storeysList;}},{key:"_getSpatialSortFunc",value:function _getSpatialSortFunc(){var viewer=this.viewer;var scene=viewer.scene;var camera=scene.camera;return this._spatialSortFunc||(this._spatialSortFunc=function(storey1,storey2){var idx=0;if(camera.xUp){idx=0;}else if(camera.yUp){idx=1;}else{idx=2;}if(storey1.aabb[idx]>storey2.aabb[idx]){return-1;}if(storey1.aabb[idx]<storey2.aabb[idx]){return 1;}return 0;});}}]);return StoreyViewsPlugin;}(Plugin);var zeroVec=new Float64Array([0,0,1]);var quat=new Float64Array(4);/**
|
|
26543
|
+
*/},{key:"storeysList",get:function get(){if(!this._storeysList){this._storeysList=Object.values(this.storeys);this._storeysList.sort(this._getSpatialSortFunc());}return this._storeysList;}},{key:"_getSpatialSortFunc",value:function _getSpatialSortFunc(){var _this144=this;var viewer=this.viewer;var scene=viewer.scene;var camera=scene.camera;return this._spatialSortFunc||(this._spatialSortFunc=function(storey1,storey2){var idx=0;if(camera.xUp){idx=0;}else if(camera.yUp){idx=1;}else{idx=2;}var metaScene=_this144.viewer.metaScene;var storey1MetaObject=metaScene.metaObjects[storey1.storeyId];var storey2MetaObject=metaScene.metaObjects[storey2.storeyId];if(storey1MetaObject&&storey1MetaObject.attributes&&storey1MetaObject.attributes.elevation!==undefined&&storey2MetaObject&&storey2MetaObject.attributes&&storey2MetaObject.attributes.elevation!==undefined){var elevation1=storey1MetaObject.attributes.elevation;var elevation2=storey2MetaObject.attributes.elevation;if(elevation1>elevation2){return-1;}if(elevation1<elevation2){return 1;}return 0;}else{if(storey1.aabb[idx]>storey2.aabb[idx]){return-1;}if(storey1.aabb[idx]<storey2.aabb[idx]){return 1;}return 0;}});}}]);return StoreyViewsPlugin;}(Plugin);var zeroVec=new Float64Array([0,0,1]);var quat=new Float64Array(4);/**
|
|
26544
26544
|
* Controls a {@link SectionPlane} with mouse and touch input.
|
|
26545
26545
|
*/var FaceAlignedSectionPlanesControl=/*#__PURE__*/function(){/** @private */function FaceAlignedSectionPlanesControl(plugin){_classCallCheck(this,FaceAlignedSectionPlanesControl);/**
|
|
26546
26546
|
* ID of this FaceAlignedSectionPlanesControl.
|
|
@@ -26559,7 +26559,7 @@ this._ignoreNextSectionPlaneDirUpdate=false;this._createNodes();this._bindEvents
|
|
|
26559
26559
|
* FaceAlignedSectionPlanesPlugin keeps FaceAlignedSectionPlanesControls in a reuse pool.
|
|
26560
26560
|
* Call with a null or undefined value to disconnect the FaceAlignedSectionPlanesControl ffrom whatever SectionPlane it was assigned to.
|
|
26561
26561
|
* @private
|
|
26562
|
-
*/_createClass(FaceAlignedSectionPlanesControl,[{key:"_setSectionPlane",value:function _setSectionPlane(sectionPlane){var
|
|
26562
|
+
*/_createClass(FaceAlignedSectionPlanesControl,[{key:"_setSectionPlane",value:function _setSectionPlane(sectionPlane){var _this145=this;if(this._sectionPlane){this._sectionPlane.off(this._onSectionPlanePos);this._sectionPlane.off(this._onSectionPlaneDir);this._onSectionPlanePos=null;this._onSectionPlaneDir=null;this._sectionPlane=null;}if(sectionPlane){this.id=sectionPlane.id;this._setPos(sectionPlane.pos);this._setDir(sectionPlane.dir);this._sectionPlane=sectionPlane;this._onSectionPlanePos=sectionPlane.on("pos",function(){_this145._setPos(_this145._sectionPlane.pos);});this._onSectionPlaneDir=sectionPlane.on("dir",function(){if(!_this145._ignoreNextSectionPlaneDirUpdate){_this145._setDir(_this145._sectionPlane.dir);}else{_this145._ignoreNextSectionPlaneDirUpdate=false;}});}}/**
|
|
26563
26563
|
* Gets the {@link SectionPlane} controlled by this FaceAlignedSectionPlanesControl.
|
|
26564
26564
|
* @returns {SectionPlane} The SectionPlane.
|
|
26565
26565
|
*/},{key:"sectionPlane",get:function get(){return this._sectionPlane;}/** @private */},{key:"_setPos",value:function _setPos(xyz){this._pos.set(xyz);worldToRTCPos(this._pos,this._origin,this._rtcPos);this._rootNode.origin=this._origin;this._rootNode.position=this._rtcPos;}/** @private */},{key:"_setDir",value:function _setDir(xyz){this._baseDir.set(xyz);this._rootNode.quaternion=math.vec3PairToQuaternion(zeroVec,xyz,quat);}},{key:"_setSectionPlaneDir",value:function _setSectionPlaneDir(dir){if(this._sectionPlane){this._ignoreNextSectionPlaneDirUpdate=true;this._sectionPlane.dir=dir;}}/**
|
|
@@ -26585,15 +26585,15 @@ edges:false,fill:true,fillColor:[1,0,0],fillAlpha:0.6})};this._displayMeshes={pl
|
|
|
26585
26585
|
0.5,0.5,-0.0,0.5,-0.5,-0.0,// 2
|
|
26586
26586
|
-0.5,-0.5,-0.0,-0.5,0.5,-0.0// 3
|
|
26587
26587
|
],indices:[0,1,2,2,3,0]}),material:new PhongMaterial(rootNode,{emissive:[0,0.0,0],diffuse:[0,0,0],backfaces:true}),opacity:0.6,ghosted:true,pickable:false,collidable:true,clippable:false,visible:false,scale:[2.4,2.4,1]}),NO_STATE_INHERIT),planeFrame:rootNode.addChild(new Mesh(rootNode,{// Visible frame
|
|
26588
|
-
geometry:new ReadableGeometry(rootNode,buildTorusGeometry({center:[0,0,0],radius:1.7,tube:tubeRadius*2,radialSegments:4,tubeSegments:4,arc:Math.PI*2.0})),material:new PhongMaterial(rootNode,{emissive:[0,0,0],diffuse:[0,0,0],specular:[0,0,0],shininess:0}),pickable:false,collidable:false,clippable:false,visible:false,scale:[1,1,.1],rotation:[0,0,45]}),NO_STATE_INHERIT),center:rootNode.addChild(new Mesh(rootNode,{geometry:new ReadableGeometry(rootNode,buildSphereGeometry({radius:0.05})),material:materials.center,pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),zAxisArrow:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.blue,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0.8,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),zShaft:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.axis,material:materials.blue,matrix:function(){var translate=math.translateMat4c(0,radius/2,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),clippable:false,pickable:false,collidable:true,visible:false}),NO_STATE_INHERIT)};this._affordanceMeshes={planeFrame:rootNode.addChild(new Mesh(rootNode,{geometry:new ReadableGeometry(rootNode,buildTorusGeometry({center:[0,0,0],radius:2,tube:tubeRadius,radialSegments:4,tubeSegments:4,arc:Math.PI*2.0})),material:new PhongMaterial(rootNode,{ambient:[1,1,1],diffuse:[0,0,0],emissive:[1,1,0]}),highlighted:true,highlightMaterial:new EmphasisMaterial(rootNode,{edges:false,filled:true,fillColor:[1,1,0],fillAlpha:1.0}),pickable:false,collidable:false,clippable:false,visible:false,scale:[1,1,1],rotation:[0,0,45]}),NO_STATE_INHERIT),zAxisArrow:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHeadBig,material:materials.blue,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0.8,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT)};}},{key:"_bindEvents",value:function _bindEvents(){var
|
|
26589
|
-
var _tempVec3a2=math.vec3([0,0,0]);var lastDist=-1;this._onCameraViewMatrix=scene.camera.on("viewMatrix",function(){});this._onCameraProjMatrix=scene.camera.on("projMatrix",function(){});this._onSceneTick=scene.on("tick",function(){waitForTick=false;var dist=Math.abs(math.lenVec3(math.subVec3(scene.camera.eye,
|
|
26590
|
-
down=true;var canvasPos=getClickCoordsWithinElement(e);lastCanvasPos[0]=canvasPos[0];lastCanvasPos[1]=canvasPos[1];break;}});this._plugin._controlElement.addEventListener("mousemove",this._canvasMouseMoveListener=function(e){if(!
|
|
26591
|
-
return;}var canvasPos=getClickCoordsWithinElement(e);var x=canvasPos[0];var y=canvasPos[1];moveSectionPlane(y-lastCanvasPos[1]);lastCanvasPos[0]=x;lastCanvasPos[1]=y;});this._plugin._controlElement.addEventListener("mouseup",this._canvasMouseUpListener=function(e){if(!
|
|
26592
|
-
return;}waitForTick=true;touchEndY=e.touches[0].clientY;if(lastTouchY!==null){deltaUpdate+=touchEndY-lastTouchY;}lastTouchY=touchEndY;});this._plugin._controlElement.addEventListener("touchend",this._handleTouchEnd=function(e){e.stopPropagation();e.preventDefault();if(!
|
|
26588
|
+
geometry:new ReadableGeometry(rootNode,buildTorusGeometry({center:[0,0,0],radius:1.7,tube:tubeRadius*2,radialSegments:4,tubeSegments:4,arc:Math.PI*2.0})),material:new PhongMaterial(rootNode,{emissive:[0,0,0],diffuse:[0,0,0],specular:[0,0,0],shininess:0}),pickable:false,collidable:false,clippable:false,visible:false,scale:[1,1,.1],rotation:[0,0,45]}),NO_STATE_INHERIT),center:rootNode.addChild(new Mesh(rootNode,{geometry:new ReadableGeometry(rootNode,buildSphereGeometry({radius:0.05})),material:materials.center,pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),zAxisArrow:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHead,material:materials.blue,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0.8,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT),zShaft:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.axis,material:materials.blue,matrix:function(){var translate=math.translateMat4c(0,radius/2,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[1,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),clippable:false,pickable:false,collidable:true,visible:false}),NO_STATE_INHERIT)};this._affordanceMeshes={planeFrame:rootNode.addChild(new Mesh(rootNode,{geometry:new ReadableGeometry(rootNode,buildTorusGeometry({center:[0,0,0],radius:2,tube:tubeRadius,radialSegments:4,tubeSegments:4,arc:Math.PI*2.0})),material:new PhongMaterial(rootNode,{ambient:[1,1,1],diffuse:[0,0,0],emissive:[1,1,0]}),highlighted:true,highlightMaterial:new EmphasisMaterial(rootNode,{edges:false,filled:true,fillColor:[1,1,0],fillAlpha:1.0}),pickable:false,collidable:false,clippable:false,visible:false,scale:[1,1,1],rotation:[0,0,45]}),NO_STATE_INHERIT),zAxisArrow:rootNode.addChild(new Mesh(rootNode,{geometry:shapes.arrowHeadBig,material:materials.blue,matrix:function(){var translate=math.translateMat4c(0,radius+.1,0,math.identityMat4());var rotate=math.rotationMat4v(-90*math.DEGTORAD,[0.8,0,0],math.identityMat4());return math.mulMat4(rotate,translate,math.identityMat4());}(),pickable:false,collidable:true,clippable:false,visible:false}),NO_STATE_INHERIT)};}},{key:"_bindEvents",value:function _bindEvents(){var _this146=this;var rootNode=this._rootNode;var lastCanvasPos=math.vec2();var camera=this._viewer.camera;var scene=this._viewer.scene;var deltaUpdate=0;var waitForTick=false;{// Keep gizmo screen size constant
|
|
26589
|
+
var _tempVec3a2=math.vec3([0,0,0]);var lastDist=-1;this._onCameraViewMatrix=scene.camera.on("viewMatrix",function(){});this._onCameraProjMatrix=scene.camera.on("projMatrix",function(){});this._onSceneTick=scene.on("tick",function(){waitForTick=false;var dist=Math.abs(math.lenVec3(math.subVec3(scene.camera.eye,_this146._pos,_tempVec3a2)));if(dist!==lastDist){if(camera.projection==="perspective"){var worldSize=Math.tan(camera.perspective.fov*math.DEGTORAD)*dist;var size=0.07*worldSize;rootNode.scale=[size,size,size];lastDist=dist;}}if(camera.projection==="ortho"){var _worldSize2=camera.ortho.scale/10;var _size2=_worldSize2;rootNode.scale=[_size2,_size2,_size2];lastDist=dist;}if(deltaUpdate!==0){moveSectionPlane(deltaUpdate);deltaUpdate=0;}});}var getClickCoordsWithinElement=function(){var canvasPos=new Float64Array(2);return function(event){if(!event){event=window.event;canvasPos[0]=event.x;canvasPos[1]=event.y;}else{var element=event.target;var totalOffsetLeft=0;var totalOffsetTop=0;while(element.offsetParent){totalOffsetLeft+=element.offsetLeft;totalOffsetTop+=element.offsetTop;element=element.offsetParent;}canvasPos[0]=event.pageX-totalOffsetLeft;canvasPos[1]=event.pageY-totalOffsetTop;}return canvasPos;};}();var moveSectionPlane=function moveSectionPlane(delta){var pos=_this146._sectionPlane.pos;var dir=_this146._sectionPlane.dir;math.addVec3(pos,math.mulVec3Scalar(dir,0.1*delta*_this146._plugin.getDragSensitivity(),math.vec3()));_this146._sectionPlane.pos=pos;};{var down=false;this._plugin._controlElement.addEventListener("mousedown",this._canvasMouseDownListener=function(e){e.preventDefault();if(!_this146._visible){return;}_this146._viewer.cameraControl.pointerEnabled=false;switch(e.which){case 1:// Left button
|
|
26590
|
+
down=true;var canvasPos=getClickCoordsWithinElement(e);lastCanvasPos[0]=canvasPos[0];lastCanvasPos[1]=canvasPos[1];break;}});this._plugin._controlElement.addEventListener("mousemove",this._canvasMouseMoveListener=function(e){if(!_this146._visible){return;}if(!down){return;}if(waitForTick){// Limit changes detection to one per frame
|
|
26591
|
+
return;}var canvasPos=getClickCoordsWithinElement(e);var x=canvasPos[0];var y=canvasPos[1];moveSectionPlane(y-lastCanvasPos[1]);lastCanvasPos[0]=x;lastCanvasPos[1]=y;});this._plugin._controlElement.addEventListener("mouseup",this._canvasMouseUpListener=function(e){if(!_this146._visible){return;}_this146._viewer.cameraControl.pointerEnabled=true;if(!down){return;}switch(e.which){}down=false;});this._plugin._controlElement.addEventListener("wheel",this._canvasWheelListener=function(e){if(!_this146._visible){return;}deltaUpdate+=Math.max(-1,Math.min(1,-e.deltaY*40));});}{var touchStartY,touchEndY;var lastTouchY=null;this._plugin._controlElement.addEventListener("touchstart",this._handleTouchStart=function(e){e.stopPropagation();e.preventDefault();if(!_this146._visible){return;}touchStartY=e.touches[0].clientY;lastTouchY=touchStartY;deltaUpdate=0;});this._plugin._controlElement.addEventListener("touchmove",this._handleTouchMove=function(e){e.stopPropagation();e.preventDefault();if(!_this146._visible){return;}if(waitForTick){// Limit changes detection to one per frame
|
|
26592
|
+
return;}waitForTick=true;touchEndY=e.touches[0].clientY;if(lastTouchY!==null){deltaUpdate+=touchEndY-lastTouchY;}lastTouchY=touchEndY;});this._plugin._controlElement.addEventListener("touchend",this._handleTouchEnd=function(e){e.stopPropagation();e.preventDefault();if(!_this146._visible){return;}touchStartY=null;touchEndY=null;deltaUpdate=0;});}}},{key:"_destroy",value:function _destroy(){this._unbindEvents();this._destroyNodes();}},{key:"_unbindEvents",value:function _unbindEvents(){var viewer=this._viewer;var scene=viewer.scene;var canvas=scene.canvas.canvas;var camera=viewer.camera;var controlElement=this._plugin._controlElement;scene.off(this._onSceneTick);canvas.removeEventListener("mousedown",this._canvasMouseDownListener);canvas.removeEventListener("mousemove",this._canvasMouseMoveListener);canvas.removeEventListener("mouseup",this._canvasMouseUpListener);canvas.removeEventListener("wheel",this._canvasWheelListener);controlElement.removeEventListener("touchstart",this._handleTouchStart);controlElement.removeEventListener("touchmove",this._handleTouchMove);controlElement.removeEventListener("touchend",this._handleTouchEnd);camera.off(this._onCameraViewMatrix);camera.off(this._onCameraProjMatrix);}},{key:"_destroyNodes",value:function _destroyNodes(){this._setSectionPlane(null);this._rootNode.destroy();this._displayMeshes={};this._affordanceMeshes={};}}]);return FaceAlignedSectionPlanesControl;}();/**
|
|
26593
26593
|
* Renders a 3D plane within an {@link Overview} to indicate its {@link SectionPlane}'s current position and orientation.
|
|
26594
26594
|
*
|
|
26595
26595
|
* @private
|
|
26596
|
-
*/var Plane=/*#__PURE__*/function(){/** @private */function Plane(overview,overviewScene,sectionPlane){var
|
|
26596
|
+
*/var Plane=/*#__PURE__*/function(){/** @private */function Plane(overview,overviewScene,sectionPlane){var _this147=this;_classCallCheck(this,Plane);/**
|
|
26597
26597
|
* The ID of this SectionPlanesOverviewPlane.
|
|
26598
26598
|
*
|
|
26599
26599
|
* @type {String}
|
|
@@ -26601,7 +26601,7 @@ return;}waitForTick=true;touchEndY=e.touches[0].clientY;if(lastTouchY!==null){de
|
|
|
26601
26601
|
* The {@link SectionPlane} represented by this SectionPlanesOverviewPlane.
|
|
26602
26602
|
*
|
|
26603
26603
|
* @type {SectionPlane}
|
|
26604
|
-
*/this._sectionPlane=sectionPlane;this._mesh=new Mesh(overviewScene,{id:sectionPlane.id,geometry:new ReadableGeometry(overviewScene,buildBoxGeometry({xSize:.5,ySize:.5,zSize:.001})),material:new PhongMaterial(overviewScene,{emissive:[1,1,1],diffuse:[0,0,0],backfaces:false}),edgeMaterial:new EdgeMaterial(overviewScene,{edgeColor:[0.0,0.0,0.0],edgeAlpha:1.0,edgeWidth:1}),highlightMaterial:new EmphasisMaterial(overviewScene,{fill:true,fillColor:[0.5,1,0.5],fillAlpha:0.7,edges:true,edgeColor:[0.0,0.0,0.0],edgeAlpha:1.0,edgeWidth:1}),selectedMaterial:new EmphasisMaterial(overviewScene,{fill:true,fillColor:[0,0,1],fillAlpha:0.7,edges:true,edgeColor:[1.0,0.0,0.0],edgeAlpha:1.0,edgeWidth:1}),highlighted:true,scale:[3,3,3],position:[0,0,0],rotation:[0,0,0],opacity:0.3,edges:true});{var vec=math.vec3([0,0,0]);var pos2=math.vec3();var _zeroVec2=math.vec3([0,0,1]);var _quat2=math.vec4(4);var pos3=math.vec3();var update=function update(){var origin=
|
|
26604
|
+
*/this._sectionPlane=sectionPlane;this._mesh=new Mesh(overviewScene,{id:sectionPlane.id,geometry:new ReadableGeometry(overviewScene,buildBoxGeometry({xSize:.5,ySize:.5,zSize:.001})),material:new PhongMaterial(overviewScene,{emissive:[1,1,1],diffuse:[0,0,0],backfaces:false}),edgeMaterial:new EdgeMaterial(overviewScene,{edgeColor:[0.0,0.0,0.0],edgeAlpha:1.0,edgeWidth:1}),highlightMaterial:new EmphasisMaterial(overviewScene,{fill:true,fillColor:[0.5,1,0.5],fillAlpha:0.7,edges:true,edgeColor:[0.0,0.0,0.0],edgeAlpha:1.0,edgeWidth:1}),selectedMaterial:new EmphasisMaterial(overviewScene,{fill:true,fillColor:[0,0,1],fillAlpha:0.7,edges:true,edgeColor:[1.0,0.0,0.0],edgeAlpha:1.0,edgeWidth:1}),highlighted:true,scale:[3,3,3],position:[0,0,0],rotation:[0,0,0],opacity:0.3,edges:true});{var vec=math.vec3([0,0,0]);var pos2=math.vec3();var _zeroVec2=math.vec3([0,0,1]);var _quat2=math.vec4(4);var pos3=math.vec3();var update=function update(){var origin=_this147._sectionPlane.scene.center;var negDir=[-_this147._sectionPlane.dir[0],-_this147._sectionPlane.dir[1],-_this147._sectionPlane.dir[2]];math.subVec3(origin,_this147._sectionPlane.pos,vec);var dist=-math.dotVec3(negDir,vec);math.normalizeVec3(negDir);math.mulVec3Scalar(negDir,dist,pos2);var quaternion=math.vec3PairToQuaternion(_zeroVec2,_this147._sectionPlane.dir,_quat2);pos3[0]=pos2[0]*0.1;pos3[1]=pos2[1]*0.1;pos3[2]=pos2[2]*0.1;_this147._mesh.quaternion=quaternion;_this147._mesh.position=pos3;};this._onSectionPlanePos=this._sectionPlane.on("pos",update);this._onSectionPlaneDir=this._sectionPlane.on("dir",update);// update();
|
|
26605
26605
|
}this._highlighted=false;this._selected=false;}/**
|
|
26606
26606
|
* Sets if this SectionPlanesOverviewPlane is highlighted.
|
|
26607
26607
|
*
|
|
@@ -26634,7 +26634,7 @@ return;}waitForTick=true;touchEndY=e.touches[0].clientY;if(lastTouchY!==null){de
|
|
|
26634
26634
|
* @private
|
|
26635
26635
|
*/var Overview=/*#__PURE__*/function(){/**
|
|
26636
26636
|
* @private
|
|
26637
|
-
*/function Overview(plugin,cfg){var
|
|
26637
|
+
*/function Overview(plugin,cfg){var _this148=this;_classCallCheck(this,Overview);if(!cfg.onHoverEnterPlane||!cfg.onHoverLeavePlane||!cfg.onClickedNothing||!cfg.onClickedPlane){throw"Missing config(s): onHoverEnterPlane, onHoverLeavePlane, onClickedNothing || onClickedPlane";}/**
|
|
26638
26638
|
* The {@link FaceAlignedSectionPlanesPlugin} that owns this SectionPlanesOverview.
|
|
26639
26639
|
*
|
|
26640
26640
|
* @type {FaceAlignedSectionPlanesPlugin}
|
|
@@ -26647,12 +26647,12 @@ this._canvas=cfg.overviewCanvas;//----------------------------------------------
|
|
|
26647
26647
|
this._scene=new Scene(this._viewer,{canvasId:this._canvas.id,transparent:true});this._scene.clearLights();new DirLight(this._scene,{dir:[0.4,-0.4,0.8],color:[0.8,1.0,1.0],intensity:1.0,space:"view"});new DirLight(this._scene,{dir:[-0.8,-0.3,-0.4],color:[0.8,0.8,0.8],intensity:1.0,space:"view"});new DirLight(this._scene,{dir:[0.8,-0.6,-0.8],color:[1.0,1.0,1.0],intensity:1.0,space:"view"});this._scene.camera;this._scene.camera.perspective.fov=70;this._zUp=false;//--------------------------------------------------------------------------------------------------------------
|
|
26648
26648
|
// Synchronize overview scene camera with viewer camera
|
|
26649
26649
|
//--------------------------------------------------------------------------------------------------------------
|
|
26650
|
-
{var camera=this._scene.camera;var _matrix3=math.rotationMat4c(-90*math.DEGTORAD,1,0,0);var _eyeLookVec4=math.vec3();var eyeLookVecOverview=math.vec3();var upOverview=math.vec3();this._synchCamera=function(){var eye=
|
|
26650
|
+
{var camera=this._scene.camera;var _matrix3=math.rotationMat4c(-90*math.DEGTORAD,1,0,0);var _eyeLookVec4=math.vec3();var eyeLookVecOverview=math.vec3();var upOverview=math.vec3();this._synchCamera=function(){var eye=_this148._viewer.camera.eye;var look=_this148._viewer.camera.look;var up=_this148._viewer.camera.up;math.mulVec3Scalar(math.normalizeVec3(math.subVec3(eye,look,_eyeLookVec4)),7);if(_this148._zUp){// +Z up
|
|
26651
26651
|
math.transformVec3(_matrix3,_eyeLookVec4,eyeLookVecOverview);math.transformVec3(_matrix3,up,upOverview);camera.look=[0,0,0];camera.eye=math.transformVec3(_matrix3,_eyeLookVec4,eyeLookVecOverview);camera.up=math.transformPoint3(_matrix3,up,upOverview);}else{// +Y up
|
|
26652
|
-
camera.look=[0,0,0];camera.eye=_eyeLookVec4;camera.up=up;}};}this._onViewerCameraMatrix=this._viewer.camera.on("matrix",this._synchCamera);this._onViewerCameraWorldAxis=this._viewer.camera.on("worldAxis",this._synchCamera);this._onViewerCameraFOV=this._viewer.camera.perspective.on("fov",function(fov){
|
|
26652
|
+
camera.look=[0,0,0];camera.eye=_eyeLookVec4;camera.up=up;}};}this._onViewerCameraMatrix=this._viewer.camera.on("matrix",this._synchCamera);this._onViewerCameraWorldAxis=this._viewer.camera.on("worldAxis",this._synchCamera);this._onViewerCameraFOV=this._viewer.camera.perspective.on("fov",function(fov){_this148._scene.camera.perspective.fov=fov;});//--------------------------------------------------------------------------------------------------------------
|
|
26653
26653
|
// Bind overview canvas events
|
|
26654
26654
|
//--------------------------------------------------------------------------------------------------------------
|
|
26655
|
-
{var hoveredEntity=null;this._onInputMouseMove=this._scene.input.on("mousemove",function(coords){var hit=
|
|
26655
|
+
{var hoveredEntity=null;this._onInputMouseMove=this._scene.input.on("mousemove",function(coords){var hit=_this148._scene.pick({canvasPos:coords});if(hit){if(!hoveredEntity||hit.entity.id!==hoveredEntity.id){if(hoveredEntity){var _plane2=_this148._planes[hoveredEntity.id];if(_plane2){_this148._onHoverLeavePlane(hoveredEntity.id);}}hoveredEntity=hit.entity;var plane=_this148._planes[hoveredEntity.id];if(plane){_this148._onHoverEnterPlane(hoveredEntity.id);}}}else{if(hoveredEntity){_this148._onHoverLeavePlane(hoveredEntity.id);hoveredEntity=null;}}});this._scene.canvas.canvas.addEventListener("mouseup",this._onCanvasMouseUp=function(){if(hoveredEntity){var plane=_this148._planes[hoveredEntity.id];if(plane){_this148._onClickedPlane(hoveredEntity.id);}}else{_this148._onClickedNothing();}});this._scene.canvas.canvas.addEventListener("mouseout",this._onCanvasMouseOut=function(){if(hoveredEntity){_this148._onHoverLeavePlane(hoveredEntity.id);hoveredEntity=null;}});}//--------------------------------------------------------------------------------------------------------------
|
|
26656
26656
|
// Configure overview
|
|
26657
26657
|
//--------------------------------------------------------------------------------------------------------------
|
|
26658
26658
|
this.setVisible(cfg.overviewVisible);}/** Called by SectionPlanesPlugin#createSectionPlane()
|
|
@@ -26765,10 +26765,10 @@ this.setVisible(cfg.overviewVisible);}/** Called by SectionPlanesPlugin#createSe
|
|
|
26765
26765
|
* @param {String} [cfg.overviewVisible=true] Initial visibility of the overview canvas.
|
|
26766
26766
|
* @param {String} cfg.controlElementId ID of an HTML element that catches drag events to move the active SectionPlane.
|
|
26767
26767
|
* @param {Number} [cfg.dragSensitivity=1] Sensitivity factor that governs the rate at which dragging on the control element moves SectionPlane.
|
|
26768
|
-
*/function FaceAlignedSectionPlanesPlugin(viewer){var
|
|
26768
|
+
*/function FaceAlignedSectionPlanesPlugin(viewer){var _this149;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,FaceAlignedSectionPlanesPlugin);_this149=_super163.call(this,"FaceAlignedSectionPlanesPlugin",viewer);_this149._freeControls=[];_this149._sectionPlanes=viewer.scene.sectionPlanes;_this149._controls={};_this149._shownControlId=null;_this149._dragSensitivity=cfg.dragSensitivity||1;if(cfg.overviewCanvasId!==null&&cfg.overviewCanvasId!==undefined){var overviewCanvas=document.getElementById(cfg.overviewCanvasId);if(!overviewCanvas){_this149.warn("Can't find overview canvas: '"+cfg.overviewCanvasId+"' - will create plugin without overview");}else{_this149._overview=new Overview(_assertThisInitialized(_this149),{overviewCanvas:overviewCanvas,visible:cfg.overviewVisible,onHoverEnterPlane:function onHoverEnterPlane(id){_this149._overview.setPlaneHighlighted(id,true);},onHoverLeavePlane:function onHoverLeavePlane(id){_this149._overview.setPlaneHighlighted(id,false);},onClickedPlane:function onClickedPlane(id){if(_this149.getShownControl()===id){_this149.hideControl();return;}_this149.showControl(id);var sectionPlane=_this149.sectionPlanes[id];var sectionPlanePos=sectionPlane.pos;tempAABB.set(_this149.viewer.scene.aabb);math.getAABB3Center(tempAABB,tempVec3);tempAABB[0]+=sectionPlanePos[0]-tempVec3[0];tempAABB[1]+=sectionPlanePos[1]-tempVec3[1];tempAABB[2]+=sectionPlanePos[2]-tempVec3[2];tempAABB[3]+=sectionPlanePos[0]-tempVec3[0];tempAABB[4]+=sectionPlanePos[1]-tempVec3[1];tempAABB[5]+=sectionPlanePos[2]-tempVec3[2];_this149.viewer.cameraFlight.flyTo({aabb:tempAABB,fitFOV:65});},onClickedNothing:function onClickedNothing(){_this149.hideControl();}});}}if(cfg.controlElementId===null||cfg.controlElementId===undefined){_this149.error("Parameter expected: controlElementId");}else{_this149._controlElement=document.getElementById(cfg.controlElementId);if(!_this149._controlElement){_this149.warn("Can't find control element: '"+cfg.controlElementId+"' - will create plugin without control element");}}_this149._onSceneSectionPlaneCreated=viewer.scene.on("sectionPlaneCreated",function(sectionPlane){// SectionPlane created, either via FaceAlignedSectionPlanesPlugin#createSectionPlane(), or by directly
|
|
26769
26769
|
// instantiating a SectionPlane independently of FaceAlignedSectionPlanesPlugin, which can be done
|
|
26770
26770
|
// by BCFViewpointsPlugin#loadViewpoint().
|
|
26771
|
-
|
|
26771
|
+
_this149._sectionPlaneCreated(sectionPlane);});return _this149;}/**
|
|
26772
26772
|
* Sets the factor that governs how fast a SectionPlane moves as we drag on the control element.
|
|
26773
26773
|
*
|
|
26774
26774
|
* @param {Number} dragSensitivity The dragging sensitivity factor.
|
|
@@ -26801,7 +26801,7 @@ _this148._sectionPlaneCreated(sectionPlane);});return _this148;}/**
|
|
|
26801
26801
|
* @returns {SectionPlane} The new {@link SectionPlane}.
|
|
26802
26802
|
*/},{key:"createSectionPlane",value:function createSectionPlane(){var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(params.id!==undefined&¶ms.id!==null&&this.viewer.scene.components[params.id]){this.error("Viewer component with this ID already exists: "+params.id);delete params.id;}// Note that SectionPlane constructor fires "sectionPlaneCreated" on the Scene,
|
|
26803
26803
|
// which FaceAlignedSectionPlanesPlugin handles and calls #_sectionPlaneCreated to create gizmo and add to overview canvas.
|
|
26804
|
-
var sectionPlane=new SectionPlane(this.viewer.scene,{id:params.id,pos:params.pos,dir:params.dir,active:true});return sectionPlane;}},{key:"_sectionPlaneCreated",value:function _sectionPlaneCreated(sectionPlane){var
|
|
26804
|
+
var sectionPlane=new SectionPlane(this.viewer.scene,{id:params.id,pos:params.pos,dir:params.dir,active:true});return sectionPlane;}},{key:"_sectionPlaneCreated",value:function _sectionPlaneCreated(sectionPlane){var _this150=this;var control=this._freeControls.length>0?this._freeControls.pop():new FaceAlignedSectionPlanesControl(this);control._setSectionPlane(sectionPlane);control.setVisible(false);this._controls[sectionPlane.id]=control;if(this._overview){this._overview.addSectionPlane(sectionPlane);}sectionPlane.once("destroyed",function(){_this150._sectionPlaneDestroyed(sectionPlane);});}/**
|
|
26805
26805
|
* Inverts the direction of {@link SectionPlane#dir} on every existing SectionPlane.
|
|
26806
26806
|
*
|
|
26807
26807
|
* Inverts all SectionPlanes, including those that were not created with FaceAlignedSectionPlanesPlugin.
|
|
@@ -26887,7 +26887,7 @@ for(var _id5 in this._controls){if(this._controls.hasOwnProperty(_id5)){this._co
|
|
|
26887
26887
|
* });
|
|
26888
26888
|
*
|
|
26889
26889
|
* @class SkyboxesPlugin
|
|
26890
|
-
*/var SkyboxesPlugin=/*#__PURE__*/function(_Plugin13){_inherits(SkyboxesPlugin,_Plugin13);var _super164=_createSuper(SkyboxesPlugin);function SkyboxesPlugin(viewer){var
|
|
26890
|
+
*/var SkyboxesPlugin=/*#__PURE__*/function(_Plugin13){_inherits(SkyboxesPlugin,_Plugin13);var _super164=_createSuper(SkyboxesPlugin);function SkyboxesPlugin(viewer){var _this151;_classCallCheck(this,SkyboxesPlugin);_this151=_super164.call(this,"skyboxes",viewer);_this151.skyboxes={};return _this151;}/**
|
|
26891
26891
|
* @private
|
|
26892
26892
|
*/_createClass(SkyboxesPlugin,[{key:"send",value:function send(name,value){switch(name){case"clear":this.clear();break;}}/**
|
|
26893
26893
|
Creates a skybox.
|
|
@@ -27111,9 +27111,9 @@ addMesh(modelNode,positions,normals,colors,material,options);}function addMesh(m
|
|
|
27111
27111
|
* @param {Object} [cfg] Plugin configuration.
|
|
27112
27112
|
* @param {String} [cfg.id="STLLoader"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
|
|
27113
27113
|
* @param {Object} [cfg.dataSource] A custom data source through which the STLLoaderPlugin can load STL files. Defaults to an instance of {@link STLDefaultDataSource}, which loads over HTTP.
|
|
27114
|
-
*/function STLLoaderPlugin(viewer){var
|
|
27114
|
+
*/function STLLoaderPlugin(viewer){var _this152;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,STLLoaderPlugin);_this152=_super165.call(this,"STLLoader",viewer,cfg);/**
|
|
27115
27115
|
* @private
|
|
27116
|
-
*/
|
|
27116
|
+
*/_this152._sceneGraphLoader=new STLSceneGraphLoader();_this152.dataSource=cfg.dataSource;return _this152;}/**
|
|
27117
27117
|
* Sets a custom data source through which the STLLoaderPlugin can load STL files.
|
|
27118
27118
|
*
|
|
27119
27119
|
* Default value is {@link STLDefaultDataSource}, which loads via an XMLHttpRequest.
|
|
@@ -27511,18 +27511,18 @@ addMesh(modelNode,positions,normals,colors,material,options);}function addMesh(m
|
|
|
27511
27511
|
* @param {Boolean} [cfg.pruneEmptyNodes=true] When true, will not contain nodes that don't have content in the {@link Scene}. These are nodes whose {@link MetaObject}s don't have {@link Entity}s.
|
|
27512
27512
|
* @param {RenderService} [cfg.renderService] Optional {@link RenderService} to use. Defaults to the {@link TreeViewPlugin}'s default {@link RenderService}.
|
|
27513
27513
|
* @param {Boolean} [cfg.showIndeterminate=false] When true, will show indeterminate state for checkboxes when some but not all child nodes are checked
|
|
27514
|
-
*/function TreeViewPlugin(viewer){var _cfg$showIndeterminat;var
|
|
27514
|
+
*/function TreeViewPlugin(viewer){var _cfg$showIndeterminat;var _this153;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,TreeViewPlugin);_this153=_super166.call(this,"TreeViewPlugin",viewer);/**
|
|
27515
27515
|
* Contains messages for any errors found while last rebuilding this TreeView.
|
|
27516
27516
|
* @type {String[]}
|
|
27517
|
-
*/
|
|
27517
|
+
*/_this153.errors=[];/**
|
|
27518
27518
|
* True if errors were found generating this TreeView.
|
|
27519
27519
|
* @type {boolean}
|
|
27520
|
-
*/
|
|
27521
|
-
|
|
27522
|
-
|
|
27523
|
-
|
|
27524
|
-
}var visible=entity.visible;var updated=visible!==node.checked;if(!updated){return;}
|
|
27525
|
-
}
|
|
27520
|
+
*/_this153.valid=true;var containerElement=cfg.containerElement||document.getElementById(cfg.containerElementId);if(!(containerElement instanceof HTMLElement)){_this153.error("Mandatory config expected: valid containerElementId or containerElement");return _possibleConstructorReturn(_this153);}for(var _i537=0;;_i537++){if(!treeViews[_i537]){treeViews[_i537]=_assertThisInitialized(_this153);_this153._index=_i537;_this153._id="tree-".concat(_i537);break;}}_this153._containerElement=containerElement;_this153._metaModels={};_this153._autoAddModels=cfg.autoAddModels!==false;_this153._autoExpandDepth=cfg.autoExpandDepth||0;_this153._sortNodes=cfg.sortNodes!==false;_this153._viewer=viewer;_this153._rootElement=null;_this153._muteSceneEvents=false;_this153._muteTreeEvents=false;_this153._rootNodes=[];_this153._objectNodes={};// Object ID -> Node
|
|
27521
|
+
_this153._nodeNodes={};// Node ID -> Node
|
|
27522
|
+
_this153._rootNames={};// Node ID -> Root name
|
|
27523
|
+
_this153._sortNodes=cfg.sortNodes;_this153._pruneEmptyNodes=cfg.pruneEmptyNodes;_this153._showListItemElementId=null;_this153._renderService=cfg.renderService||new RenderService();_this153._showIndeterminate=(_cfg$showIndeterminat=cfg.showIndeterminate)!==null&&_cfg$showIndeterminat!==void 0?_cfg$showIndeterminat:false;if(!_this153._renderService){throw new Error('TreeViewPlugin: no render service set');}_this153._containerElement.oncontextmenu=function(e){e.preventDefault();};_this153._onObjectVisibility=_this153._viewer.scene.on("objectVisibility",function(entity){if(_this153._muteSceneEvents){return;}var objectId=entity.id;var node=_this153._objectNodes[objectId];if(!node){return;// Not in this tree
|
|
27524
|
+
}var visible=entity.visible;var updated=visible!==node.checked;if(!updated){return;}_this153._muteTreeEvents=true;node.checked=visible;if(visible){node.numVisibleEntities++;}else{node.numVisibleEntities--;}_this153._renderService.setCheckbox(node.nodeId,visible);var parent=node.parent;while(parent){parent.checked=visible;if(visible){parent.numVisibleEntities++;}else{parent.numVisibleEntities--;}var indeterminate=_this153._showIndeterminate&&parent.numVisibleEntities>0&&parent.numVisibleEntities<parent.numEntities;_this153._renderService.setCheckbox(parent.nodeId,parent.numVisibleEntities>0,indeterminate);parent=parent.parent;}_this153._muteTreeEvents=false;});_this153._onObjectXrayed=_this153._viewer.scene.on('objectXRayed',function(entity){if(_this153._muteSceneEvents){return;}var objectId=entity.id;var node=_this153._objectNodes[objectId];if(!node){return;// Not in this tree
|
|
27525
|
+
}_this153._muteTreeEvents=true;var xrayed=entity.xrayed;var updated=xrayed!==node.xrayed;if(!updated){return;}node.xrayed=xrayed;_this153._renderService.setXRayed(node.nodeId,xrayed);_this153._muteTreeEvents=false;});_this153._switchExpandHandler=function(event){event.preventDefault();event.stopPropagation();var switchElement=event.target;_this153._expandSwitchElement(switchElement);};_this153._switchCollapseHandler=function(event){event.preventDefault();event.stopPropagation();var switchElement=event.target;_this153._collapseSwitchElement(switchElement);};_this153._checkboxChangeHandler=function(event){if(_this153._muteTreeEvents){return;}_this153._muteSceneEvents=true;var checkbox=event.target;var visible=_this153._renderService.isChecked(checkbox);var nodeId=_this153._renderService.getIdFromCheckbox(checkbox);var checkedNode=_this153._nodeNodes[nodeId];var objects=_this153._viewer.scene.objects;var numUpdated=0;_this153._withNodeTree(checkedNode,function(node){var objectId=node.objectId;var entity=objects[objectId];var isLeaf=node.children.length===0;node.numVisibleEntities=visible?node.numEntities:0;if(isLeaf&&visible!==node.checked){numUpdated++;}node.checked=visible;_this153._renderService.setCheckbox(node.nodeId,visible);if(entity){entity.visible=visible;}});var parent=checkedNode.parent;while(parent){parent.checked=visible;if(visible){parent.numVisibleEntities+=numUpdated;}else{parent.numVisibleEntities-=numUpdated;}var indeterminate=_this153._showIndeterminate&&parent.numVisibleEntities>0&&parent.numVisibleEntities<parent.numEntities;_this153._renderService.setCheckbox(parent.nodeId,parent.numVisibleEntities>0,indeterminate);parent=parent.parent;}_this153._muteSceneEvents=false;};_this153._hierarchy=cfg.hierarchy||"containment";_this153._autoExpandDepth=cfg.autoExpandDepth||0;if(_this153._autoAddModels){var modelIds=Object.keys(_this153.viewer.metaScene.metaModels);for(var _i538=0,len=modelIds.length;_i538<len;_i538++){var modelId=modelIds[_i538];var metaModel=_this153.viewer.metaScene.metaModels[modelId];if(metaModel.finalized){_this153.addModel(modelId);}}_this153.viewer.scene.on("modelLoaded",function(modelId){if(_this153.viewer.metaScene.metaModels[modelId]){_this153.addModel(modelId);}});}_this153.hierarchy=cfg.hierarchy;return _this153;}/**
|
|
27526
27526
|
* Sets how the nodes are organized within this tree view.
|
|
27527
27527
|
*
|
|
27528
27528
|
* Accepted values are:
|
|
@@ -27554,7 +27554,7 @@ _this152._sortNodes=cfg.sortNodes;_this152._pruneEmptyNodes=cfg.pruneEmptyNodes;
|
|
|
27554
27554
|
* @param {String} [options.rootName] Optional display name for the root node. Ordinary, for "containment"
|
|
27555
27555
|
* and "storeys" hierarchy types, the tree would derive the root node name from the model's "IfcProject" element
|
|
27556
27556
|
* name. This option allows to override that name when it is not suitable as a display name.
|
|
27557
|
-
*/,set:function set(hierarchy){hierarchy=hierarchy||"containment";if(hierarchy!=="containment"&&hierarchy!=="storeys"&&hierarchy!=="types"){this.error("Unsupported value for `hierarchy' - defaulting to 'containment'");hierarchy="containment";}if(this._hierarchy===hierarchy){return;}this._hierarchy=hierarchy;this._createNodes();}},{key:"addModel",value:function addModel(modelId){var
|
|
27557
|
+
*/,set:function set(hierarchy){hierarchy=hierarchy||"containment";if(hierarchy!=="containment"&&hierarchy!=="storeys"&&hierarchy!=="types"){this.error("Unsupported value for `hierarchy' - defaulting to 'containment'");hierarchy="containment";}if(this._hierarchy===hierarchy){return;}this._hierarchy=hierarchy;this._createNodes();}},{key:"addModel",value:function addModel(modelId){var _this154=this;var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!this._containerElement){return;}var model=this.viewer.scene.models[modelId];if(!model){throw"Model not found: "+modelId;}var metaModel=this.viewer.metaScene.metaModels[modelId];if(!metaModel){this.error("MetaModel not found: "+modelId);return;}if(this._metaModels[modelId]){this.warn("Model already added: "+modelId);return;}this._metaModels[modelId]=metaModel;if(options&&options.rootName){this._rootNames[modelId]=options.rootName;}model.on("destroyed",function(){_this154.removeModel(model.id);});this._createNodes();}/**
|
|
27558
27558
|
* Removes a model from this tree view.
|
|
27559
27559
|
*
|
|
27560
27560
|
* Does nothing if model not currently in tree view.
|
|
@@ -27588,7 +27588,7 @@ _this152._sortNodes=cfg.sortNodes;_this152._pruneEmptyNodes=cfg.pruneEmptyNodes;
|
|
|
27588
27588
|
* Collapses the tree first.
|
|
27589
27589
|
*
|
|
27590
27590
|
* @param {Number} depth Depth to expand to.
|
|
27591
|
-
*/},{key:"expandToDepth",value:function expandToDepth(depth){var
|
|
27591
|
+
*/},{key:"expandToDepth",value:function expandToDepth(depth){var _this155=this;this.collapse();var expand=function expand(node,countDepth){if(countDepth===depth){return;}var switchElement=_this155._renderService.getSwitchElement(node.nodeId);if(switchElement){_this155._expandSwitchElement(switchElement);var childNodes=node.children;for(var i=0,len=childNodes.length;i<len;i++){var childNode=childNodes[i];expand(childNode,countDepth+1);}}};for(var _i540=0,len=this._rootNodes.length;_i540<len;_i540++){var rootNode=this._rootNodes[_i540];expand(rootNode,0);}}/**
|
|
27592
27592
|
* Closes all the nodes in the tree.
|
|
27593
27593
|
*/},{key:"collapse",value:function collapse(){for(var _i541=0,len=this._rootNodes.length;_i541<len;_i541++){var rootNode=this._rootNodes[_i541];var nodeId=rootNode.nodeId;this._collapseNode(nodeId);}}/**
|
|
27594
27594
|
* Iterates over a subtree of the tree view's {@link TreeViewNode}s, calling the given callback for each
|
|
@@ -27625,11 +27625,9 @@ _this152._sortNodes=cfg.sortNodes;_this152._pruneEmptyNodes=cfg.pruneEmptyNodes;
|
|
|
27625
27625
|
// // errors.push("Can't build storeys hierarchy: no IfcBuildingStoreys found");
|
|
27626
27626
|
// }
|
|
27627
27627
|
// }
|
|
27628
|
-
return true;}},{key:"_createEnabledNodes",value:function _createEnabledNodes(){if(this._pruneEmptyNodes){this._findEmptyNodes();}switch(this._hierarchy){case"storeys":this._createStoreysNodes();if(this._rootNodes.length===0){this.error("Failed to build storeys hierarchy");}break;case"types":this._createTypesNodes();break;case"containment":default:this._createContainmentNodes();}if(this._sortNodes){this._doSortNodes();}this._synchNodesToEntities();this._createTrees();this.expandToDepth(this._autoExpandDepth);}},{key:"_createDisabledNodes",value:function _createDisabledNodes(){var rootNode=this._renderService.createRootNode();this._rootElement=rootNode;this._containerElement.appendChild(rootNode);var rootMetaObjects=this._viewer.metaScene.rootMetaObjects;for(var objectId in rootMetaObjects){var rootMetaObject=rootMetaObjects[objectId];var metaObjectType=rootMetaObject.type;var metaObjectName=rootMetaObject.name;var rootName=metaObjectName&&metaObjectName!==""&&metaObjectName!=="Undefined"&&metaObjectName!=="Default"?metaObjectName:metaObjectType;var childNode=this._renderService.createDisabledNodeElement(rootName);rootNode.appendChild(childNode);}}},{key:"_findEmptyNodes",value:function _findEmptyNodes(){var rootMetaObjects=this._viewer.metaScene.rootMetaObjects;for(var objectId in rootMetaObjects){this._findEmptyNodes2(rootMetaObjects[objectId]);}}},{key:"_findEmptyNodes2",value:function _findEmptyNodes2(metaObject){var countEntities=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var viewer=this.viewer;var scene=viewer.scene;var children=metaObject.children;var objectId=metaObject.id;var entity=scene.objects[objectId];metaObject._countEntities=0;if(entity){metaObject._countEntities++;}if(children){for(var _i543=0,len=children.length;_i543<len;_i543++){var childMetaObject=children[_i543];childMetaObject._countEntities=this._findEmptyNodes2(childMetaObject);metaObject._countEntities+=childMetaObject._countEntities;}}return metaObject._countEntities;}},{key:"_createStoreysNodes",value:function _createStoreysNodes(){var rootMetaObjects=this._viewer.metaScene.rootMetaObjects;for(var id in rootMetaObjects){this._createStoreysNodes2(rootMetaObjects[id],null,null,null);}}},{key:"_createStoreysNodes2",value:function _createStoreysNodes2(metaObject,buildingNode,storeyNode,typeNodes){if(this._pruneEmptyNodes&&metaObject._countEntities===0){return;}var metaObjectType=metaObject.type;var metaObjectName=metaObject.name;var children=metaObject.children;var objectId=metaObject.id;if(metaObjectType==="IfcBuilding"){buildingNode={nodeId:"".concat(this._id,"-").concat(objectId),objectId:objectId,title:metaObject.metaModels.length===0?metaObjectName:this._rootNames[metaObject.metaModels[0].id]||(metaObjectName&&metaObjectName!==""&&metaObjectName!=="Undefined"&&metaObjectName!=="Default"?metaObjectName:metaObjectType),type:metaObjectType,parent:null,numEntities:0,numVisibleEntities:0,checked:false,xrayed:false,children:[]};this._rootNodes.push(buildingNode);this._objectNodes[buildingNode.objectId]=buildingNode;this._nodeNodes[buildingNode.nodeId]=buildingNode;}else if(metaObjectType==="IfcBuildingStorey"){if(!buildingNode){this.error("Failed to build storeys hierarchy for model - model does not have an IfcBuilding object, or is not an IFC model");return;}storeyNode={nodeId:"".concat(this._id,"-").concat(objectId),objectId:objectId,title:metaObjectName&&metaObjectName!==""&&metaObjectName!=="Undefined"&&metaObjectName!=="Default"?metaObjectName:metaObjectType,type:metaObjectType,parent:buildingNode,numEntities:0,numVisibleEntities:0,checked:false,xrayed:false,children:[]};buildingNode.children.push(storeyNode);this._objectNodes[storeyNode.objectId]=storeyNode;this._nodeNodes[storeyNode.nodeId]=storeyNode;typeNodes={};}else{if(storeyNode){var objects=this._viewer.scene.objects;var object=objects[objectId];if(object){typeNodes=typeNodes||{};var typeNode=typeNodes[metaObjectType];if(!typeNode){typeNode={nodeId:"".concat(this._id,"-").concat(storeyNode.objectId,"-").concat(metaObjectType),objectId:"".concat(storeyNode.objectId,"-").concat(metaObjectType),title:metaObjectType,type:metaObjectType,parent:storeyNode,numEntities:0,numVisibleEntities:0,checked:false,xrayed:false,children:[]};storeyNode.children.push(typeNode);this._objectNodes[typeNode.objectId]=typeNode;this._nodeNodes[typeNode.nodeId]=typeNode;typeNodes[metaObjectType]=typeNode;}var _node6={nodeId:"".concat(this._id,"-").concat(objectId),objectId:objectId,title:metaObjectName&&metaObjectName!==""&&metaObjectName!=="Undefined"&&metaObjectName!=="Default"?metaObjectName:metaObjectType,type:metaObjectType,parent:typeNode,numEntities:0,numVisibleEntities:0,checked:false,xrayed:false,children:[]};typeNode.children.push(_node6);this._objectNodes[_node6.objectId]=_node6;this._nodeNodes[_node6.nodeId]=_node6;}}}if(children){for(var _i544=0,len=children.length;_i544<len;_i544++){var childMetaObject=children[_i544];this._createStoreysNodes2(childMetaObject,buildingNode,storeyNode,typeNodes);}}}},{key:"_createTypesNodes",value:function _createTypesNodes(){var rootMetaObjects=this._viewer.metaScene.rootMetaObjects;for(var id in rootMetaObjects){this._createTypesNodes2(rootMetaObjects[id],null,null);}}},{key:"_createTypesNodes2",value:function _createTypesNodes2(metaObject,rootNode,typeNodes){if(this._pruneEmptyNodes&&metaObject._countEntities===0){return;}var metaObjectType=metaObject.type;var metaObjectName=metaObject.name;var children=metaObject.children;var objectId=metaObject.id;if(!metaObject.parent){rootNode={nodeId:"".concat(this._id,"-").concat(objectId),objectId:objectId,title:metaObject.metaModels.length===0?metaObjectName:this._rootNames[metaObject.metaModels[0].id]||(metaObjectName&&metaObjectName!==""&&metaObjectName!=="Undefined"&&metaObjectName!=="Default"?metaObjectName:metaObjectType),type:metaObjectType,parent:null,numEntities:0,numVisibleEntities:0,checked:false,xrayed:false,children:[]};this._rootNodes.push(rootNode);this._objectNodes[rootNode.objectId]=rootNode;this._nodeNodes[rootNode.nodeId]=rootNode;typeNodes={};}else{if(rootNode){var objects=this._viewer.scene.objects;var object=objects[objectId];if(object){var typeNode=typeNodes[metaObjectType];if(!typeNode){typeNode={nodeId:"".concat(this._id,"-").concat(rootNode.objectId,"-").concat(metaObjectType),objectId:"".concat(rootNode.objectId,"-").concat(metaObjectType),title:metaObjectType,type:metaObjectType,parent:rootNode,numEntities:0,numVisibleEntities:0,checked:false,xrayed:false,children:[]};rootNode.children.push(typeNode);this._objectNodes[typeNode.objectId]=typeNode;this._nodeNodes[typeNode.nodeId]=typeNode;typeNodes[metaObjectType]=typeNode;}var _node7={nodeId:"".concat(this._id,"-").concat(objectId),objectId:objectId,title:metaObjectName&&metaObjectName!==""&&metaObjectName!=="Default"?metaObjectName:metaObjectType,type:metaObjectType,parent:typeNode,numEntities:0,numVisibleEntities:0,checked:false,xrayed:false,children:[]};typeNode.children.push(_node7);this._objectNodes[_node7.objectId]=_node7;this._nodeNodes[_node7.nodeId]=_node7;}}}if(children){for(var _i545=0,len=children.length;_i545<len;_i545++){var childMetaObject=children[_i545];this._createTypesNodes2(childMetaObject,rootNode,typeNodes);}}}},{key:"_createContainmentNodes",value:function _createContainmentNodes(){var rootMetaObjects=this._viewer.metaScene.rootMetaObjects;for(var id in rootMetaObjects){this._createContainmentNodes2(rootMetaObjects[id],null);}}},{key:"_createContainmentNodes2",value:function _createContainmentNodes2(metaObject,parent){if(this._pruneEmptyNodes&&metaObject._countEntities===0){return;}var metaObjectType=metaObject.type;var metaObjectName=metaObject.name||metaObjectType;var children=metaObject.children;var objectId=metaObject.id;var node={nodeId:"".concat(this._id,"-").concat(objectId),objectId:objectId,title:!parent?metaObject.metaModels.length===0?metaObjectName:this._rootNames[metaObject.metaModels[0].id]||metaObjectName:metaObjectName&&metaObjectName!==""&&metaObjectName!=="Undefined"&&metaObjectName!=="Default"?metaObjectName:metaObjectType,type:metaObjectType,parent:parent,numEntities:0,numVisibleEntities:0,checked:false,xrayed:false,children:[]};if(parent){parent.children.push(node);}else{this._rootNodes.push(node);}this._objectNodes[node.objectId]=node;this._nodeNodes[node.nodeId]=node;if(children){for(var _i546=0,len=children.length;_i546<len;_i546++){var childMetaObject=children[_i546];this._createContainmentNodes2(childMetaObject,node);}}}},{key:"_doSortNodes",value:function _doSortNodes(){for(var _i547=0,len=this._rootNodes.length;_i547<len;_i547++){var rootNode=this._rootNodes[_i547];this._sortChildren(rootNode);}}},{key:"_sortChildren",value:function _sortChildren(node){var children=node.children;if(!children||children.length===0){return;}var firstChild=children[0];if(this._hierarchy==="storeys"&&firstChild.type==="IfcBuildingStorey"){children.sort(this._getSpatialSortFunc());}else{children.sort(this._alphaSortFunc);}for(var _i548=0,len=children.length;_i548<len;_i548++){var _node8=children[_i548];this._sortChildren(_node8);}}},{key:"_getSpatialSortFunc",value:function _getSpatialSortFunc(){// Creates cached sort func with Viewer in scope
|
|
27629
|
-
var viewer=this.viewer;var scene=viewer.scene;var camera=scene.camera;var metaScene=viewer.metaScene;return this._spatialSortFunc||(this._spatialSortFunc=function(node1,node2){if(!node1.aabb||!node2.aabb){// Sorting on lowest point of the AABB is likely more more robust when objects could overlap storeys
|
|
27630
|
-
if(!node1.aabb){node1.aabb=scene.getAABB(metaScene.getObjectIDsInSubtree(node1.objectId));}if(!node2.aabb){node2.aabb=scene.getAABB(metaScene.getObjectIDsInSubtree(node2.objectId));}}var idx=0;if(camera.xUp){idx=0;}else if(camera.yUp){idx=1;}else{idx=2;}if(node1.aabb[idx]>node2.aabb[idx]){return-1;}if(node1.aabb[idx]<node2.aabb[idx]){return 1;}return 0;});}},{key:"_alphaSortFunc",value:function _alphaSortFunc(node1,node2){var title1=node1.title.toUpperCase();// FIXME: Should be case sensitive?
|
|
27628
|
+
return true;}},{key:"_createEnabledNodes",value:function _createEnabledNodes(){if(this._pruneEmptyNodes){this._findEmptyNodes();}switch(this._hierarchy){case"storeys":this._createStoreysNodes();if(this._rootNodes.length===0){this.error("Failed to build storeys hierarchy");}break;case"types":this._createTypesNodes();break;case"containment":default:this._createContainmentNodes();}if(this._sortNodes){this._doSortNodes();}this._synchNodesToEntities();this._createTrees();this.expandToDepth(this._autoExpandDepth);}},{key:"_createDisabledNodes",value:function _createDisabledNodes(){var rootNode=this._renderService.createRootNode();this._rootElement=rootNode;this._containerElement.appendChild(rootNode);var rootMetaObjects=this._viewer.metaScene.rootMetaObjects;for(var objectId in rootMetaObjects){var rootMetaObject=rootMetaObjects[objectId];var metaObjectType=rootMetaObject.type;var metaObjectName=rootMetaObject.name;var rootName=metaObjectName&&metaObjectName!==""&&metaObjectName!=="Undefined"&&metaObjectName!=="Default"?metaObjectName:metaObjectType;var childNode=this._renderService.createDisabledNodeElement(rootName);rootNode.appendChild(childNode);}}},{key:"_findEmptyNodes",value:function _findEmptyNodes(){var rootMetaObjects=this._viewer.metaScene.rootMetaObjects;for(var objectId in rootMetaObjects){this._findEmptyNodes2(rootMetaObjects[objectId]);}}},{key:"_findEmptyNodes2",value:function _findEmptyNodes2(metaObject){var countEntities=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var viewer=this.viewer;var scene=viewer.scene;var children=metaObject.children;var objectId=metaObject.id;var entity=scene.objects[objectId];metaObject._countEntities=0;if(entity){metaObject._countEntities++;}if(children){for(var _i543=0,len=children.length;_i543<len;_i543++){var childMetaObject=children[_i543];childMetaObject._countEntities=this._findEmptyNodes2(childMetaObject);metaObject._countEntities+=childMetaObject._countEntities;}}return metaObject._countEntities;}},{key:"_createStoreysNodes",value:function _createStoreysNodes(){var rootMetaObjects=this._viewer.metaScene.rootMetaObjects;for(var id in rootMetaObjects){this._createStoreysNodes2(rootMetaObjects[id],null,null,null);}}},{key:"_createStoreysNodes2",value:function _createStoreysNodes2(metaObject,buildingNode,storeyNode,typeNodes){if(this._pruneEmptyNodes&&metaObject._countEntities===0){return;}var metaObjectType=metaObject.type;var metaObjectName=metaObject.name;var children=metaObject.children;var objectId=metaObject.id;if(metaObjectType==="IfcBuilding"){buildingNode={nodeId:"".concat(this._id,"-").concat(objectId),objectId:objectId,title:metaObject.metaModels.length===0?metaObjectName:this._rootNames[metaObject.metaModels[0].id]||(metaObjectName&&metaObjectName!==""&&metaObjectName!=="Undefined"&&metaObjectName!=="Default"?metaObjectName:metaObjectType),type:metaObjectType,parent:null,numEntities:0,numVisibleEntities:0,checked:false,xrayed:false,children:[]};this._rootNodes.push(buildingNode);this._objectNodes[buildingNode.objectId]=buildingNode;this._nodeNodes[buildingNode.nodeId]=buildingNode;}else if(metaObjectType==="IfcBuildingStorey"){if(!buildingNode){this.error("Failed to build storeys hierarchy for model - model does not have an IfcBuilding object, or is not an IFC model");return;}storeyNode={nodeId:"".concat(this._id,"-").concat(objectId),objectId:objectId,title:metaObjectName&&metaObjectName!==""&&metaObjectName!=="Undefined"&&metaObjectName!=="Default"?metaObjectName:metaObjectType,type:metaObjectType,parent:buildingNode,numEntities:0,numVisibleEntities:0,checked:false,xrayed:false,children:[]};buildingNode.children.push(storeyNode);this._objectNodes[storeyNode.objectId]=storeyNode;this._nodeNodes[storeyNode.nodeId]=storeyNode;typeNodes={};}else{if(storeyNode){var objects=this._viewer.scene.objects;var object=objects[objectId];if(object){typeNodes=typeNodes||{};var typeNode=typeNodes[metaObjectType];if(!typeNode){typeNode={nodeId:"".concat(this._id,"-").concat(storeyNode.objectId,"-").concat(metaObjectType),objectId:"".concat(storeyNode.objectId,"-").concat(metaObjectType),title:metaObjectType,type:metaObjectType,parent:storeyNode,numEntities:0,numVisibleEntities:0,checked:false,xrayed:false,children:[]};storeyNode.children.push(typeNode);this._objectNodes[typeNode.objectId]=typeNode;this._nodeNodes[typeNode.nodeId]=typeNode;typeNodes[metaObjectType]=typeNode;}var _node6={nodeId:"".concat(this._id,"-").concat(objectId),objectId:objectId,title:metaObjectName&&metaObjectName!==""&&metaObjectName!=="Undefined"&&metaObjectName!=="Default"?metaObjectName:metaObjectType,type:metaObjectType,parent:typeNode,numEntities:0,numVisibleEntities:0,checked:false,xrayed:false,children:[]};typeNode.children.push(_node6);this._objectNodes[_node6.objectId]=_node6;this._nodeNodes[_node6.nodeId]=_node6;}}}if(children){for(var _i544=0,len=children.length;_i544<len;_i544++){var childMetaObject=children[_i544];this._createStoreysNodes2(childMetaObject,buildingNode,storeyNode,typeNodes);}}}},{key:"_createTypesNodes",value:function _createTypesNodes(){var rootMetaObjects=this._viewer.metaScene.rootMetaObjects;for(var id in rootMetaObjects){this._createTypesNodes2(rootMetaObjects[id],null,null);}}},{key:"_createTypesNodes2",value:function _createTypesNodes2(metaObject,rootNode,typeNodes){if(this._pruneEmptyNodes&&metaObject._countEntities===0){return;}var metaObjectType=metaObject.type;var metaObjectName=metaObject.name;var children=metaObject.children;var objectId=metaObject.id;if(!metaObject.parent){rootNode={nodeId:"".concat(this._id,"-").concat(objectId),objectId:objectId,title:metaObject.metaModels.length===0?metaObjectName:this._rootNames[metaObject.metaModels[0].id]||(metaObjectName&&metaObjectName!==""&&metaObjectName!=="Undefined"&&metaObjectName!=="Default"?metaObjectName:metaObjectType),type:metaObjectType,parent:null,numEntities:0,numVisibleEntities:0,checked:false,xrayed:false,children:[]};this._rootNodes.push(rootNode);this._objectNodes[rootNode.objectId]=rootNode;this._nodeNodes[rootNode.nodeId]=rootNode;typeNodes={};}else{if(rootNode){var objects=this._viewer.scene.objects;var object=objects[objectId];if(object){var typeNode=typeNodes[metaObjectType];if(!typeNode){typeNode={nodeId:"".concat(this._id,"-").concat(rootNode.objectId,"-").concat(metaObjectType),objectId:"".concat(rootNode.objectId,"-").concat(metaObjectType),title:metaObjectType,type:metaObjectType,parent:rootNode,numEntities:0,numVisibleEntities:0,checked:false,xrayed:false,children:[]};rootNode.children.push(typeNode);this._objectNodes[typeNode.objectId]=typeNode;this._nodeNodes[typeNode.nodeId]=typeNode;typeNodes[metaObjectType]=typeNode;}var _node7={nodeId:"".concat(this._id,"-").concat(objectId),objectId:objectId,title:metaObjectName&&metaObjectName!==""&&metaObjectName!=="Default"?metaObjectName:metaObjectType,type:metaObjectType,parent:typeNode,numEntities:0,numVisibleEntities:0,checked:false,xrayed:false,children:[]};typeNode.children.push(_node7);this._objectNodes[_node7.objectId]=_node7;this._nodeNodes[_node7.nodeId]=_node7;}}}if(children){for(var _i545=0,len=children.length;_i545<len;_i545++){var childMetaObject=children[_i545];this._createTypesNodes2(childMetaObject,rootNode,typeNodes);}}}},{key:"_createContainmentNodes",value:function _createContainmentNodes(){var rootMetaObjects=this._viewer.metaScene.rootMetaObjects;for(var id in rootMetaObjects){this._createContainmentNodes2(rootMetaObjects[id],null);}}},{key:"_createContainmentNodes2",value:function _createContainmentNodes2(metaObject,parent){if(this._pruneEmptyNodes&&metaObject._countEntities===0){return;}var metaObjectType=metaObject.type;var metaObjectName=metaObject.name||metaObjectType;var children=metaObject.children;var objectId=metaObject.id;var node={nodeId:"".concat(this._id,"-").concat(objectId),objectId:objectId,title:!parent?metaObject.metaModels.length===0?metaObjectName:this._rootNames[metaObject.metaModels[0].id]||metaObjectName:metaObjectName&&metaObjectName!==""&&metaObjectName!=="Undefined"&&metaObjectName!=="Default"?metaObjectName:metaObjectType,type:metaObjectType,parent:parent,numEntities:0,numVisibleEntities:0,checked:false,xrayed:false,children:[]};if(parent){parent.children.push(node);}else{this._rootNodes.push(node);}this._objectNodes[node.objectId]=node;this._nodeNodes[node.nodeId]=node;if(children){for(var _i546=0,len=children.length;_i546<len;_i546++){var childMetaObject=children[_i546];this._createContainmentNodes2(childMetaObject,node);}}}},{key:"_doSortNodes",value:function _doSortNodes(){for(var _i547=0,len=this._rootNodes.length;_i547<len;_i547++){var rootNode=this._rootNodes[_i547];this._sortChildren(rootNode);}}},{key:"_sortChildren",value:function _sortChildren(node){var children=node.children;if(!children||children.length===0){return;}var firstChild=children[0];if((this._hierarchy==="storeys"||this._hierarchy==="containment")&&firstChild.type==="IfcBuildingStorey"){children.sort(this._getSpatialSortFunc());}else{children.sort(this._alphaSortFunc);}for(var _i548=0,len=children.length;_i548<len;_i548++){var _node8=children[_i548];this._sortChildren(_node8);}}},{key:"_getSpatialSortFunc",value:function _getSpatialSortFunc(){var _this156=this;var viewer=this.viewer;var scene=viewer.scene;var camera=scene.camera;return this._spatialSortFunc||(this._spatialSortFunc=function(storey1,storey2){if(camera.xUp);else if(camera.yUp);else;var metaScene=_this156.viewer.metaScene;var storey1MetaObject=metaScene.metaObjects[storey1.objectId];var storey2MetaObject=metaScene.metaObjects[storey2.objectId];if(storey1MetaObject&&storey1MetaObject.attributes&&storey1MetaObject.attributes.elevation!==undefined&&storey2MetaObject&&storey2MetaObject.attributes&&storey2MetaObject.attributes.elevation!==undefined){var elevation1=storey1MetaObject.attributes.elevation;var elevation2=storey2MetaObject.attributes.elevation;if(elevation1>elevation2){return-1;}if(elevation1<elevation2){return 1;}return 0;}else{return 0;}});}},{key:"_alphaSortFunc",value:function _alphaSortFunc(node1,node2){var title1=node1.title.toUpperCase();// FIXME: Should be case sensitive?
|
|
27631
27629
|
var title2=node2.title.toUpperCase();if(title1<title2){return-1;}if(title1>title2){return 1;}return 0;}},{key:"_synchNodesToEntities",value:function _synchNodesToEntities(){var objectIds=Object.keys(this.viewer.metaScene.metaObjects);var metaObjects=this._viewer.metaScene.metaObjects;var objects=this._viewer.scene.objects;for(var _i549=0,len=objectIds.length;_i549<len;_i549++){var objectId=objectIds[_i549];var metaObject=metaObjects[objectId];if(metaObject){var _node9=this._objectNodes[objectId];if(_node9){var entity=objects[objectId];if(entity){var visible=entity.visible;_node9.numEntities=1;_node9.xrayed=entity.xrayed;if(visible){_node9.numVisibleEntities=1;_node9.checked=true;}else{_node9.numVisibleEntities=0;_node9.checked=false;}var parent=_node9.parent;// Synch parents
|
|
27632
|
-
while(parent){parent.numEntities++;if(visible){parent.numVisibleEntities++;parent.checked=true;}parent=parent.parent;}}}}}}},{key:"_withNodeTree",value:function _withNodeTree(node,callback){callback(node);var children=node.children;if(!children){return;}for(var _i550=0,len=children.length;_i550<len;_i550++){this._withNodeTree(children[_i550],callback);}}},{key:"_createTrees",value:function _createTrees(){var
|
|
27630
|
+
while(parent){parent.numEntities++;if(visible){parent.numVisibleEntities++;parent.checked=true;}parent=parent.parent;}}}}}}},{key:"_withNodeTree",value:function _withNodeTree(node,callback){callback(node);var children=node.children;if(!children){return;}for(var _i550=0,len=children.length;_i550<len;_i550++){this._withNodeTree(children[_i550],callback);}}},{key:"_createTrees",value:function _createTrees(){var _this157=this;if(this._rootNodes.length===0){return;}var rootNodeElements=this._rootNodes.map(function(rootNode){return _this157._createNodeElement(rootNode);});var rootNode=this._renderService.createRootNode();rootNodeElements.forEach(function(nodeElement){rootNode.appendChild(nodeElement);});this._containerElement.appendChild(rootNode);this._rootElement=rootNode;}},{key:"_createNodeElement",value:function _createNodeElement(node){var _this158=this;var contextmenuHandler=function contextmenuHandler(event){_this158.fire("contextmenu",{event:event,viewer:_this158._viewer,treeViewPlugin:_this158,treeViewNode:node});event.preventDefault();};var onclickHandler=function onclickHandler(event){_this158.fire("nodeTitleClicked",{event:event,viewer:_this158._viewer,treeViewPlugin:_this158,treeViewNode:node});event.preventDefault();};return this._renderService.createNodeElement(node,this._switchExpandHandler,this._checkboxChangeHandler,contextmenuHandler,onclickHandler);}},{key:"_expandSwitchElement",value:function _expandSwitchElement(switchElement){var _this159=this;var expanded=this._renderService.isExpanded(switchElement);if(expanded){return;}var nodeId=this._renderService.getId(switchElement);var nodeElements=this._nodeNodes[nodeId].children.map(function(node){return _this159._createNodeElement(node);});this._renderService.addChildren(switchElement,nodeElements);this._renderService.expand(switchElement,this._switchExpandHandler,this._switchCollapseHandler);}},{key:"_collapseNode",value:function _collapseNode(nodeId){var switchElement=this._renderService.getSwitchElement(nodeId);this._collapseSwitchElement(switchElement);}},{key:"_collapseSwitchElement",value:function _collapseSwitchElement(switchElement){this._renderService.collapse(switchElement,this._switchExpandHandler,this._switchCollapseHandler);}}]);return TreeViewPlugin;}(Plugin);/**
|
|
27633
27631
|
* For each Entity in its Scene, efficiently combines updates from multiple culling systems into a single "culled" state.
|
|
27634
27632
|
*
|
|
27635
27633
|
* Two culling systems are supported:
|
|
@@ -27641,12 +27639,12 @@ while(parent){parent.numEntities++;if(visible){parent.numVisibleEntities++;paren
|
|
|
27641
27639
|
*/var ObjectCullStates=/*#__PURE__*/function(){/**
|
|
27642
27640
|
* @private
|
|
27643
27641
|
* @param scene
|
|
27644
|
-
*/function ObjectCullStates(scene){var
|
|
27642
|
+
*/function ObjectCullStates(scene){var _this160=this;_classCallCheck(this,ObjectCullStates);this._scene=scene;this._objects=[];// Array of all Entity instances that represent objects
|
|
27645
27643
|
this._objectsViewCulled=[];// A flag for each object to indicate its view-cull status
|
|
27646
27644
|
this._objectsDetailCulled=[];// A flag for each object to indicate its detail-cull status
|
|
27647
27645
|
this._objectsChanged=[];// A flag for each object, set whenever its cull status has changed since last _applyChanges()
|
|
27648
27646
|
this._objectsChangedList=[];// A list of objects whose cull status has changed, applied and cleared by _applyChanges()
|
|
27649
|
-
this._modelInfos={};this._numObjects=0;this._lenObjectsChangedList=0;this._dirty=true;this._onModelLoaded=scene.on("modelLoaded",function(modelId){var model=scene.models[modelId];if(model){
|
|
27647
|
+
this._modelInfos={};this._numObjects=0;this._lenObjectsChangedList=0;this._dirty=true;this._onModelLoaded=scene.on("modelLoaded",function(modelId){var model=scene.models[modelId];if(model){_this160._addModel(model);}});this._onTick=scene.on("tick",function(){if(_this160._dirty){_this160._build();}_this160._applyChanges();});}_createClass(ObjectCullStates,[{key:"_addModel",value:function _addModel(model){var _this161=this;var modelInfo={model:model,onDestroyed:model.on("destroyed",function(){_this161._removeModel(model);})};this._modelInfos[model.id]=modelInfo;this._dirty=true;}},{key:"_removeModel",value:function _removeModel(model){var modelInfo=this._modelInfos[model.id];if(modelInfo){modelInfo.model.off(modelInfo.onDestroyed);delete this._modelInfos[model.id];this._dirty=true;}}},{key:"_build",value:function _build(){if(!this._dirty){return;}this._applyChanges();var objects=this._scene.objects;for(var _i551=0;_i551<this._numObjects;_i551++){this._objects[_i551]=null;}this._numObjects=0;for(var objectId in objects){var entity=objects[objectId];this._objects[this._numObjects++]=entity;}this._lenObjectsChangedList=0;this._dirty=false;}},{key:"_applyChanges",value:function _applyChanges(){if(this._lenObjectsChangedList>0){for(var _i552=0;_i552<this._lenObjectsChangedList;_i552++){var objectIdx=this._objectsChangedList[_i552];var object=this._objects[objectIdx];var viewCulled=this._objectsViewCulled[objectIdx];var detailCulled=this._objectsDetailCulled[objectIdx];var culled=viewCulled||detailCulled;object.culled=culled;this._objectsChanged[objectIdx]=false;}this._lenObjectsChangedList=0;}}/**
|
|
27650
27648
|
* Array of {@link Entity} instances that represent objects in the {@link Scene}.
|
|
27651
27649
|
*
|
|
27652
27650
|
* ObjectCullStates rebuilds this from {@link Scene#objects} whenever ````Scene```` fires a ````modelLoaded```` event.
|
|
@@ -27713,8 +27711,8 @@ var kdTreeDimLength=new Float32Array(3);/**
|
|
|
27713
27711
|
* @param {Object} cfg Plugin configuration.
|
|
27714
27712
|
* @param {String} [cfg.id="ViewCull"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
|
|
27715
27713
|
* @param {Number} [cfg.maxTreeDepth=8] Maximum depth of the kd-tree.
|
|
27716
|
-
*/function ViewCullPlugin(viewer){var
|
|
27717
|
-
|
|
27714
|
+
*/function ViewCullPlugin(viewer){var _this162;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,ViewCullPlugin);_this162=_super167.call(this,"ViewCull",viewer);_this162._objectCullStates=getObjectCullStates(viewer.scene);// Combines updates from multiple culling systems for its Scene's Entities
|
|
27715
|
+
_this162._maxTreeDepth=cfg.maxTreeDepth||MAX_KD_TREE_DEPTH;_this162._modelInfos={};_this162._frustum=new Frustum$1();_this162._kdRoot=null;_this162._frustumDirty=false;_this162._kdTreeDirty=false;_this162._onViewMatrix=viewer.scene.camera.on("viewMatrix",function(){_this162._frustumDirty=true;});_this162._onProjMatrix=viewer.scene.camera.on("projMatMatrix",function(){_this162._frustumDirty=true;});_this162._onModelLoaded=viewer.scene.on("modelLoaded",function(modelId){var model=_this162.viewer.scene.models[modelId];if(model){_this162._addModel(model);}});_this162._onSceneTick=viewer.scene.on("tick",function(){_this162._doCull();});return _this162;}/**
|
|
27718
27716
|
* Sets whether view culling is enabled.
|
|
27719
27717
|
*
|
|
27720
27718
|
* @param {Boolean} enabled Whether to enable view culling.
|
|
@@ -27722,7 +27720,7 @@ _this160._maxTreeDepth=cfg.maxTreeDepth||MAX_KD_TREE_DEPTH;_this160._modelInfos=
|
|
|
27722
27720
|
* Gets whether view culling is enabled.
|
|
27723
27721
|
*
|
|
27724
27722
|
* @retutns {Boolean} Whether view culling is enabled.
|
|
27725
|
-
*/function get(){return this._enabled;},set:function set(enabled){this._enabled=enabled;}},{key:"_addModel",value:function _addModel(model){var
|
|
27723
|
+
*/function get(){return this._enabled;},set:function set(enabled){this._enabled=enabled;}},{key:"_addModel",value:function _addModel(model){var _this163=this;var modelInfo={model:model,onDestroyed:model.on("destroyed",function(){_this163._removeModel(model);})};this._modelInfos[model.id]=modelInfo;this._kdTreeDirty=true;}},{key:"_removeModel",value:function _removeModel(model){var modelInfo=this._modelInfos[model.id];if(modelInfo){modelInfo.model.off(modelInfo.onDestroyed);delete this._modelInfos[model.id];this._kdTreeDirty=true;}}},{key:"_doCull",value:function _doCull(){var cullDirty=this._frustumDirty||this._kdTreeDirty;if(this._frustumDirty){this._buildFrustum();}if(this._kdTreeDirty){this._buildKDTree();}if(cullDirty){var kdNode=this._kdRoot;if(kdNode){this._visitKDNode(kdNode);}}}},{key:"_buildFrustum",value:function _buildFrustum(){var camera=this.viewer.scene.camera;setFrustum(this._frustum,camera.viewMatrix,camera.projMatrix);this._frustumDirty=false;}},{key:"_buildKDTree",value:function _buildKDTree(){var viewer=this.viewer;var scene=viewer.scene;var depth=0;if(this._kdRoot);this._kdRoot={aabb:scene.getAABB(),intersection:Frustum$1.INTERSECT};for(var objectIdx=0,len=this._objectCullStates.numObjects;objectIdx<len;objectIdx++){var entity=this._objectCullStates.objects[objectIdx];this._insertEntityIntoKDTree(this._kdRoot,entity,objectIdx,depth+1);}this._kdTreeDirty=false;}},{key:"_insertEntityIntoKDTree",value:function _insertEntityIntoKDTree(kdNode,entity,objectIdx,depth){var entityAABB=entity.aabb;if(depth>=this._maxTreeDepth){kdNode.objects=kdNode.objects||[];kdNode.objects.push(objectIdx);math.expandAABB3(kdNode.aabb,entityAABB);return;}if(kdNode.left){if(math.containsAABB3(kdNode.left.aabb,entityAABB)){this._insertEntityIntoKDTree(kdNode.left,entity,objectIdx,depth+1);return;}}if(kdNode.right){if(math.containsAABB3(kdNode.right.aabb,entityAABB)){this._insertEntityIntoKDTree(kdNode.right,entity,objectIdx,depth+1);return;}}var nodeAABB=kdNode.aabb;kdTreeDimLength[0]=nodeAABB[3]-nodeAABB[0];kdTreeDimLength[1]=nodeAABB[4]-nodeAABB[1];kdTreeDimLength[2]=nodeAABB[5]-nodeAABB[2];var dim=0;if(kdTreeDimLength[1]>kdTreeDimLength[dim]){dim=1;}if(kdTreeDimLength[2]>kdTreeDimLength[dim]){dim=2;}if(!kdNode.left){var aabbLeft=nodeAABB.slice();aabbLeft[dim+3]=(nodeAABB[dim]+nodeAABB[dim+3])/2.0;kdNode.left={aabb:aabbLeft,intersection:Frustum$1.INTERSECT};if(math.containsAABB3(aabbLeft,entityAABB)){this._insertEntityIntoKDTree(kdNode.left,entity,objectIdx,depth+1);return;}}if(!kdNode.right){var aabbRight=nodeAABB.slice();aabbRight[dim]=(nodeAABB[dim]+nodeAABB[dim+3])/2.0;kdNode.right={aabb:aabbRight,intersection:Frustum$1.INTERSECT};if(math.containsAABB3(aabbRight,entityAABB)){this._insertEntityIntoKDTree(kdNode.right,entity,objectIdx,depth+1);return;}}kdNode.objects=kdNode.objects||[];kdNode.objects.push(objectIdx);math.expandAABB3(kdNode.aabb,entityAABB);}},{key:"_visitKDNode",value:function _visitKDNode(kdNode){var intersects=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Frustum$1.INTERSECT;if(intersects!==Frustum$1.INTERSECT&&kdNode.intersects===intersects){return;}if(intersects===Frustum$1.INTERSECT){intersects=frustumIntersectsAABB3(this._frustum,kdNode.aabb);kdNode.intersects=intersects;}var culled=intersects===Frustum$1.OUTSIDE;var objects=kdNode.objects;if(objects&&objects.length>0){for(var _i553=0,len=objects.length;_i553<len;_i553++){var objectIdx=objects[_i553];this._objectCullStates.setObjectViewCulled(objectIdx,culled);}}if(kdNode.left){this._visitKDNode(kdNode.left,intersects);}if(kdNode.right){this._visitKDNode(kdNode.right,intersects);}}/**
|
|
27726
27724
|
* @private
|
|
27727
27725
|
*/},{key:"send",value:function send(name,value){}/**
|
|
27728
27726
|
* Destroys this ViewCullPlugin.
|
|
@@ -28509,7 +28507,7 @@ var ParserV11={version:11,parseArrayBuffer:function parseArrayBuffer(viewer,opti
|
|
|
28509
28507
|
* and faster rendering speed. It's recommended to keep this somewhere roughly between ````50000```` and ````50000000```.
|
|
28510
28508
|
* @param {KTX2TextureTranscoder} [cfg.textureTranscoder] Transcoder used internally to transcode KTX2
|
|
28511
28509
|
* textures within the XKT. Only required when the XKT is version 10 or later, and contains KTX2 textures.
|
|
28512
|
-
*/function XKTLoaderPlugin(viewer){var
|
|
28510
|
+
*/function XKTLoaderPlugin(viewer){var _this164;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,XKTLoaderPlugin);_this164=_super168.call(this,"XKTLoader",viewer,cfg);_this164._maxGeometryBatchSize=cfg.maxGeometryBatchSize;_this164.textureTranscoder=cfg.textureTranscoder;_this164.dataSource=cfg.dataSource;_this164.objectDefaults=cfg.objectDefaults;_this164.includeTypes=cfg.includeTypes;_this164.excludeTypes=cfg.excludeTypes;_this164.excludeUnclassifiedObjects=cfg.excludeUnclassifiedObjects;_this164.reuseGeometries=cfg.reuseGeometries;return _this164;}/**
|
|
28513
28511
|
* Gets the ````.xkt```` format versions supported by this XKTLoaderPlugin/
|
|
28514
28512
|
* @returns {string[]}
|
|
28515
28513
|
*/_createClass(XKTLoaderPlugin,[{key:"supportedVersions",get:function get(){return Object.keys(parsers);}/**
|
|
@@ -28689,13 +28687,13 @@ var ParserV11={version:11,parseArrayBuffer:function parseArrayBuffer(viewer,opti
|
|
|
28689
28687
|
* SceneModels are drawn when they have transparent objects, to give control over the order in which those objects are blended within the transparent
|
|
28690
28688
|
* render pass.
|
|
28691
28689
|
* @returns {Entity} Entity representing the model, which will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#models}.
|
|
28692
|
-
*/},{key:"load",value:function load(){var
|
|
28690
|
+
*/},{key:"load",value:function load(){var _this165=this;var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(params.id&&this.viewer.scene.components[params.id]){this.error("Component with this ID already exists in viewer: "+params.id+" - will autogenerate this ID");delete params.id;}if(!params.src&&!params.xkt&&!params.manifestSrc&&!params.manifest)throw new Error("XKTLoaderPlugin: load() param expected: src, xkt, manifestSrc or manifestData");var options={};var includeTypes=params.includeTypes||this._includeTypes;var excludeTypes=params.excludeTypes||this._excludeTypes;var objectDefaults=params.objectDefaults||this._objectDefaults;options.reuseGeometries=params.reuseGeometries!==null&¶ms.reuseGeometries!==undefined?params.reuseGeometries:this._reuseGeometries!==false;if(includeTypes){options.includeTypesMap={};for(var _i579=0,len=includeTypes.length;_i579<len;_i579++){options.includeTypesMap[includeTypes[_i579]]=true;}}if(excludeTypes){options.excludeTypesMap={};for(var _i580=0,_len119=excludeTypes.length;_i580<_len119;_i580++){options.excludeTypesMap[excludeTypes[_i580]]=true;}}if(objectDefaults){options.objectDefaults=objectDefaults;}options.excludeUnclassifiedObjects=params.excludeUnclassifiedObjects!==undefined?!!params.excludeUnclassifiedObjects:this._excludeUnclassifiedObjects;options.globalizeObjectIds=params.globalizeObjectIds!==undefined&¶ms.globalizeObjectIds!==null?!!params.globalizeObjectIds:this._globalizeObjectIds;var sceneModel=new SceneModel(this.viewer.scene,utils.apply(params,{isModel:true,textureTranscoder:this._textureTranscoder,maxGeometryBatchSize:this._maxGeometryBatchSize,origin:params.origin,disableVertexWelding:params.disableVertexWelding||false,disableIndexRebucketing:params.disableIndexRebucketing||false,dtxEnabled:params.dtxEnabled,renderOrder:params.renderOrder}));var modelId=sceneModel.id;// In case ID was auto-generated
|
|
28693
28691
|
var metaModel=new MetaModel({metaScene:this.viewer.metaScene,id:modelId});this.viewer.scene.canvas.spinner.processes++;var finish=function finish(){if(sceneModel.destroyed){return;}// this._createDefaultMetaModelIfNeeded(sceneModel, params, options);
|
|
28694
|
-
sceneModel.finalize();metaModel.finalize();
|
|
28692
|
+
sceneModel.finalize();metaModel.finalize();_this165.viewer.scene.canvas.spinner.processes--;sceneModel.once("destroyed",function(){_this165.viewer.metaScene.destroyMetaModel(metaModel.id);});_this165.scheduleTask(function(){if(sceneModel.destroyed){return;}sceneModel.scene.fire("modelLoaded",sceneModel.id);// FIXME: Assumes listeners know order of these two events
|
|
28695
28693
|
sceneModel.fire("loaded",true,false);// Don't forget the event, for late subscribers
|
|
28696
|
-
});};var error=function error(errMsg){
|
|
28697
|
-
var i=0;var loadNext=function loadNext(){if(sceneModel.destroyed){done();}else if(i>=xktFiles.length){done();}else{
|
|
28698
|
-
var i=0;var loadNext=function loadNext(){if(sceneModel.destroyed){done();}else if(i>=xktFiles.length){done();}else{
|
|
28694
|
+
});};var error=function error(errMsg){_this165.viewer.scene.canvas.spinner.processes--;_this165.error(errMsg);sceneModel.fire("error",errMsg);};var nextId=0;var manifestCtx={getNextId:function getNextId(){return"".concat(modelId,".").concat(nextId++);}};if(params.metaModelSrc||params.metaModelData){if(params.metaModelSrc){var metaModelSrc=params.metaModelSrc;this._dataSource.getMetaModel(metaModelSrc,function(metaModelData){if(sceneModel.destroyed){return;}metaModel.loadData(metaModelData,{includeTypes:includeTypes,excludeTypes:excludeTypes,globalizeObjectIds:options.globalizeObjectIds});if(params.src){_this165._loadModel(params.src,options,sceneModel,null,manifestCtx,finish,error);}else{_this165._parseModel(params.xkt,options,sceneModel,null,manifestCtx);finish();}},function(errMsg){error("load(): Failed to load model metadata for model '".concat(modelId," from '").concat(metaModelSrc,"' - ").concat(errMsg));});}else if(params.metaModelData){metaModel.loadData(params.metaModelData,{includeTypes:includeTypes,excludeTypes:excludeTypes,globalizeObjectIds:options.globalizeObjectIds});if(params.src){this._loadModel(params.src,options,sceneModel,null,manifestCtx,finish,error);}else{this._parseModel(params.xkt,options,sceneModel,null,manifestCtx);finish();}}}else{if(params.src){this._loadModel(params.src,options,sceneModel,metaModel,manifestCtx,finish,error);}else if(params.xkt){this._parseModel(params.xkt,options,sceneModel,metaModel,manifestCtx);finish();}else if(params.manifestSrc||params.manifest){var baseDir=params.manifestSrc?getBaseDirectory(params.manifestSrc):"";var loadJSONs=function loadJSONs(metaDataFiles,done,error){var i=0;var loadNext=function loadNext(){if(sceneModel.destroyed){done();}else if(i>=metaDataFiles.length){done();}else{_this165._dataSource.getMetaModel("".concat(baseDir).concat(metaDataFiles[i]),function(metaModelData){metaModel.loadData(metaModelData,{includeTypes:includeTypes,excludeTypes:excludeTypes,globalizeObjectIds:options.globalizeObjectIds});i++;_this165.scheduleTask(loadNext,200);},error);}};loadNext();};var loadXKTs_excludeTheirMetaModels=function loadXKTs_excludeTheirMetaModels(xktFiles,done,error){// Load XKTs, ignore metamodels in the XKT
|
|
28695
|
+
var i=0;var loadNext=function loadNext(){if(sceneModel.destroyed){done();}else if(i>=xktFiles.length){done();}else{_this165._dataSource.getXKT("".concat(baseDir).concat(xktFiles[i]),function(arrayBuffer){_this165._parseModel(arrayBuffer,options,sceneModel,null/* Ignore metamodel in XKT */,manifestCtx);sceneModel.preFinalize();i++;_this165.scheduleTask(loadNext,200);},error);}};loadNext();};var loadXKTs_includeTheirMetaModels=function loadXKTs_includeTheirMetaModels(xktFiles,done,error){// Load XKTs, parse metamodels from the XKT
|
|
28696
|
+
var i=0;var loadNext=function loadNext(){if(sceneModel.destroyed){done();}else if(i>=xktFiles.length){done();}else{_this165._dataSource.getXKT("".concat(baseDir).concat(xktFiles[i]),function(arrayBuffer){_this165._parseModel(arrayBuffer,options,sceneModel,metaModel,manifestCtx);sceneModel.preFinalize();i++;_this165.scheduleTask(loadNext,200);},error);}};loadNext();};if(params.manifest){var manifestData=params.manifest;var xktFiles=manifestData.xktFiles;if(!xktFiles||xktFiles.length===0){error("load(): Failed to load model manifest - manifest not valid");return;}var metaModelFiles=manifestData.metaModelFiles;if(metaModelFiles){loadJSONs(metaModelFiles,function(){loadXKTs_excludeTheirMetaModels(xktFiles,finish,error);},error);}else{loadXKTs_includeTheirMetaModels(xktFiles,finish,error);}}else{this._dataSource.getManifest(params.manifestSrc,function(manifestData){if(sceneModel.destroyed){return;}var xktFiles=manifestData.xktFiles;if(!xktFiles||xktFiles.length===0){error("load(): Failed to load model manifest - manifest not valid");return;}var metaModelFiles=manifestData.metaModelFiles;if(metaModelFiles){loadJSONs(metaModelFiles,function(){loadXKTs_excludeTheirMetaModels(xktFiles,finish,error);},error);}else{loadXKTs_includeTheirMetaModels(xktFiles,finish,error);}},error);}}}return sceneModel;}},{key:"_loadModel",value:function _loadModel(src,options,sceneModel,metaModel,manifestCtx,done,error){var _this166=this;this._dataSource.getXKT(src,function(arrayBuffer){_this166._parseModel(arrayBuffer,options,sceneModel,metaModel,manifestCtx);sceneModel.preFinalize();done();},error);}},{key:"_parseModel",value:function(){var _parseModel2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(arrayBuffer,options,sceneModel,metaModel,manifestCtx){var dataView,dataArray,xktVersion,parser,numElements,elements,byteOffset,_i581,elementSize;return _regeneratorRuntime().wrap(function _callee7$(_context11){while(1){switch(_context11.prev=_context11.next){case 0:if(!sceneModel.destroyed){_context11.next=2;break;}return _context11.abrupt("return");case 2:dataView=new DataView(arrayBuffer);dataArray=new Uint8Array(arrayBuffer);xktVersion=dataView.getUint32(0,true);parser=parsers[xktVersion];if(parser){_context11.next=9;break;}this.error("Unsupported .XKT file version: "+xktVersion+" - this XKTLoaderPlugin supports versions "+Object.keys(parsers));return _context11.abrupt("return");case 9:if(!parser.parseArrayBuffer){_context11.next=12;break;}parser.parseArrayBuffer(this.viewer,options,arrayBuffer,sceneModel,metaModel,manifestCtx);return _context11.abrupt("return");case 12:numElements=dataView.getUint32(4,true);elements=[];byteOffset=(numElements+2)*4;for(_i581=0;_i581<numElements;_i581++){elementSize=dataView.getUint32((_i581+2)*4,true);elements.push(dataArray.subarray(byteOffset,byteOffset+elementSize));byteOffset+=elementSize;}parser.parse(this.viewer,options,elements,sceneModel,metaModel,manifestCtx);case 17:case"end":return _context11.stop();}}},_callee7,this);}));function _parseModel(_x100,_x101,_x102,_x103,_x104){return _parseModel2.apply(this,arguments);}return _parseModel;}()}]);return XKTLoaderPlugin;}(Plugin);function getBaseDirectory(filePath){var pathArray=filePath.split('/');pathArray.pop();// Remove the file name or the last segment of the path
|
|
28699
28697
|
return pathArray.join('/')+'/';}/*
|
|
28700
28698
|
Copyright (c) 2013 Gildas Lormeau. All rights reserved.
|
|
28701
28699
|
|
|
@@ -29036,13 +29034,13 @@ var json=xmlToJSON(xmlDoc,{});ok(xmlDoc,json);});};function xmlToJSON(node,attri
|
|
|
29036
29034
|
* contains the script that is used by zip.js to instantiate Web workers, which assist with unzipping the 3DXML, which is a ZIP archive.
|
|
29037
29035
|
* @param {String} [cfg.materialType="PhongMaterial"] What type of materials to create while loading: "MetallicMaterial" to create {@link MetallicMaterial}s, "SpecularMaterial" to create {@link SpecularMaterial}s or "PhongMaterial" to create {@link PhongMaterial}s. As it loads XML3D's Phong materials, the XMLLoaderPlugin will do its best approximate conversion of those to the specified workflow.
|
|
29038
29036
|
* @param {Boolean} [cfg.createMetaModel=false] When true, will create a {@link MetaModel} for the model in {@link MetaScene#metaModels}.
|
|
29039
|
-
*/function XML3DLoaderPlugin(viewer){var
|
|
29037
|
+
*/function XML3DLoaderPlugin(viewer){var _this167;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,XML3DLoaderPlugin);_this167=_super169.call(this,"XML3DLoader",viewer,cfg);if(!cfg.workerScriptsPath){_this167.error("Config expected: workerScriptsPath");return _possibleConstructorReturn(_this167);}_this167._workerScriptsPath=cfg.workerScriptsPath;/**
|
|
29040
29038
|
* @private
|
|
29041
|
-
*/
|
|
29039
|
+
*/_this167._loader=new XML3DSceneGraphLoader(_assertThisInitialized(_this167),cfg);/**
|
|
29042
29040
|
* Supported 3DXML schema versions
|
|
29043
29041
|
* @property supportedSchemas
|
|
29044
29042
|
* @type {string[]}
|
|
29045
|
-
*/
|
|
29043
|
+
*/_this167.supportedSchemas=_this167._loader.supportedSchemas;return _this167;}/**
|
|
29046
29044
|
* Loads a 3DXML model from a file into this XML3DLoaderPlugin's {@link Viewer}.
|
|
29047
29045
|
*
|
|
29048
29046
|
* Creates a tree of {@link Entity}s within the Viewer's {@link Scene} that represents the model.
|
|
@@ -29430,7 +29428,7 @@ var isBase64=!!dataUriRegexResult[2];var data=dataUriRegexResult[3];data=window.
|
|
|
29430
29428
|
* @param {String[]} [cfg.includeTypes] When loading metadata, only loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
|
|
29431
29429
|
* @param {String[]} [cfg.excludeTypes] When loading metadata, never loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
|
|
29432
29430
|
* @param {Boolean} [cfg.excludeUnclassifiedObjects=false] When loading metadata and this is ````true````, will only load {@link Entity}s that have {@link MetaObject}s (that are not excluded). This is useful when we don't want Entitys in the Scene that are not represented within IFC navigation components, such as {@link TreeViewPlugin}.
|
|
29433
|
-
*/function WebIFCLoaderPlugin(viewer){var
|
|
29431
|
+
*/function WebIFCLoaderPlugin(viewer){var _this168;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,WebIFCLoaderPlugin);_this168=_super170.call(this,"ifcLoader",viewer,cfg);_this168.dataSource=cfg.dataSource;_this168.objectDefaults=cfg.objectDefaults;_this168.includeTypes=cfg.includeTypes;_this168.excludeTypes=cfg.excludeTypes;_this168.excludeUnclassifiedObjects=cfg.excludeUnclassifiedObjects;if(!cfg.WebIFC){throw"Parameter expected: WebIFC";}if(!cfg.IfcAPI){throw"Parameter expected: IfcAPI";}_this168._webIFC=cfg.WebIFC;_this168._ifcAPI=cfg.IfcAPI;return _this168;}/**
|
|
29434
29432
|
* Gets the ````IFC```` format versions supported by this WebIFCLoaderPlugin.
|
|
29435
29433
|
* @returns {string[]}
|
|
29436
29434
|
*/_createClass(WebIFCLoaderPlugin,[{key:"supportedVersions",get:function get(){return["2x3","4"];}/**
|
|
@@ -29563,10 +29561,10 @@ var isBase64=!!dataUriRegexResult[2];var data=dataUriRegexResult[3];data=window.
|
|
|
29563
29561
|
* primitives. Only works while {@link DTX#enabled} is also ````true````.
|
|
29564
29562
|
* @returns {Entity} Entity representing the model, which will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#models}.
|
|
29565
29563
|
*/},{key:"load",value:function load(){var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(params.id&&this.viewer.scene.components[params.id]){this.error("Component with this ID already exists in viewer: "+params.id+" - will autogenerate this ID");delete params.id;}var sceneModel=new SceneModel(this.viewer.scene,utils.apply(params,{isModel:true}));if(!params.src&&!params.ifc){this.error("load() param expected: src or IFC");return sceneModel;// Return new empty model
|
|
29566
|
-
}var options={autoNormals:true};if(params.loadMetadata!==false){var includeTypes=params.includeTypes||this._includeTypes;var excludeTypes=params.excludeTypes||this._excludeTypes;var objectDefaults=params.objectDefaults||this._objectDefaults;if(includeTypes){options.includeTypesMap={};for(var _i582=0,len=includeTypes.length;_i582<len;_i582++){options.includeTypesMap[includeTypes[_i582]]=true;}}if(excludeTypes){options.excludeTypesMap={};for(var _i583=0,_len120=excludeTypes.length;_i583<_len120;_i583++){options.excludeTypesMap[excludeTypes[_i583]]=true;}}if(objectDefaults){options.objectDefaults=objectDefaults;}options.excludeUnclassifiedObjects=params.excludeUnclassifiedObjects!==undefined?!!params.excludeUnclassifiedObjects:this._excludeUnclassifiedObjects;options.globalizeObjectIds=params.globalizeObjectIds!==undefined?!!params.globalizeObjectIds:this._globalizeObjectIds;}try{if(params.src){this._loadModel(params.src,params,options,sceneModel);}else{this._parseModel(params.ifc,params,options,sceneModel);}}catch(e){this.error(e);sceneModel.fire("error",e);}return sceneModel;}},{key:"_loadModel",value:function _loadModel(src,params,options,sceneModel){var
|
|
29564
|
+
}var options={autoNormals:true};if(params.loadMetadata!==false){var includeTypes=params.includeTypes||this._includeTypes;var excludeTypes=params.excludeTypes||this._excludeTypes;var objectDefaults=params.objectDefaults||this._objectDefaults;if(includeTypes){options.includeTypesMap={};for(var _i582=0,len=includeTypes.length;_i582<len;_i582++){options.includeTypesMap[includeTypes[_i582]]=true;}}if(excludeTypes){options.excludeTypesMap={};for(var _i583=0,_len120=excludeTypes.length;_i583<_len120;_i583++){options.excludeTypesMap[excludeTypes[_i583]]=true;}}if(objectDefaults){options.objectDefaults=objectDefaults;}options.excludeUnclassifiedObjects=params.excludeUnclassifiedObjects!==undefined?!!params.excludeUnclassifiedObjects:this._excludeUnclassifiedObjects;options.globalizeObjectIds=params.globalizeObjectIds!==undefined?!!params.globalizeObjectIds:this._globalizeObjectIds;}try{if(params.src){this._loadModel(params.src,params,options,sceneModel);}else{this._parseModel(params.ifc,params,options,sceneModel);}}catch(e){this.error(e);sceneModel.fire("error",e);}return sceneModel;}},{key:"_loadModel",value:function _loadModel(src,params,options,sceneModel){var _this169=this;var spinner=this.viewer.scene.canvas.spinner;spinner.processes++;this._dataSource.getIFC(params.src,function(arrayBuffer){_this169._parseModel(arrayBuffer,params,options,sceneModel);spinner.processes--;},function(errMsg){spinner.processes--;_this169.error(errMsg);sceneModel.fire("error",errMsg);});}},{key:"_parseModel",value:function _parseModel(arrayBuffer,params,options,sceneModel){if(sceneModel.destroyed){return;}var stats=params.stats||{};stats.sourceFormat="IFC";stats.schemaVersion="";stats.title="";stats.author="";stats.created="";stats.numMetaObjects=0;stats.numPropertySets=0;stats.numObjects=0;stats.numGeometries=0;stats.numTriangles=0;stats.numVertices=0;if(!this._ifcAPI){throw"WebIFCLoaderPlugin has no WebIFC instance configured - please inject via WebIFCLoaderPlugin constructor";}var dataArray=new Uint8Array(arrayBuffer);var modelID=this._ifcAPI.OpenModel(dataArray);var modelSchema=this._ifcAPI.GetModelSchema(modelID);var lines=this._ifcAPI.GetLineIDsWithType(modelID,this._webIFC.IFCPROJECT);var ifcProjectId=lines.get(0);var loadMetadata=params.loadMetadata!==false;var metadata=loadMetadata?{id:"",projectId:""+ifcProjectId,author:"",createdAt:"",schema:"",creatingApplication:"",metaObjects:[],propertySets:[]}:null;var ctx={modelID:modelID,modelSchema:modelSchema,sceneModel:sceneModel,loadMetadata:loadMetadata,metadata:metadata,metaObjects:{},options:options,log:function log(msg){},nextId:0,stats:stats};if(loadMetadata){if(options.includeTypes){ctx.includeTypes={};for(var _i584=0,len=options.includeTypes.length;_i584<len;_i584++){ctx.includeTypes[options.includeTypes[_i584]]=true;}}if(options.excludeTypes){ctx.excludeTypes={};for(var _i585=0,_len121=options.excludeTypes.length;_i585<_len121;_i585++){ctx.excludeTypes[options.excludeTypes[_i585]]=true;}}this._parseMetaObjects(ctx);this._parsePropertySets(ctx);}this._parseGeometry(ctx);sceneModel.finalize();if(loadMetadata){var metaModelId=sceneModel.id;this.viewer.metaScene.createMetaModel(metaModelId,ctx.metadata,options);}sceneModel.scene.once("tick",function(){if(sceneModel.destroyed){return;}sceneModel.scene.fire("modelLoaded",sceneModel.id);// FIXME: Assumes listeners know order of these two events
|
|
29567
29565
|
sceneModel.fire("loaded",true,false);// Don't forget the event, for late subscribers
|
|
29568
|
-
});}},{key:"_parseMetaObjects",value:function _parseMetaObjects(ctx){var lines=this._ifcAPI.GetLineIDsWithType(ctx.modelID,this._webIFC.IFCPROJECT);var ifcProjectId=lines.get(0);var ifcProject=this._ifcAPI.GetLine(ctx.modelID,ifcProjectId);this._parseSpatialChildren(ctx,ifcProject);}},{key:"_parseSpatialChildren",value:function _parseSpatialChildren(ctx,ifcElement,parentMetaObjectId){var metaObjectType=this._ifcAPI.GetNameFromTypeCode(ifcElement.type);if(ctx.includeTypes&&!ctx.includeTypes[metaObjectType]){return;}if(ctx.excludeTypes&&ctx.excludeTypes[metaObjectType]){return;}this._createMetaObject(ctx,ifcElement,parentMetaObjectId);var metaObjectId=ifcElement.GlobalId.value;this._parseRelatedItemsOfType(ctx,ifcElement.expressID,'RelatingObject','RelatedObjects',this._webIFC.IFCRELAGGREGATES,metaObjectId);this._parseRelatedItemsOfType(ctx,ifcElement.expressID,'RelatingStructure','RelatedElements',this._webIFC.IFCRELCONTAINEDINSPATIALSTRUCTURE,metaObjectId);}},{key:"_createMetaObject",value:function _createMetaObject(ctx,ifcElement,parentMetaObjectId){var id=ifcElement.GlobalId.value;var metaObjectType=this._ifcAPI.GetNameFromTypeCode(ifcElement.type);var metaObjectName=ifcElement.Name&&ifcElement.Name.value!==""?ifcElement.Name.value:metaObjectType;var metaObject={id:id,name:metaObjectName,type:metaObjectType,parent:parentMetaObjectId};ctx.metadata.metaObjects.push(metaObject);ctx.metaObjects[id]=metaObject;ctx.stats.numMetaObjects++;}},{key:"_parseRelatedItemsOfType",value:function _parseRelatedItemsOfType(ctx,id,relation,related,type,parentMetaObjectId){var
|
|
29569
|
-
var flatMeshExpressID=flatMesh.expressID;var placedGeometries=flatMesh.geometries;var meshIds=[];var properties=
|
|
29566
|
+
});}},{key:"_parseMetaObjects",value:function _parseMetaObjects(ctx){var lines=this._ifcAPI.GetLineIDsWithType(ctx.modelID,this._webIFC.IFCPROJECT);var ifcProjectId=lines.get(0);var ifcProject=this._ifcAPI.GetLine(ctx.modelID,ifcProjectId);this._parseSpatialChildren(ctx,ifcProject);}},{key:"_parseSpatialChildren",value:function _parseSpatialChildren(ctx,ifcElement,parentMetaObjectId){var metaObjectType=this._ifcAPI.GetNameFromTypeCode(ifcElement.type);if(ctx.includeTypes&&!ctx.includeTypes[metaObjectType]){return;}if(ctx.excludeTypes&&ctx.excludeTypes[metaObjectType]){return;}this._createMetaObject(ctx,ifcElement,parentMetaObjectId);var metaObjectId=ifcElement.GlobalId.value;this._parseRelatedItemsOfType(ctx,ifcElement.expressID,'RelatingObject','RelatedObjects',this._webIFC.IFCRELAGGREGATES,metaObjectId);this._parseRelatedItemsOfType(ctx,ifcElement.expressID,'RelatingStructure','RelatedElements',this._webIFC.IFCRELCONTAINEDINSPATIALSTRUCTURE,metaObjectId);}},{key:"_createMetaObject",value:function _createMetaObject(ctx,ifcElement,parentMetaObjectId){var id=ifcElement.GlobalId.value;var metaObjectType=this._ifcAPI.GetNameFromTypeCode(ifcElement.type);var metaObjectName=ifcElement.Name&&ifcElement.Name.value!==""?ifcElement.Name.value:metaObjectType;var metaObject={id:id,name:metaObjectName,type:metaObjectType,parent:parentMetaObjectId};ctx.metadata.metaObjects.push(metaObject);ctx.metaObjects[id]=metaObject;ctx.stats.numMetaObjects++;}},{key:"_parseRelatedItemsOfType",value:function _parseRelatedItemsOfType(ctx,id,relation,related,type,parentMetaObjectId){var _this170=this;var lines=this._ifcAPI.GetLineIDsWithType(ctx.modelID,type);for(var _i586=0;_i586<lines.size();_i586++){var relID=lines.get(_i586);var rel=this._ifcAPI.GetLine(ctx.modelID,relID);var relatedItems=rel[relation];var foundElement=false;if(Array.isArray(relatedItems)){var values=relatedItems.map(function(item){return item.value;});foundElement=values.includes(id);}else{foundElement=relatedItems.value===id;}if(foundElement){var element=rel[related];if(!Array.isArray(element)){var ifcElement=this._ifcAPI.GetLine(ctx.modelID,element.value);this._parseSpatialChildren(ctx,ifcElement,parentMetaObjectId);}else{element.forEach(function(element2){var ifcElement=_this170._ifcAPI.GetLine(ctx.modelID,element2.value);_this170._parseSpatialChildren(ctx,ifcElement,parentMetaObjectId);});}}}}},{key:"_parsePropertySets",value:function _parsePropertySets(ctx){var lines=this._ifcAPI.GetLineIDsWithType(ctx.modelID,this._webIFC.IFCRELDEFINESBYPROPERTIES);for(var _i587=0;_i587<lines.size();_i587++){var relID=lines.get(_i587);var rel=this._ifcAPI.GetLine(ctx.modelID,relID,true);if(rel){var relatingPropertyDefinition=rel.RelatingPropertyDefinition;if(!relatingPropertyDefinition){continue;}var propertySetId=relatingPropertyDefinition.GlobalId.value;var props=relatingPropertyDefinition.HasProperties;if(props&&props.length>0){var propertySetType="Default";var propertySetName=relatingPropertyDefinition.Name.value;var properties=[];for(var _i588=0,len=props.length;_i588<len;_i588++){var prop=props[_i588];var _name8=prop.Name;var nominalValue=prop.NominalValue;if(_name8&&nominalValue){var property={name:_name8.value,type:nominalValue.type,value:nominalValue.value,valueType:nominalValue.valueType};if(prop.Description){property.description=prop.Description.value;}else if(nominalValue.description){property.description=nominalValue.description;}properties.push(property);}}var propertySet={id:propertySetId,type:propertySetType,name:propertySetName,properties:properties};ctx.metadata.propertySets.push(propertySet);ctx.stats.numPropertySets++;var relatedObjects=rel.RelatedObjects;if(!relatedObjects||relatedObjects.length===0){return;}for(var _i589=0,_len122=relatedObjects.length;_i589<_len122;_i589++){var relatedObject=relatedObjects[_i589];var metaObjectId=relatedObject.GlobalId.value;var metaObject=ctx.metaObjects[metaObjectId];if(metaObject){if(!metaObject.propertySetIds){metaObject.propertySetIds=[];}metaObject.propertySetIds.push(propertySetId);}}}}}}},{key:"_parseGeometry",value:function _parseGeometry(ctx){var _this171=this;this._ifcAPI.StreamAllMeshes(ctx.modelID,function(flatMesh){// TODO: Can we do geometry reuse with web-ifc?
|
|
29567
|
+
var flatMeshExpressID=flatMesh.expressID;var placedGeometries=flatMesh.geometries;var meshIds=[];var properties=_this171._ifcAPI.GetLine(ctx.modelID,flatMeshExpressID);var globalId=properties.GlobalId.value;if(ctx.loadMetadata){var metaObjectId=globalId;var metaObject=ctx.metaObjects[metaObjectId];if(ctx.includeTypes&&(!metaObject||!ctx.includeTypes[metaObject.type])){return;}if(ctx.excludeTypes&&(!metaObject||ctx.excludeTypes[metaObject.type])){return;}}var matrix=math.mat4();var origin=math.vec3();for(var j=0,lenj=placedGeometries.size();j<lenj;j++){var placedGeometry=placedGeometries.get(j);var geometry=_this171._ifcAPI.GetGeometry(ctx.modelID,placedGeometry.geometryExpressID);var vertexData=_this171._ifcAPI.GetVertexArray(geometry.GetVertexData(),geometry.GetVertexDataSize());var indices=_this171._ifcAPI.GetIndexArray(geometry.GetIndexData(),geometry.GetIndexDataSize());// De-interleave vertex arrays
|
|
29570
29568
|
var positions=new Float64Array(vertexData.length/2);var normals=new Float32Array(vertexData.length/2);for(var k=0,_l3=0,lenk=vertexData.length/6;k<lenk;k++,_l3+=3){positions[_l3+0]=vertexData[k*6+0];positions[_l3+1]=vertexData[k*6+1];positions[_l3+2]=vertexData[k*6+2];}matrix.set(placedGeometry.flatTransformation);math.transformPositions3(matrix,positions);var rtcNeeded=worldToRTCPositions(positions,positions,origin);if(!ctx.options.autoNormals){for(var _k2=0,_l4=0,_lenk=vertexData.length/6;_k2<_lenk;_k2++,_l4+=3){normals[_l4+0]=vertexData[_k2*6+3];normals[_l4+1]=vertexData[_k2*6+4];normals[_l4+2]=vertexData[_k2*6+5];}}ctx.stats.numGeometries++;ctx.stats.numVertices+=positions.length/3;ctx.stats.numTriangles+=indices.length/3;var meshId="mesh"+ctx.nextId++;ctx.sceneModel.createMesh({id:meshId,primitive:"triangles",// TODO
|
|
29571
29569
|
origin:rtcNeeded?origin:null,positions:positions,normals:ctx.options.autoNormals?null:normals,indices:indices,color:[placedGeometry.color.x,placedGeometry.color.y,placedGeometry.color.z],opacity:placedGeometry.color.w});meshIds.push(meshId);}var entityId=ctx.options.globalizeObjectIds?math.globalizeObjectId(ctx.sceneModel.id,globalId):globalId;ctx.sceneModel.createEntity({id:entityId,meshIds:meshIds,isObject:true});ctx.stats.numObjects++;});}}]);return WebIFCLoaderPlugin;}(Plugin);/**
|
|
29572
29570
|
* Default data access strategy for {@link LASLoaderPlugin}.
|
|
@@ -29787,7 +29785,7 @@ var headerBlockItems=[{item:'FileSignature',format:'char',size:4},{item:'FileSou
|
|
|
29787
29785
|
* @param {Boolean} [cfg.rotateX=false] Whether to rotate the LAS point positions 90 degrees. Applied after "center".
|
|
29788
29786
|
* @param {Number[]} [cfg.rotate=[0,0,0]] Rotations to immediately apply to the LAS points, given as Euler angles in degrees, for each of the X, Y and Z axis. Rotation is applied after "center" and "rotateX".
|
|
29789
29787
|
* @param {Number[]} [cfg.transform] 4x4 transform matrix to immediately apply to the LAS points. This is applied after "center", "rotateX" and "rotate". Typically used instead of "rotateX" and "rotate".
|
|
29790
|
-
*/function LASLoaderPlugin(viewer){var
|
|
29788
|
+
*/function LASLoaderPlugin(viewer){var _this172;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,LASLoaderPlugin);_this172=_super171.call(this,"lasLoader",viewer,cfg);_this172.dataSource=cfg.dataSource;_this172.skip=cfg.skip;_this172.fp64=cfg.fp64;_this172.colorDepth=cfg.colorDepth;_this172.center=cfg.center;_this172.rotate=cfg.rotate;_this172.rotateX=cfg.rotateX;_this172.transform=cfg.transform;return _this172;}/**
|
|
29791
29789
|
* Gets the custom data source through which the LASLoaderPlugin can load LAS files.
|
|
29792
29790
|
*
|
|
29793
29791
|
* Default value is {@link LASDefaultDataSource}, which loads via HTTP.
|
|
@@ -29914,8 +29912,8 @@ var headerBlockItems=[{item:'FileSignature',format:'char',size:4},{item:'FileSou
|
|
|
29914
29912
|
* @param {Number[]} [params.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]] The model's world transform matrix. Overrides the position, scale and rotation parameters. Relative to ````origin````.
|
|
29915
29913
|
* @param {Object} [params.stats] Collects model statistics.
|
|
29916
29914
|
* @returns {Entity} Entity representing the model, which will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#models}.
|
|
29917
|
-
*/},{key:"load",value:function load(){var
|
|
29918
|
-
}var options={las:{skip:this._skip,fp64:this._fp64,colorDepth:this._colorDepth}};if(params.src){this._loadModel(params.src,params,options,sceneModel);}else{var spinner=this.viewer.scene.canvas.spinner;spinner.processes++;this._parseModel(params.las,params,options,sceneModel).then(function(){spinner.processes--;},function(errMsg){spinner.processes--;
|
|
29915
|
+
*/},{key:"load",value:function load(){var _this173=this;var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(params.id&&this.viewer.scene.components[params.id]){this.error("Component with this ID already exists in viewer: "+params.id+" - will autogenerate this ID");delete params.id;}var sceneModel=new SceneModel(this.viewer.scene,utils.apply(params,{maxGeometryBatchSize:MAX_VERTICES,isModel:true}));if(!params.src&&!params.las){this.error("load() param expected: src or las");return sceneModel;// Return new empty model
|
|
29916
|
+
}var options={las:{skip:this._skip,fp64:this._fp64,colorDepth:this._colorDepth}};if(params.src){this._loadModel(params.src,params,options,sceneModel);}else{var spinner=this.viewer.scene.canvas.spinner;spinner.processes++;this._parseModel(params.las,params,options,sceneModel).then(function(){spinner.processes--;},function(errMsg){spinner.processes--;_this173.error(errMsg);sceneModel.fire("error",errMsg);});}return sceneModel;}},{key:"_loadModel",value:function _loadModel(src,params,options,sceneModel){var _this174=this;var spinner=this.viewer.scene.canvas.spinner;spinner.processes++;this._dataSource.getLAS(params.src,function(arrayBuffer){_this174._parseModel(arrayBuffer,params,options,sceneModel).then(function(){spinner.processes--;},function(errMsg){spinner.processes--;_this174.error(errMsg);sceneModel.fire("error",errMsg);});},function(errMsg){spinner.processes--;_this174.error(errMsg);sceneModel.fire("error",errMsg);});}},{key:"_parseModel",value:function _parseModel(arrayBuffer,params,options,sceneModel){var _this175=this;var readPositions=function readPositions(attributesPosition){var positionsValue=attributesPosition.value;if(_this175._center){var centerPos=math.vec3();var numPoints=positionsValue.length;for(var _i591=0,len=positionsValue.length;_i591<len;_i591+=3){centerPos[0]+=positionsValue[_i591+0];centerPos[1]+=positionsValue[_i591+1];centerPos[2]+=positionsValue[_i591+2];}centerPos[0]/=numPoints;centerPos[1]/=numPoints;centerPos[2]/=numPoints;for(var _i592=0,_len123=positionsValue.length;_i592<_len123;_i592+=3){positionsValue[_i592+0]-=centerPos[0];positionsValue[_i592+1]-=centerPos[1];positionsValue[_i592+2]-=centerPos[2];}}if(_this175._rotateX){if(positionsValue){for(var _i593=0,_len124=positionsValue.length;_i593<_len124;_i593+=3){var temp=positionsValue[_i593+1];positionsValue[_i593+1]=positionsValue[_i593+2];positionsValue[_i593+2]=temp;}}}if(_this175._rotate){var quaternion=math.identityQuaternion();var mat=math.mat4();math.eulerToQuaternion(_this175._rotate,"XYZ",quaternion);math.quaternionToRotationMat4(quaternion,mat);var pos=math.vec3();for(var _i594=0,_len125=positionsValue.length;_i594<_len125;_i594+=3){pos[0]=positionsValue[_i594+0];pos[1]=positionsValue[_i594+1];pos[2]=positionsValue[_i594+2];math.transformPoint3(mat,pos,pos);positionsValue[_i594+0]=pos[0];positionsValue[_i594+1]=pos[1];positionsValue[_i594+2]=pos[2];}}if(_this175._transform){var _mat=math.mat4(_this175._transform);var _pos=math.vec3();for(var _i595=0,_len126=positionsValue.length;_i595<_len126;_i595+=3){_pos[0]=positionsValue[_i595+0];_pos[1]=positionsValue[_i595+1];_pos[2]=positionsValue[_i595+2];math.transformPoint3(_mat,_pos,_pos);positionsValue[_i595+0]=_pos[0];positionsValue[_i595+1]=_pos[1];positionsValue[_i595+2]=_pos[2];}}return positionsValue;};function readColorsAndIntensities(attributesColor,attributesIntensity){var colors=attributesColor.value;var colorSize=attributesColor.size;var intensities=attributesIntensity.value;var colorsCompressedSize=intensities.length*4;var colorsCompressed=new Uint8Array(colorsCompressedSize);for(var _i596=0,j=0,k=0,len=intensities.length;_i596<len;_i596++,k+=colorSize,j+=4){colorsCompressed[j+0]=colors[k+0];colorsCompressed[j+1]=colors[k+1];colorsCompressed[j+2]=colors[k+2];colorsCompressed[j+3]=Math.round(intensities[_i596]/65536*255);}return colorsCompressed;}function readIntensities(attributesIntensity){var intensities=attributesIntensity.value;var colorsCompressedSize=intensities.length*4;var colorsCompressed=new Uint8Array(colorsCompressedSize);for(var _i597=0,j=0,len=intensities.length;_i597<len;_i597++,j+=4){colorsCompressed[j+0]=0;colorsCompressed[j+1]=0;colorsCompressed[j+2]=0;colorsCompressed[j+3]=Math.round(intensities[_i597]/65536*255);}return colorsCompressed;}return new Promise(function(resolve,reject){if(sceneModel.destroyed){reject();return;}var stats=params.stats||{};stats.sourceFormat="LAS";stats.schemaVersion="";stats.title="";stats.author="";stats.created="";stats.numMetaObjects=0;stats.numPropertySets=0;stats.numObjects=0;stats.numGeometries=0;stats.numTriangles=0;stats.numVertices=0;try{var lasHeader=loadLASHeader(arrayBuffer);parse$3(arrayBuffer,LASLoader,options).then(function(parsedData){var attributes=parsedData.attributes;var loaderData=parsedData.loaderData;var pointsFormatId=loaderData.pointsFormatId!==undefined?loaderData.pointsFormatId:-1;if(!attributes.POSITION){sceneModel.finalize();reject("No positions found in file");return;}var positionsValue;var colorsCompressed;switch(pointsFormatId){case 0:positionsValue=readPositions(attributes.POSITION);colorsCompressed=readIntensities(attributes.intensity);break;case 1:if(!attributes.intensity){sceneModel.finalize();reject("No positions found in file");return;}positionsValue=readPositions(attributes.POSITION);colorsCompressed=readIntensities(attributes.intensity);break;case 2:if(!attributes.intensity){sceneModel.finalize();reject("No positions found in file");return;}positionsValue=readPositions(attributes.POSITION);colorsCompressed=readColorsAndIntensities(attributes.COLOR_0,attributes.intensity);break;case 3:if(!attributes.intensity){sceneModel.finalize();reject("No positions found in file");return;}positionsValue=readPositions(attributes.POSITION);colorsCompressed=readColorsAndIntensities(attributes.COLOR_0,attributes.intensity);break;}var pointsChunks=chunkArray(positionsValue,MAX_VERTICES*3);var colorsChunks=chunkArray(colorsCompressed,MAX_VERTICES*4);var meshIds=[];for(var _i598=0,len=pointsChunks.length;_i598<len;_i598++){var meshId="pointsMesh".concat(_i598);meshIds.push(meshId);sceneModel.createMesh({id:meshId,primitive:"points",positions:pointsChunks[_i598],colorsCompressed:_i598<colorsChunks.length?colorsChunks[_i598]:null});}/*
|
|
29919
29917
|
const pointsChunks = chunkArray(positionsValue, MAX_VERTICES * 3);
|
|
29920
29918
|
const colorsChunks = chunkArray(colorsCompressed, MAX_VERTICES * 4);
|
|
29921
29919
|
const meshIds = [];
|
|
@@ -29938,7 +29936,7 @@ var headerBlockItems=[{item:'FileSignature',format:'char',size:4},{item:'FileSou
|
|
|
29938
29936
|
geometryId
|
|
29939
29937
|
});
|
|
29940
29938
|
}
|
|
29941
|
-
*/var pointsObjectId=params.entityId||math.createUUID();sceneModel.createEntity({id:pointsObjectId,meshIds:meshIds,isObject:true});sceneModel.finalize();if(params.metaModelJSON){var metaModelId=sceneModel.id;
|
|
29939
|
+
*/var pointsObjectId=params.entityId||math.createUUID();sceneModel.createEntity({id:pointsObjectId,meshIds:meshIds,isObject:true});sceneModel.finalize();if(params.metaModelJSON){var metaModelId=sceneModel.id;_this175.viewer.metaScene.createMetaModel(metaModelId,params.metaModelJSON,options);}else if(params.loadMetadata!==false){var rootMetaObjectId=math.createUUID();var metadata={projectId:"",author:"",createdAt:"",schema:"",creatingApplication:"",metaObjects:[{id:rootMetaObjectId,name:"Model",type:"Model"},{id:pointsObjectId,name:"PointCloud (LAS)",type:"PointCloud",parent:rootMetaObjectId,attributes:lasHeader||{}}],propertySets:[]};var _metaModelId=sceneModel.id;_this175.viewer.metaScene.createMetaModel(_metaModelId,metadata,options);}sceneModel.scene.once("tick",function(){if(sceneModel.destroyed){return;}sceneModel.scene.fire("modelLoaded",sceneModel.id);// FIXME: Assumes listeners know order of these two events
|
|
29942
29940
|
sceneModel.fire("loaded",true,false);// Don't forget the event, for late subscribers
|
|
29943
29941
|
});resolve();});}catch(e){sceneModel.finalize();reject(e);}});}}]);return LASLoaderPlugin;}(Plugin);function chunkArray(array,chunkSize){if(chunkSize>=array.length){return[array];}var result=[];for(var _i599=0;_i599<array.length;_i599+=chunkSize){result.push(array.slice(_i599,_i599+chunkSize));}return result;}/**
|
|
29944
29942
|
* Default data access strategy for {@link CityJSONLoaderPlugin}.
|
|
@@ -30136,7 +30134,7 @@ earcut.flatten=function(data){var dim=data[0][0].length,result={vertices:[],hole
|
|
|
30136
30134
|
* @param {String} [cfg.id="cityJSONLoader"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
|
|
30137
30135
|
* @param {Object} [cfg.dataSource] A custom data source through which the CityJSONLoaderPlugin can load model and
|
|
30138
30136
|
* metadata files. Defaults to an instance of {@link CityJSONDefaultDataSource}, which loads over HTTP.
|
|
30139
|
-
*/function CityJSONLoaderPlugin(viewer){var
|
|
30137
|
+
*/function CityJSONLoaderPlugin(viewer){var _this176;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,CityJSONLoaderPlugin);_this176=_super172.call(this,"cityJSONLoader",viewer,cfg);_this176.dataSource=cfg.dataSource;return _this176;}/**
|
|
30140
30138
|
* Gets the custom data source through which the CityJSONLoaderPlugin can load CityJSON files.
|
|
30141
30139
|
*
|
|
30142
30140
|
* Default value is {@link CityJSONDefaultDataSource}, which loads via HTTP.
|
|
@@ -30168,7 +30166,7 @@ earcut.flatten=function(data){var dim=data[0][0].length,result={vertices:[],hole
|
|
|
30168
30166
|
* primitives. Only works while {@link DTX#enabled} is also ````true````.
|
|
30169
30167
|
* @returns {Entity} Entity representing the model, which will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#models}.
|
|
30170
30168
|
*/},{key:"load",value:function load(){var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(params.id&&this.viewer.scene.components[params.id]){this.error("Component with this ID already exists in viewer: "+params.id+" - will autogenerate this ID");delete params.id;}var sceneModel=new SceneModel(this.viewer.scene,utils.apply(params,{isModel:true,edges:true}));if(!params.src&&!params.cityJSON){this.error("load() param expected: src or cityJSON");return sceneModel;// Return new empty model
|
|
30171
|
-
}var options={};if(params.src){this._loadModel(params.src,params,options,sceneModel);}else{var spinner=this.viewer.scene.canvas.spinner;spinner.processes++;this._parseModel(params.cityJSON,params,options,sceneModel);spinner.processes--;}return sceneModel;}},{key:"_loadModel",value:function _loadModel(src,params,options,sceneModel){var
|
|
30169
|
+
}var options={};if(params.src){this._loadModel(params.src,params,options,sceneModel);}else{var spinner=this.viewer.scene.canvas.spinner;spinner.processes++;this._parseModel(params.cityJSON,params,options,sceneModel);spinner.processes--;}return sceneModel;}},{key:"_loadModel",value:function _loadModel(src,params,options,sceneModel){var _this177=this;var spinner=this.viewer.scene.canvas.spinner;spinner.processes++;this._dataSource.getCityJSON(params.src,function(data){_this177._parseModel(data,params,options,sceneModel);spinner.processes--;},function(errMsg){spinner.processes--;_this177.error(errMsg);sceneModel.fire("error",errMsg);});}},{key:"_parseModel",value:function _parseModel(data,params,options,sceneModel){if(sceneModel.destroyed){return;}var vertices=data.transform?this._transformVertices(data.vertices,data.transform,options.rotateX):data.vertices;var stats=params.stats||{};stats.sourceFormat=data.type||"CityJSON";stats.schemaVersion=data.version||"";stats.title="";stats.author="";stats.created="";stats.numMetaObjects=0;stats.numPropertySets=0;stats.numObjects=0;stats.numGeometries=0;stats.numTriangles=0;stats.numVertices=0;var loadMetadata=params.loadMetadata!==false;var rootMetaObject=loadMetadata?{id:math.createUUID(),name:"Model",type:"Model"}:null;var metadata=loadMetadata?{id:"",projectId:"",author:"",createdAt:"",schema:data.version||"",creatingApplication:"",metaObjects:[rootMetaObject],propertySets:[]}:null;var ctx={data:data,vertices:vertices,sceneModel:sceneModel,loadMetadata:loadMetadata,metadata:metadata,rootMetaObject:rootMetaObject,nextId:0,stats:stats};this._parseCityJSON(ctx);sceneModel.finalize();if(loadMetadata){var metaModelId=sceneModel.id;this.viewer.metaScene.createMetaModel(metaModelId,ctx.metadata,options);}sceneModel.scene.once("tick",function(){if(sceneModel.destroyed){return;}sceneModel.scene.fire("modelLoaded",sceneModel.id);// FIXME: Assumes listeners know order of these two events
|
|
30172
30170
|
sceneModel.fire("loaded",true,false);// Don't forget the event, for late subscribers
|
|
30173
30171
|
});}},{key:"_transformVertices",value:function _transformVertices(vertices,transform,rotateX){var transformedVertices=[];var scale=transform.scale||math.vec3([1,1,1]);var translate=transform.translate||math.vec3([0,0,0]);for(var _i600=0,j=0;_i600<vertices.length;_i600++,j+=3){var x=vertices[_i600][0]*scale[0]+translate[0];var y=vertices[_i600][1]*scale[1]+translate[1];var _z5=vertices[_i600][2]*scale[2]+translate[2];if(rotateX){transformedVertices.push([x,_z5,y]);}else{transformedVertices.push([x,y,_z5]);}}return transformedVertices;}},{key:"_parseCityJSON",value:function _parseCityJSON(ctx){var data=ctx.data;var cityObjects=data.CityObjects;for(var objectId in cityObjects){if(cityObjects.hasOwnProperty(objectId)){var cityObject=cityObjects[objectId];this._parseCityObject(ctx,cityObject,objectId);}}}},{key:"_parseCityObject",value:function _parseCityObject(ctx,cityObject,objectId){var sceneModel=ctx.sceneModel;var data=ctx.data;if(ctx.loadMetadata){var metaObjectId=objectId;var metaObjectType=cityObject.type;var metaObjectName=metaObjectType+" : "+objectId;var parentMetaObjectId=cityObject.parents?cityObject.parents[0]:ctx.rootMetaObject.id;ctx.metadata.metaObjects.push({id:metaObjectId,name:metaObjectName,type:metaObjectType,parent:parentMetaObjectId});}ctx.stats.numMetaObjects++;if(!(cityObject.geometry&&cityObject.geometry.length>0)){return;}var meshIds=[];for(var _i601=0,len=cityObject.geometry.length;_i601<len;_i601++){var geometry=cityObject.geometry[_i601];var objectMaterial=void 0;var surfaceMaterials=void 0;var appearance=data.appearance;if(appearance){var materials=appearance.materials;if(materials){var geometryMaterial=geometry.material;if(geometryMaterial){var themeIds=Object.keys(geometryMaterial);if(themeIds.length>0){var themeId=themeIds[0];var theme=geometryMaterial[themeId];if(theme.value!==undefined){objectMaterial=materials[theme.value];}else{var values=theme.values;if(values){surfaceMaterials=[];for(var j=0,lenj=values.length;j<lenj;j++){var value=values[_i601];var surfaceMaterial=materials[value];surfaceMaterials.push(surfaceMaterial);}}}}}}}if(surfaceMaterials){this._parseGeometrySurfacesWithOwnMaterials(ctx,geometry,surfaceMaterials,meshIds);}else{this._parseGeometrySurfacesWithSharedMaterial(ctx,geometry,objectMaterial,meshIds);}}if(meshIds.length>0){sceneModel.createEntity({id:objectId,meshIds:meshIds,isObject:true});ctx.stats.numObjects++;}}},{key:"_parseGeometrySurfacesWithOwnMaterials",value:function _parseGeometrySurfacesWithOwnMaterials(ctx,geometry,surfaceMaterials,meshIds){var geomType=geometry.type;switch(geomType){case"MultiPoint":break;case"MultiLineString":break;case"MultiSurface":case"CompositeSurface":var surfaces=geometry.boundaries;this._parseSurfacesWithOwnMaterials(ctx,surfaceMaterials,surfaces,meshIds);break;case"Solid":var shells=geometry.boundaries;for(var j=0;j<shells.length;j++){var _surfaces=shells[j];this._parseSurfacesWithOwnMaterials(ctx,surfaceMaterials,_surfaces,meshIds);}break;case"MultiSolid":case"CompositeSolid":var solids=geometry.boundaries;for(var _j4=0;_j4<solids.length;_j4++){for(var k=0;k<solids[_j4].length;k++){var _surfaces2=solids[_j4][k];this._parseSurfacesWithOwnMaterials(ctx,surfaceMaterials,_surfaces2,meshIds);}}break;}}},{key:"_parseSurfacesWithOwnMaterials",value:function _parseSurfacesWithOwnMaterials(ctx,surfaceMaterials,surfaces,meshIds){var vertices=ctx.vertices;var sceneModel=ctx.sceneModel;for(var _i602=0;_i602<surfaces.length;_i602++){var surface=surfaces[_i602];var surfaceMaterial=surfaceMaterials[_i602]||{diffuseColor:[0.8,0.8,0.8],transparency:1.0};var face=[];var holes=[];var sharedIndices=[];var geometryCfg={positions:[],indices:[]};for(var j=0;j<surface.length;j++){if(face.length>0){holes.push(face.length);}var newFace=this._extractLocalIndices(ctx,surface[j],sharedIndices,geometryCfg);face.push.apply(face,_toConsumableArray(newFace));}if(face.length===3){// Triangle
|
|
30174
30172
|
geometryCfg.indices.push(face[0]);geometryCfg.indices.push(face[1]);geometryCfg.indices.push(face[2]);}else if(face.length>3){// Polygon
|
|
@@ -30408,7 +30406,7 @@ var pList=[];for(var k=0;k<boundary.length;k++){pList.push({x:vertices[sharedInd
|
|
|
30408
30406
|
* @param {String} [cfg.id="DotBIMLoader"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
|
|
30409
30407
|
* @param {Object} [cfg.objectDefaults] Map of initial default states for each loaded {@link Entity} that represents an object. Default value is {@link IFCObjectDefaults}.
|
|
30410
30408
|
* @param {Object} [cfg.dataSource] A custom data source through which the DotBIMLoaderPlugin can load metadata, glTF and binary attachments. Defaults to an instance of {@link DotBIMDefaultDataSource}, which loads over HTTP.
|
|
30411
|
-
*/function DotBIMLoaderPlugin(viewer){var
|
|
30409
|
+
*/function DotBIMLoaderPlugin(viewer){var _this178;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,DotBIMLoaderPlugin);_this178=_super173.call(this,"DotBIMLoader",viewer,cfg);_this178.dataSource=cfg.dataSource;_this178.objectDefaults=cfg.objectDefaults;return _this178;}/**
|
|
30412
30410
|
* Sets a custom data source through which the DotBIMLoaderPlugin can .BIM files.
|
|
30413
30411
|
*
|
|
30414
30412
|
* Default value is {@link DotBIMDefaultDataSource}, which loads via an XMLHttpRequest.
|
|
@@ -30452,12 +30450,12 @@ var pList=[];for(var k=0;k<boundary.length;k++){pList.push({x:vertices[sharedInd
|
|
|
30452
30450
|
* to non-textured triangle meshes, and that VBOs are always used for meshes that have textures, line segments, or point
|
|
30453
30451
|
* primitives. Only works while {@link DTX#enabled} is also ````true````.
|
|
30454
30452
|
* @returns {Entity} Entity representing the model, which will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#models}
|
|
30455
|
-
*/,set:function set(value){this._objectDefaults=value||IFCObjectDefaults;}},{key:"load",value:function load(){var
|
|
30453
|
+
*/,set:function set(value){this._objectDefaults=value||IFCObjectDefaults;}},{key:"load",value:function load(){var _this179=this;var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(params.id&&this.viewer.scene.components[params.id]){this.error("Component with this ID already exists in viewer: "+params.id+" - will autogenerate this ID");delete params.id;}var sceneModel=new SceneModel(this.viewer.scene,utils.apply(params,{isModel:true,backfaces:params.backfaces,dtxEnabled:params.dtxEnabled,rotation:params.rotation,origin:params.origin}));var modelId=sceneModel.id;// In case ID was auto-generated
|
|
30456
30454
|
if(!params.src&&!params.dotBIM){this.error("load() param expected: src or dotBIM");return sceneModel;// Return new empty model
|
|
30457
|
-
}var objectDefaults=params.objectDefaults||this._objectDefaults||IFCObjectDefaults;var includeTypes;if(params.includeTypes){includeTypes={};for(var _i606=0,len=params.includeTypes.length;_i606<len;_i606++){includeTypes[params.includeTypes[_i606]]=true;}}var excludeTypes;if(params.excludeTypes){excludeTypes={};if(!includeTypes){includeTypes={};}for(var _i607=0,_len127=params.excludeTypes.length;_i607<_len127;_i607++){includeTypes[params.excludeTypes[_i607]]=true;}}var parseDotBIM=function parseDotBIM(ctx){var fileData=ctx.fileData;var sceneModel=ctx.sceneModel;var dbMeshLoaded={};var projectId=math.createUUID();var siteId=math.createUUID();var buildingId=math.createUUID();var buildingStoryId=math.createUUID();var metaModelData={metaObjects:[{id:projectId,name:"Project",type:"Project",parent:null},{id:siteId,name:"Site",type:"Site",parent:projectId},{id:buildingId,name:"Building",type:"Building",parent:siteId},{id:buildingStoryId,name:"BuildingStorey",type:"BuildingStorey",parent:buildingId}],propertySets:[]};var parseDBMesh=function parseDBMesh(dbMeshId,element){if(dbMeshLoaded[dbMeshId]){return;}var dbMesh=fileData.meshes.find(function(obj){return obj.mesh_id===element.mesh_id;});sceneModel.createGeometry({id:dbMeshId,primitive:"triangles",positions:dbMesh.coordinates,indices:dbMesh.indices});dbMeshLoaded[dbMeshId]=true;};var dbElements=fileData.elements;var _loop8=function _loop8(_i608,_len128){var element=dbElements[_i608];var elementType=element.type;if(excludeTypes&&excludeTypes[elementType]){return"continue";}if(includeTypes&&!includeTypes[elementType]){return"continue";}var info=element.info;var objectId=element.guid!==undefined?"".concat(element.guid):info!==undefined&&info.id!==undefined?info.id:_i608;var dbMeshId=element.mesh_id;var vector=element.vector;var rotation=element.rotation;var props=objectDefaults?objectDefaults[elementType]||objectDefaults["DEFAULT"]:null;var visible=true;var pickable=true;if(element.face_colors===undefined){parseDBMesh(dbMeshId,element);var meshId="".concat(objectId,"-mesh");var _color12=element.color?[element.color.r/255.0,element.color.g/255.0,element.color.b/255.0]:[1,1,1];var _opacity7=element.color?element.color.a/255.0:1.0;if(props){if(props.visible===false){visible=false;}if(props.pickable===false){pickable=false;}if(props.colorize){_color12=props.colorize;}if(props.opacity!==undefined&&props.opacity!==null){_opacity7=props.opacity;}}sceneModel.createMesh({id:meshId,geometryId:dbMeshId,color:_color12,opacity:_opacity7,quaternion:rotation&&(rotation.qz!==0||rotation.qy!==0||rotation.qx!==0||rotation.qw!==1.0)?[rotation.qx,rotation.qy,rotation.qz,rotation.qw]:undefined,position:vector?[vector.x,vector.y,vector.z]:undefined});sceneModel.createEntity({id:objectId,meshIds:[meshId],visible:visible,pickable:pickable,isObject:true});}else{var faceColors=element.face_colors;var coloredTrianglesDictionary={};var currentTriangleIndicesCount=0;var dbMesh=fileData.meshes.find(function(obj){return obj.mesh_id===element.mesh_id;});for(var _i609=0,_len129=faceColors.length;_i609<_len129;_i609+=4){var faceColor=[faceColors[_i609],faceColors[_i609+1],faceColors[_i609+2],faceColors[_i609+3]];if(coloredTrianglesDictionary[faceColor]===undefined){coloredTrianglesDictionary[faceColor]=[];}var indexForPoint0=dbMesh.indices[currentTriangleIndicesCount];var x0=dbMesh.coordinates[indexForPoint0*3];var y0=dbMesh.coordinates[indexForPoint0*3+1];var z0=dbMesh.coordinates[indexForPoint0*3+2];var indexForPoint1=dbMesh.indices[currentTriangleIndicesCount+1];var x1=dbMesh.coordinates[indexForPoint1*3];var y1=dbMesh.coordinates[indexForPoint1*3+1];var z1=dbMesh.coordinates[indexForPoint1*3+2];var indexForPoint2=dbMesh.indices[currentTriangleIndicesCount+2];var x2=dbMesh.coordinates[indexForPoint2*3];var y2=dbMesh.coordinates[indexForPoint2*3+1];var z2=dbMesh.coordinates[indexForPoint2*3+2];coloredTrianglesDictionary[faceColor].push(x0,y0,z0,x1,y1,z1,x2,y2,z2);currentTriangleIndicesCount+=3;}var meshIds=[];for(var _i610=0,_Object$entries5=Object.entries(coloredTrianglesDictionary);_i610<_Object$entries5.length;_i610++){var _Object$entries5$_i=_slicedToArray(_Object$entries5[_i610],2),_faceColor=_Object$entries5$_i[0],trianglesCoordinates=_Object$entries5$_i[1];sceneModel.createGeometry({id:"".concat(dbMeshId,"-").concat(_faceColor),primitive:"triangles",positions:trianglesCoordinates,indices:_toConsumableArray(Array(trianglesCoordinates.length/3).keys())});var _meshId3="".concat(objectId,"-mesh-").concat(_faceColor);var faceColorArray=_faceColor.split(',').map(Number);var _color13=[faceColorArray[0]/255.0,faceColorArray[1]/255.0,faceColorArray[2]/255.0];var _opacity8=faceColorArray[3]/255.0;if(props){if(props.visible===false){visible=false;}if(props.pickable===false){pickable=false;}if(props.colorize){_color13=props.colorize;}if(props.opacity!==undefined&&props.opacity!==null){_opacity8=props.opacity;}}sceneModel.createMesh({id:_meshId3,geometryId:"".concat(dbMeshId,"-").concat(_faceColor),color:_color13,opacity:_opacity8,quaternion:rotation&&(rotation.qz!==0||rotation.qy!==0||rotation.qx!==0||rotation.qw!==1.0)?[rotation.qx,rotation.qy,rotation.qz,rotation.qw]:undefined,position:vector?[vector.x,vector.y,vector.z]:undefined});meshIds.push(_meshId3);}sceneModel.createEntity({id:objectId,meshIds:meshIds,visible:visible,pickable:pickable,isObject:true});}var properties=[];for(var infoKey in info){properties.push({name:infoKey,value:info[infoKey]});}metaModelData.propertySets.push({id:objectId,name:"Properties",properties:properties});metaModelData.metaObjects.push({id:objectId,name:info&&info.Name&&info.Name!=="None"?info.Name:"".concat(element.type," ").concat(objectId),type:element.type,parent:buildingStoryId,propertySetIds:[objectId]});};for(var _i608=0,_len128=dbElements.length;_i608<_len128;_i608++){var _ret2=_loop8(_i608,_len128);if(_ret2==="continue")continue;}sceneModel.finalize();
|
|
30455
|
+
}var objectDefaults=params.objectDefaults||this._objectDefaults||IFCObjectDefaults;var includeTypes;if(params.includeTypes){includeTypes={};for(var _i606=0,len=params.includeTypes.length;_i606<len;_i606++){includeTypes[params.includeTypes[_i606]]=true;}}var excludeTypes;if(params.excludeTypes){excludeTypes={};if(!includeTypes){includeTypes={};}for(var _i607=0,_len127=params.excludeTypes.length;_i607<_len127;_i607++){includeTypes[params.excludeTypes[_i607]]=true;}}var parseDotBIM=function parseDotBIM(ctx){var fileData=ctx.fileData;var sceneModel=ctx.sceneModel;var dbMeshLoaded={};var projectId=math.createUUID();var siteId=math.createUUID();var buildingId=math.createUUID();var buildingStoryId=math.createUUID();var metaModelData={metaObjects:[{id:projectId,name:"Project",type:"Project",parent:null},{id:siteId,name:"Site",type:"Site",parent:projectId},{id:buildingId,name:"Building",type:"Building",parent:siteId},{id:buildingStoryId,name:"BuildingStorey",type:"BuildingStorey",parent:buildingId}],propertySets:[]};var parseDBMesh=function parseDBMesh(dbMeshId,element){if(dbMeshLoaded[dbMeshId]){return;}var dbMesh=fileData.meshes.find(function(obj){return obj.mesh_id===element.mesh_id;});sceneModel.createGeometry({id:dbMeshId,primitive:"triangles",positions:dbMesh.coordinates,indices:dbMesh.indices});dbMeshLoaded[dbMeshId]=true;};var dbElements=fileData.elements;var _loop8=function _loop8(_i608,_len128){var element=dbElements[_i608];var elementType=element.type;if(excludeTypes&&excludeTypes[elementType]){return"continue";}if(includeTypes&&!includeTypes[elementType]){return"continue";}var info=element.info;var objectId=element.guid!==undefined?"".concat(element.guid):info!==undefined&&info.id!==undefined?info.id:_i608;var dbMeshId=element.mesh_id;var vector=element.vector;var rotation=element.rotation;var props=objectDefaults?objectDefaults[elementType]||objectDefaults["DEFAULT"]:null;var visible=true;var pickable=true;if(element.face_colors===undefined){parseDBMesh(dbMeshId,element);var meshId="".concat(objectId,"-mesh");var _color12=element.color?[element.color.r/255.0,element.color.g/255.0,element.color.b/255.0]:[1,1,1];var _opacity7=element.color?element.color.a/255.0:1.0;if(props){if(props.visible===false){visible=false;}if(props.pickable===false){pickable=false;}if(props.colorize){_color12=props.colorize;}if(props.opacity!==undefined&&props.opacity!==null){_opacity7=props.opacity;}}sceneModel.createMesh({id:meshId,geometryId:dbMeshId,color:_color12,opacity:_opacity7,quaternion:rotation&&(rotation.qz!==0||rotation.qy!==0||rotation.qx!==0||rotation.qw!==1.0)?[rotation.qx,rotation.qy,rotation.qz,rotation.qw]:undefined,position:vector?[vector.x,vector.y,vector.z]:undefined});sceneModel.createEntity({id:objectId,meshIds:[meshId],visible:visible,pickable:pickable,isObject:true});}else{var faceColors=element.face_colors;var coloredTrianglesDictionary={};var currentTriangleIndicesCount=0;var dbMesh=fileData.meshes.find(function(obj){return obj.mesh_id===element.mesh_id;});for(var _i609=0,_len129=faceColors.length;_i609<_len129;_i609+=4){var faceColor=[faceColors[_i609],faceColors[_i609+1],faceColors[_i609+2],faceColors[_i609+3]];if(coloredTrianglesDictionary[faceColor]===undefined){coloredTrianglesDictionary[faceColor]=[];}var indexForPoint0=dbMesh.indices[currentTriangleIndicesCount];var x0=dbMesh.coordinates[indexForPoint0*3];var y0=dbMesh.coordinates[indexForPoint0*3+1];var z0=dbMesh.coordinates[indexForPoint0*3+2];var indexForPoint1=dbMesh.indices[currentTriangleIndicesCount+1];var x1=dbMesh.coordinates[indexForPoint1*3];var y1=dbMesh.coordinates[indexForPoint1*3+1];var z1=dbMesh.coordinates[indexForPoint1*3+2];var indexForPoint2=dbMesh.indices[currentTriangleIndicesCount+2];var x2=dbMesh.coordinates[indexForPoint2*3];var y2=dbMesh.coordinates[indexForPoint2*3+1];var z2=dbMesh.coordinates[indexForPoint2*3+2];coloredTrianglesDictionary[faceColor].push(x0,y0,z0,x1,y1,z1,x2,y2,z2);currentTriangleIndicesCount+=3;}var meshIds=[];for(var _i610=0,_Object$entries5=Object.entries(coloredTrianglesDictionary);_i610<_Object$entries5.length;_i610++){var _Object$entries5$_i=_slicedToArray(_Object$entries5[_i610],2),_faceColor=_Object$entries5$_i[0],trianglesCoordinates=_Object$entries5$_i[1];sceneModel.createGeometry({id:"".concat(dbMeshId,"-").concat(_faceColor),primitive:"triangles",positions:trianglesCoordinates,indices:_toConsumableArray(Array(trianglesCoordinates.length/3).keys())});var _meshId3="".concat(objectId,"-mesh-").concat(_faceColor);var faceColorArray=_faceColor.split(',').map(Number);var _color13=[faceColorArray[0]/255.0,faceColorArray[1]/255.0,faceColorArray[2]/255.0];var _opacity8=faceColorArray[3]/255.0;if(props){if(props.visible===false){visible=false;}if(props.pickable===false){pickable=false;}if(props.colorize){_color13=props.colorize;}if(props.opacity!==undefined&&props.opacity!==null){_opacity8=props.opacity;}}sceneModel.createMesh({id:_meshId3,geometryId:"".concat(dbMeshId,"-").concat(_faceColor),color:_color13,opacity:_opacity8,quaternion:rotation&&(rotation.qz!==0||rotation.qy!==0||rotation.qx!==0||rotation.qw!==1.0)?[rotation.qx,rotation.qy,rotation.qz,rotation.qw]:undefined,position:vector?[vector.x,vector.y,vector.z]:undefined});meshIds.push(_meshId3);}sceneModel.createEntity({id:objectId,meshIds:meshIds,visible:visible,pickable:pickable,isObject:true});}var properties=[];for(var infoKey in info){properties.push({name:infoKey,value:info[infoKey]});}metaModelData.propertySets.push({id:objectId,name:"Properties",properties:properties});metaModelData.metaObjects.push({id:objectId,name:info&&info.Name&&info.Name!=="None"?info.Name:"".concat(element.type," ").concat(objectId),type:element.type,parent:buildingStoryId,propertySetIds:[objectId]});};for(var _i608=0,_len128=dbElements.length;_i608<_len128;_i608++){var _ret2=_loop8(_i608,_len128);if(_ret2==="continue")continue;}sceneModel.finalize();_this179.viewer.metaScene.createMetaModel(modelId,metaModelData);sceneModel.scene.once("tick",function(){if(sceneModel.destroyed){return;}sceneModel.scene.fire("modelLoaded",sceneModel.id);// FIXME: Assumes listeners know order of these two events
|
|
30458
30456
|
sceneModel.fire("loaded",true,false);// Don't forget the event, for late subscribers
|
|
30459
30457
|
});};if(params.src){var src=params.src;this.viewer.scene.canvas.spinner.processes++;this._dataSource.getDotBIM(src,function(fileData){// OK
|
|
30460
|
-
var ctx={fileData:fileData,sceneModel:sceneModel,nextId:0,error:function error(errMsg){}};parseDotBIM(ctx);
|
|
30458
|
+
var ctx={fileData:fileData,sceneModel:sceneModel,nextId:0,error:function error(errMsg){}};parseDotBIM(ctx);_this179.viewer.scene.canvas.spinner.processes--;},function(err){_this179.viewer.scene.canvas.spinner.processes--;_this179.error(err);});}else if(params.dotBIM){var ctx={fileData:params.dotBIM,sceneModel:sceneModel,nextId:0,error:function error(errMsg){}};parseDotBIM(ctx);}sceneModel.once("destroyed",function(){_this179.viewer.metaScene.destroyMetaModel(modelId);});return sceneModel;}/**
|
|
30461
30459
|
* Destroys this DotBIMLoaderPlugin.
|
|
30462
30460
|
*/},{key:"destroy",value:function destroy(){_get(_getPrototypeOf(DotBIMLoaderPlugin.prototype),"destroy",this).call(this);}}]);return DotBIMLoaderPlugin;}(Plugin);var hex2rgb=function hex2rgb(color){var rgb=function rgb(idx){return parseInt(color.substr(idx+1,2),16)/255;};return[rgb(0),rgb(2),rgb(4)];};var triangulateEarClipping=function triangulateEarClipping(planeCoords){var polygonVertices=[];for(var _i611=0;_i611<planeCoords.length;++_i611){polygonVertices.push(_i611);}var isCCW=function(){var ba=math.vec2();var bc=math.vec2();var anglesSum=0;for(var _i612=0;_i612<polygonVertices.length;++_i612){var _a9=planeCoords[polygonVertices[_i612]];var b=planeCoords[polygonVertices[(_i612+1)%polygonVertices.length]];var c=planeCoords[polygonVertices[(_i612+2)%polygonVertices.length]];math.subVec2(_a9,b,ba);math.subVec2(c,b,bc);var theta=math.dotVec2(ba,bc)/Math.sqrt(math.sqLenVec2(ba)*math.sqLenVec2(bc));var _angle3=Math.acos(Math.max(-1,Math.min(theta,1)));var convex=ba[0]*bc[1]-ba[1]*bc[0]>=0;anglesSum+=convex?_angle3:2*Math.PI-_angle3;}return anglesSum<polygonVertices.length*Math.PI;}();var pointInTriangle=function(){var sign=function sign(p1,p2,p3){return(p1[0]-p3[0])*(p2[1]-p3[1])-(p2[0]-p3[0])*(p1[1]-p3[1]);};return function(pt,v1,v2,v3){var d1=sign(pt,v1,v2);var d2=sign(pt,v2,v3);var d3=sign(pt,v3,v1);var has_neg=d1<0||d2<0||d3<0;var has_pos=d1>0||d2>0||d3>0;return!(has_neg&&has_pos);};}();var baseTriangles=[];var vertices=(isCCW?polygonVertices:polygonVertices.slice(0).reverse()).map(function(i){return{idx:i};});vertices.forEach(function(v,i){v.prev=vertices[(i-1+vertices.length)%vertices.length];v.next=vertices[(i+1)%vertices.length];});var ba=math.vec2();var bc=math.vec2();while(vertices.length>2){var earIdx=0;var _loop9=function _loop9(){if(earIdx>=vertices.length){throw"isCCW = ".concat(isCCW,"; earIdx = ").concat(earIdx,"; len = ").concat(vertices.length);}var v=vertices[earIdx];var a=planeCoords[v.prev.idx];var b=planeCoords[v.idx];var c=planeCoords[v.next.idx];math.subVec2(a,b,ba);math.subVec2(c,b,bc);if(ba[0]*bc[1]-ba[1]*bc[0]>=0// a convex vertex
|
|
30463
30461
|
&&vertices.every(// no other vertices inside
|
|
@@ -30472,10 +30470,10 @@ marker2.update(point2WorldPos);marker1.destroy();marker2.destroy();updatePointer
|
|
|
30472
30470
|
* See {@link ZonesPlugin} for more info.
|
|
30473
30471
|
*/var Zone=/*#__PURE__*/function(_Component42){_inherits(Zone,_Component42);var _super174=_createSuper(Zone);/**
|
|
30474
30472
|
* @private
|
|
30475
|
-
*/function Zone(plugin){var
|
|
30473
|
+
*/function Zone(plugin){var _this180;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Zone);_this180=_super174.call(this,plugin.viewer.scene,cfg);/**
|
|
30476
30474
|
* The {@link ZonesPlugin} that owns this Zone.
|
|
30477
30475
|
* @type {ZonesPlugin}
|
|
30478
|
-
*/
|
|
30476
|
+
*/_this180.plugin=plugin;_this180._container=cfg.container;if(!_this180._container){throw"config missing: container";}_this180._eventSubs={};_this180.plugin.viewer.scene;_this180._geometry=cfg.geometry;cfg.onMouseOver?function(event){cfg.onMouseOver(event,_assertThisInitialized(_this180));_this180.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent('mouseover',event));}:null;cfg.onMouseLeave?function(event){cfg.onMouseLeave(event,_assertThisInitialized(_this180));_this180.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent('mouseleave',event));}:null;cfg.onContextMenu?function(event){cfg.onContextMenu(event,_assertThisInitialized(_this180));}:null;_this180._alpha="alpha"in cfg&&cfg.alpha!==undefined?cfg.alpha:0.5;_this180.color=cfg.color;_this180._visible=true;_this180._rebuildMesh();return _this180;}_createClass(Zone,[{key:"_rebuildMesh",value:function _rebuildMesh(){var _ref24;var scene=this.plugin.viewer.scene;var planeCoords=this._geometry.planeCoordinates.slice();var downward=this._geometry.height<0;var altitude=this._geometry.altitude+(downward?this._geometry.height:0);var height=this._geometry.height*(downward?-1:1);var _triangulateEarClippi3=triangulateEarClipping(planeCoords),_triangulateEarClippi4=_slicedToArray(_triangulateEarClippi3,3),baseVertices=_triangulateEarClippi4[0],baseTriangles=_triangulateEarClippi4[1],isCCW=_triangulateEarClippi4[2];// TODO: prevent crossing edges
|
|
30479
30477
|
var pos=[];var ind=[];var addPlane=function addPlane(isCeiling){var baseIdx=pos.length;var _iterator41=_createForOfIteratorHelper(baseVertices),_step41;try{for(_iterator41.s();!(_step41=_iterator41.n()).done;){var c=_step41.value;pos.push([c[0],altitude+(isCeiling?height:0),c[1]]);}}catch(err){_iterator41.e(err);}finally{_iterator41.f();}var _iterator42=_createForOfIteratorHelper(baseTriangles),_step42;try{for(_iterator42.s();!(_step42=_iterator42.n()).done;){var t=_step42.value;ind.push.apply(ind,_toConsumableArray((isCeiling?t:t.slice(0).reverse()).map(function(i){return i+baseIdx;})));}}catch(err){_iterator42.e(err);}finally{_iterator42.f();}};addPlane(false);// floor
|
|
30480
30478
|
addPlane(true);// ceiling
|
|
30481
30479
|
// sides
|
|
@@ -30534,11 +30532,11 @@ switch(polygonType){case COPLANAR:newFaces.push(face);break;case FRONT:newFaces.
|
|
|
30534
30532
|
* @param {ZonesPlugin} zonesPlugin The ZonesPlugin to control.
|
|
30535
30533
|
* @param [cfg] Configuration
|
|
30536
30534
|
* @param {PointerLens} [cfg.pointerLens] A PointerLens to use to provide a magnified view of the cursor when snapping is enabled.
|
|
30537
|
-
*/function ZonesAAZoneControl(zonesPlugin,cfg,createSelect3dPoint){var
|
|
30535
|
+
*/function ZonesAAZoneControl(zonesPlugin,cfg,createSelect3dPoint){var _this181;_classCallCheck(this,ZonesAAZoneControl);_this181=_super175.call(this,zonesPlugin.viewer.scene);_this181.zonesPlugin=zonesPlugin;_this181.pointerLens=cfg.pointerLens;_this181.createSelect3dPoint=createSelect3dPoint;_this181._deactivate=null;return _this181;}_createClass(ZonesAAZoneControl,[{key:"active",get:function get(){return!!this._deactivate;}},{key:"activate",value:function activate(zoneAltitude,zoneHeight,zoneColor,zoneAlpha){if(this._deactivate){return;}if(_typeof(zoneAltitude)==="object"&&zoneAltitude!==null){var params=zoneAltitude;var param=function param(name,defaultValue){if(name in params){return params[name];}else if(defaultValue!==undefined){return defaultValue;}else{throw"config missing: "+name;}};zoneAltitude=param("altitude");zoneHeight=param("height");zoneColor=param("color","#008000");zoneAlpha=param("alpha",0.5);}var zonesPlugin=this.zonesPlugin;var viewer=zonesPlugin.viewer;var scene=viewer.scene;var self=this;var select3dPoint=this.createSelect3dPoint(viewer,function(origin,direction){return planeIntersect(zoneAltitude,math.vec3([0,1,0]),origin,direction);});(function rec(){var basePolygon=basePolygon3D(scene,zoneColor,zoneAlpha);var deactivate=startAARectCreateUI(scene,zoneColor,self.pointerLens,select3dPoint,function(points){if(points){var p0=points[0];var p1=points[1];var min=function min(idx){return Math.min(p0[idx],p1[idx]);};var max=function max(idx){return Math.max(p0[idx],p1[idx]);};var xmin=min(0);var ymin=min(1);var zmin=min(2);var xmax=max(0);max(1);var zmax=max(2);basePolygon.updateBase([[xmin,ymin,zmax],[xmax,ymin,zmax],[xmax,ymin,zmin],[xmin,ymin,zmin]]);}else{basePolygon.updateBase(null);}},function(points){basePolygon.destroy();var zone=createAAZoneFromPoints(points[0],points[1],zoneAltitude,zoneHeight,zoneColor,zoneAlpha,zonesPlugin);var reactivate=true;self._deactivate=function(){reactivate=false;};self.fire("zoneEnd",zone);if(reactivate){rec();}}).deactivate;self._deactivate=function(){deactivate();basePolygon.destroy();};})();}},{key:"deactivate",value:function deactivate(){if(this._deactivate){this._deactivate();this._deactivate=null;}}/**
|
|
30538
30536
|
* Destroys this ZonesMouseControl.
|
|
30539
30537
|
*
|
|
30540
30538
|
* Destroys any {@link Zone} under construction by this ZonesMouseControl.
|
|
30541
|
-
*/},{key:"destroy",value:function destroy(){this.deactivate();_get(_getPrototypeOf(ZonesAAZoneControl.prototype),"destroy",this).call(this);}}]);return ZonesAAZoneControl;}(Component);var ZonesMouseControl=/*#__PURE__*/function(_ZonesAAZoneControl){_inherits(ZonesMouseControl,_ZonesAAZoneControl);var _super176=_createSuper(ZonesMouseControl);function ZonesMouseControl(zonesPlugin){var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,ZonesMouseControl);return _super176.call(this,zonesPlugin,cfg,function(viewer,ray2WorldPos){return mousePointSelector(viewer,ray2WorldPos);});}return _createClass(ZonesMouseControl);}(ZonesAAZoneControl);var ZonesTouchControl=/*#__PURE__*/function(_ZonesAAZoneControl2){_inherits(ZonesTouchControl,_ZonesAAZoneControl2);var _super177=_createSuper(ZonesTouchControl);function ZonesTouchControl(zonesPlugin){var
|
|
30539
|
+
*/},{key:"destroy",value:function destroy(){this.deactivate();_get(_getPrototypeOf(ZonesAAZoneControl.prototype),"destroy",this).call(this);}}]);return ZonesAAZoneControl;}(Component);var ZonesMouseControl=/*#__PURE__*/function(_ZonesAAZoneControl){_inherits(ZonesMouseControl,_ZonesAAZoneControl);var _super176=_createSuper(ZonesMouseControl);function ZonesMouseControl(zonesPlugin){var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,ZonesMouseControl);return _super176.call(this,zonesPlugin,cfg,function(viewer,ray2WorldPos){return mousePointSelector(viewer,ray2WorldPos);});}return _createClass(ZonesMouseControl);}(ZonesAAZoneControl);var ZonesTouchControl=/*#__PURE__*/function(_ZonesAAZoneControl2){_inherits(ZonesTouchControl,_ZonesAAZoneControl2);var _super177=_createSuper(ZonesTouchControl);function ZonesTouchControl(zonesPlugin){var _this182;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,ZonesTouchControl);var pointerCircle=new PointerCircle(zonesPlugin.viewer);_this182=_super177.call(this,zonesPlugin,cfg,function(viewer,ray2WorldPos){return touchPointSelector(viewer,pointerCircle,ray2WorldPos);});_this182.pointerCircle=pointerCircle;return _this182;}_createClass(ZonesTouchControl,[{key:"destroy",value:function destroy(){this.pointerCircle.destroy();_get(_getPrototypeOf(ZonesTouchControl.prototype),"destroy",this).call(this);}}]);return ZonesTouchControl;}(ZonesAAZoneControl);/**
|
|
30542
30540
|
* ZonesPlugin documentation to be added, mostly compatible with DistanceMeasurementsPlugin.
|
|
30543
30541
|
*/var ZonesPlugin=/*#__PURE__*/function(_Plugin23){_inherits(ZonesPlugin,_Plugin23);var _super178=_createSuper(ZonesPlugin);/**
|
|
30544
30542
|
* @constructor
|
|
@@ -30549,7 +30547,7 @@ switch(polygonType){case COPLANAR:newFaces.push(face);break;case FRONT:newFaces.
|
|
|
30549
30547
|
* @param {string} [cfg.defaultColor=#00BBFF] The default color of the length dots, wire and label.
|
|
30550
30548
|
* @param {number} [cfg.zIndex] If set, the wires, dots and labels will have this zIndex (+1 for dots and +2 for labels).
|
|
30551
30549
|
* @param {PointerCircle} [cfg.pointerLens] A PointerLens to help the user position the pointer. This can be shared with other plugins.
|
|
30552
|
-
*/function ZonesPlugin(viewer){var
|
|
30550
|
+
*/function ZonesPlugin(viewer){var _this183;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,ZonesPlugin);_this183=_super178.call(this,"Zones",viewer);_this183._pointerLens=cfg.pointerLens;_this183._container=cfg.container||document.body;_this183._zones=[];_this183.defaultColor=cfg.defaultColor!==undefined?cfg.defaultColor:"#00BBFF";_this183.zIndex=cfg.zIndex||10000;_this183._onMouseOver=function(event,zone){_this183.fire("mouseOver",{plugin:_assertThisInitialized(_this183),zone:zone,event:event});};_this183._onMouseLeave=function(event,zone){_this183.fire("mouseLeave",{plugin:_assertThisInitialized(_this183),zone:zone,event:event});};_this183._onContextMenu=function(event,zone){_this183.fire("contextMenu",{plugin:_assertThisInitialized(_this183),zone:zone,event:event});};return _this183;}/**
|
|
30553
30551
|
* Creates a {@link Zone}.
|
|
30554
30552
|
*
|
|
30555
30553
|
* The Zone is then registered by {@link Zone#id} in {@link ZonesPlugin#zones}.
|
|
@@ -30562,7 +30560,7 @@ switch(polygonType){case COPLANAR:newFaces.push(face);break;case FRONT:newFaces.
|
|
|
30562
30560
|
* @param {Entity} params.target.entity Target Entity.
|
|
30563
30561
|
* @param {string} [params.color] The color of the length dot, wire and label.
|
|
30564
30562
|
* @returns {Zone} The new {@link Zone}.
|
|
30565
|
-
*/_createClass(ZonesPlugin,[{key:"createZone",value:function createZone(){var
|
|
30563
|
+
*/_createClass(ZonesPlugin,[{key:"createZone",value:function createZone(){var _this184=this;var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(this.viewer.scene.components[params.id]){this.error("Viewer scene component with this ID already exists: "+params.id);delete params.id;}var zone=new Zone(this,{id:params.id,plugin:this,container:this._container,geometry:params.geometry,alpha:params.alpha,color:params.color,onMouseOver:this._onMouseOver,onMouseLeave:this._onMouseLeave,onContextMenu:this._onContextMenu});this._zones.push(zone);zone.on("destroyed",function(){var idx=_this184._zones.indexOf(zone);if(idx>=0){_this184._zones.splice(idx,1);}});this.fire("zoneCreated",zone);return zone;}/**
|
|
30566
30564
|
* Gets the existing {@link Zone}s, each mapped to its {@link Zone#id}.
|
|
30567
30565
|
*
|
|
30568
30566
|
* @type {{String:Zone}}
|
|
@@ -30581,4 +30579,4 @@ o4===0&&onSegment(c,b,d))// c, d and b are collinear and b lies on segment cd
|
|
|
30581
30579
|
{return true;}}return false;};}();deactivatePointSelection=select3dPoint(function(){updatePointerLens(null);marker.update(null);wire&&wire.update(null);basePolygon.updateBase(markers.length>2?markers.map(function(m){return m.getWorldPos();}):null);},function(canvasPos,worldPos){var snappedFirst=markers.length>2&&getSnappedFirst(canvasPos);firstMarker&&firstMarker.setHighlighted(!!snappedFirst);updatePointerLens(snappedFirst?snappedFirst.canvasPos:canvasPos);marker.update(!snappedFirst&&worldPos);wire&&wire.update(snappedFirst?snappedFirst.worldPos:worldPos);if(markers.length>=2){var pos=markers.map(function(m){return m.getWorldPos();}).concat(snappedFirst?[]:[worldPos]);var inter=lastSegmentIntersects(pos.map(function(p){return[p[0],p[2]];}),snappedFirst);basePolygon.updateBase(inter?null:pos);}else basePolygon.updateBase(null);},function(canvasPos,worldPos){var snappedFirst=markers.length>2&&getSnappedFirst(canvasPos);var pos=markers.map(function(m){return m.getWorldPos();}).concat(snappedFirst?[]:[worldPos]);basePolygon.updateBase(pos);var pos2D=pos.map(function(p){return[p[0],p[2]];});if(markers.length>2&&lastSegmentIntersects(pos2D,snappedFirst)){cleanups.pop()();selectNextPoint(markers);}else if(snappedFirst){// `marker2.update' makes sure marker's position has been updated from its default [0,0,0]
|
|
30582
30580
|
// This works around an unidentified bug somewhere around OcclusionLayer, that causes error
|
|
30583
30581
|
// [.WebGL-0x13400c47e00] GL_INVALID_OPERATION: Vertex buffer is not big enough for the draw call
|
|
30584
|
-
marker.update(worldPos);cleanups.forEach(function(c){return c();});onZoneCreated(zonesPlugin.createZone({id:math.createUUID(),geometry:{planeCoordinates:pos2D,altitude:zoneAltitude,height:zoneHeight},alpha:zoneAlpha,color:zoneColor}));}else{marker.update(worldPos);wire&&wire.update(worldPos);selectNextPoint(markers.concat(marker));}});})([]);return{closeSurface:function closeSurface(){throw"TODO";},deactivate:function deactivate(){deactivatePointSelection();cleanups.forEach(function(c){return c();});}};};var ZonesPolysurfaceMouseControl=/*#__PURE__*/function(_Component44){_inherits(ZonesPolysurfaceMouseControl,_Component44);var _super179=_createSuper(ZonesPolysurfaceMouseControl);function ZonesPolysurfaceMouseControl(zonesPlugin){var _this183;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,ZonesPolysurfaceMouseControl);_this183=_super179.call(this,zonesPlugin.viewer.scene);_this183.zonesPlugin=zonesPlugin;_this183.pointerLens=cfg.pointerLens;_this183._action=null;return _this183;}_createClass(ZonesPolysurfaceMouseControl,[{key:"active",get:function get(){return!!this._action;}},{key:"activate",value:function activate(zoneAltitude,zoneHeight,zoneColor,zoneAlpha){if(_typeof(zoneAltitude)==="object"&&zoneAltitude!==null){var params=zoneAltitude;var param=function param(name,defaultValue){if(name in params){return params[name];}else if(defaultValue!==undefined){return defaultValue;}else{throw"config missing: "+name;}};zoneAltitude=param("altitude");zoneHeight=param("height");zoneColor=param("color","#008000");zoneAlpha=param("alpha",0.5);}if(this._action){return;}var zonesPlugin=this.zonesPlugin;var viewer=zonesPlugin.viewer;var scene=viewer.scene;var self=this;var select3dPoint=mousePointSelector(viewer,function(origin,direction){return planeIntersect(zoneAltitude,math.vec3([0,1,0]),origin,direction);});(function rec(){self._action=startPolysurfaceZoneCreateUI(scene,zoneAltitude,zoneHeight,zoneColor,zoneAlpha,self.pointerLens,zonesPlugin,select3dPoint,function(zone){var reactivate=true;self._action={deactivate:function deactivate(){reactivate=false;}};self.fire("zoneEnd",zone);if(reactivate){rec();}});})();}},{key:"deactivate",value:function deactivate(){if(this._action){this._action.deactivate();this._action=null;}}},{key:"destroy",value:function destroy(){this.deactivate();_get(_getPrototypeOf(ZonesPolysurfaceMouseControl.prototype),"destroy",this).call(this);}}]);return ZonesPolysurfaceMouseControl;}(Component);var ZonesPolysurfaceTouchControl=/*#__PURE__*/function(_Component45){_inherits(ZonesPolysurfaceTouchControl,_Component45);var _super180=_createSuper(ZonesPolysurfaceTouchControl);function ZonesPolysurfaceTouchControl(zonesPlugin){var _this184;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,ZonesPolysurfaceTouchControl);_this184=_super180.call(this,zonesPlugin.viewer.scene);_this184.zonesPlugin=zonesPlugin;_this184.pointerLens=cfg.pointerLens;_this184.pointerCircle=new PointerCircle(zonesPlugin.viewer);_this184._action=null;return _this184;}_createClass(ZonesPolysurfaceTouchControl,[{key:"active",get:function get(){return!!this._action;}},{key:"activate",value:function activate(zoneAltitude,zoneHeight,zoneColor,zoneAlpha){if(_typeof(zoneAltitude)==="object"&&zoneAltitude!==null){var params=zoneAltitude;var param=function param(name,defaultValue){if(name in params){return params[name];}else if(defaultValue!==undefined){return defaultValue;}else{throw"config missing: "+name;}};zoneAltitude=param("altitude");zoneHeight=param("height");zoneColor=param("color","#008000");zoneAlpha=param("alpha",0.5);}if(this._action){return;}var zonesPlugin=this.zonesPlugin;var viewer=zonesPlugin.viewer;var scene=viewer.scene;var self=this;var select3dPoint=touchPointSelector(viewer,this.pointerCircle,function(origin,direction){return planeIntersect(zoneAltitude,math.vec3([0,1,0]),origin,direction);});(function rec(){self._action=startPolysurfaceZoneCreateUI(scene,zoneAltitude,zoneHeight,zoneColor,zoneAlpha,self.pointerLens,zonesPlugin,select3dPoint,function(zone){var reactivate=true;self._action={deactivate:function deactivate(){reactivate=false;}};self.fire("zoneEnd",zone);if(reactivate){rec();}});})();}},{key:"deactivate",value:function deactivate(){if(this._action){this._action.deactivate();this._action=null;}}},{key:"destroy",value:function destroy(){this.deactivate();_get(_getPrototypeOf(ZonesPolysurfaceTouchControl.prototype),"destroy",this).call(this);}}]);return ZonesPolysurfaceTouchControl;}(Component);var ZoneEditControl=/*#__PURE__*/function(_Component46){_inherits(ZoneEditControl,_Component46);var _super181=_createSuper(ZoneEditControl);function ZoneEditControl(zone,cfg,handleMouseEvents,handleTouchEvents){var _this185;_classCallCheck(this,ZoneEditControl);var viewer=zone.plugin.viewer;var scene=viewer.scene;_this185=_super181.call(this,scene);var altitude=zone._geometry.altitude;var dots=zone._geometry.planeCoordinates.map(function(planeCoord){var dotParent=scene.canvas.canvas.ownerDocument.body;var dot=new Dot3D(scene,{},dotParent,{fillColor:zone._color});dot.worldPos=math.vec3([planeCoord[0],altitude,planeCoord[1]]);dot.on("worldPos",function(){planeCoord[0]=dot.worldPos[0];planeCoord[1]=dot.worldPos[2];try{zone._rebuildMesh();}catch(e){if(zone._zoneMesh){zone._zoneMesh.destroy();zone._zoneMesh=null;}}});return dot;});var cleanupDrag=activateDraggableDots({viewer:viewer,handleMouseEvents:handleMouseEvents,handleTouchEvents:handleTouchEvents,pointerLens:cfg&&cfg.pointerLens,dots:dots,ray2WorldPos:function ray2WorldPos(orig,dir){return planeIntersect(altitude,math.vec3([0,1,0]),orig,dir);},onEnd:function onEnd(initPos,dot){if(zone._zoneMesh){_this185.fire("edited");}return!!zone._zoneMesh;}});var cleanup=function cleanup(){cleanupDrag();dots.forEach(function(d){return d.destroy();});};var destroyCb=zone.on("destroyed",cleanup);_this185._deactivate=function(){zone.off("destroyed",destroyCb);cleanup();};return _this185;}_createClass(ZoneEditControl,[{key:"deactivate",value:function deactivate(){this._deactivate();_get(_getPrototypeOf(ZoneEditControl.prototype),"destroy",this).call(this);}}]);return ZoneEditControl;}(Component);var ZoneEditMouseControl=/*#__PURE__*/function(_ZoneEditControl){_inherits(ZoneEditMouseControl,_ZoneEditControl);var _super182=_createSuper(ZoneEditMouseControl);function ZoneEditMouseControl(zone,cfg){_classCallCheck(this,ZoneEditMouseControl);return _super182.call(this,zone,cfg,true,false);}return _createClass(ZoneEditMouseControl);}(ZoneEditControl);var ZoneEditTouchControl=/*#__PURE__*/function(_ZoneEditControl2){_inherits(ZoneEditTouchControl,_ZoneEditControl2);var _super183=_createSuper(ZoneEditTouchControl);function ZoneEditTouchControl(zone,cfg){_classCallCheck(this,ZoneEditTouchControl);return _super183.call(this,zone,cfg,false,true);}return _createClass(ZoneEditTouchControl);}(ZoneEditControl);var ZoneTranslateControl=/*#__PURE__*/function(_Component47){_inherits(ZoneTranslateControl,_Component47);var _super184=_createSuper(ZoneTranslateControl);function ZoneTranslateControl(zone,cfg,handleMouseEvents,handleTouchEvents){var _this186;_classCallCheck(this,ZoneTranslateControl);var viewer=zone.plugin.viewer;var scene=viewer.scene;var canvas=scene.canvas.canvas;_this186=_super184.call(this,scene);var self=_assertThisInitialized(_this186);var altitude=zone._geometry.altitude;var pointerLens=cfg&&cfg.pointerLens;var updatePointerLens=pointerLens?function(canvasPos){pointerLens.visible=!!canvasPos;if(canvasPos){pointerLens.canvasPos=canvasPos;}}:function(){};var ray2WorldPos=function ray2WorldPos(orig,dir){return planeIntersect(altitude,math.vec3([0,1,0]),orig,dir);};var pickWorldPos=function pickWorldPos(canvasPos){var origin=math.vec3();var direction=math.vec3();math.canvasPosToWorldRay(canvas,scene.camera.viewMatrix,scene.camera.projMatrix,scene.camera.projection,canvasPos,origin,direction);return ray2WorldPos(origin,direction);};var copyCanvasPos=function copyCanvasPos(event,vec2){vec2[0]=event.clientX;vec2[1]=event.clientY;transformToNode(canvas.ownerDocument.documentElement,canvas,vec2);return vec2;};var canvasHandle=function canvasHandle(type,cb){var callback=function callback(event){event.preventDefault();cb(event);};canvas.addEventListener(type,callback);return function(){return canvas.removeEventListener(type,callback);};};var _cleanupCurrentDrag=function cleanupCurrentDrag(){};var startDrag=function startDrag(event,onMoveType,onEndType,matchesEvent){var e=matchesEvent(event);var canvasPos=copyCanvasPos(e,math.vec2());var pickRecord=viewer.scene.pick({canvasPos:canvasPos,includeEntities:[zone._zoneMesh.id]});var pickZone=pickRecord&&pickRecord.entity&&pickRecord.entity.zone;if(pickZone===zone){_cleanupCurrentDrag();canvas.style.cursor="move";viewer.cameraControl.active=false;var onChange=function(){var initCoords=zone._geometry.planeCoordinates.map(function(c){return c.slice();});var initWorldPos=pickWorldPos(canvasPos);var initDragCoord=math.vec2([initWorldPos[0],initWorldPos[2]]);var dPos=math.vec2();return function(canvasPos){var worldPos=pickWorldPos(canvasPos);dPos[0]=worldPos[0];dPos[1]=worldPos[2];math.subVec2(initDragCoord,dPos,dPos);zone._geometry.planeCoordinates.forEach(function(planeCoord,idx){math.subVec2(initCoords[idx],dPos,planeCoord);});try{zone._rebuildMesh();}catch(e){if(zone._zoneMesh){zone._zoneMesh.destroy();zone._zoneMesh=null;}}};}();var cleanupMove=canvasHandle(onMoveType,function(event){var e=matchesEvent(event);if(e){var _canvasPos4=copyCanvasPos(e,math.vec2());onChange(_canvasPos4);updatePointerLens(_canvasPos4);}});var cleanupEnd=canvasHandle(onEndType,function(event){var e=matchesEvent(event);if(e){var _canvasPos5=copyCanvasPos(e,math.vec2());onChange(_canvasPos5);updatePointerLens(null);_cleanupCurrentDrag();self.fire("translated");}});_cleanupCurrentDrag=function cleanupCurrentDrag(){_cleanupCurrentDrag=function cleanupCurrentDrag(){};canvas.style.cursor="default";viewer.cameraControl.active=true;cleanupMove();cleanupEnd();};}};var startDragCbs=[];if(handleMouseEvents){startDragCbs.push(canvasHandle("mousedown",function(event){if(event.which===1){startDrag(event,"mousemove","mouseup",function(event){return event.which===1&&event;});}}));}if(handleTouchEvents){startDragCbs.push(canvasHandle("touchstart",function(event){if(event.touches.length===1){var touchStartId=event.touches[0].identifier;startDrag(event,"touchmove","touchend",function(event){return _toConsumableArray(event.changedTouches).find(function(e){return e.identifier===touchStartId;});});}}));}var cleanup=function cleanup(){_cleanupCurrentDrag();startDragCbs.forEach(function(cb){return cb();});updatePointerLens(null);};var destroyCb=zone.on("destroyed",cleanup);_this186._deactivate=function(){zone.off("destroyed",destroyCb);cleanup();};return _this186;}_createClass(ZoneTranslateControl,[{key:"deactivate",value:function deactivate(){this._deactivate();_get(_getPrototypeOf(ZoneTranslateControl.prototype),"destroy",this).call(this);}}]);return ZoneTranslateControl;}(Component);var ZoneTranslateMouseControl=/*#__PURE__*/function(_ZoneTranslateControl){_inherits(ZoneTranslateMouseControl,_ZoneTranslateControl);var _super185=_createSuper(ZoneTranslateMouseControl);function ZoneTranslateMouseControl(zone,cfg){_classCallCheck(this,ZoneTranslateMouseControl);return _super185.call(this,zone,cfg,true,false);}return _createClass(ZoneTranslateMouseControl);}(ZoneTranslateControl);var ZoneTranslateTouchControl=/*#__PURE__*/function(_ZoneTranslateControl2){_inherits(ZoneTranslateTouchControl,_ZoneTranslateControl2);var _super186=_createSuper(ZoneTranslateTouchControl);function ZoneTranslateTouchControl(zone,cfg){_classCallCheck(this,ZoneTranslateTouchControl);return _super186.call(this,zone,cfg,false,true);}return _createClass(ZoneTranslateTouchControl);}(ZoneTranslateControl);export{AlphaFormat,AmbientLight,AngleMeasurementEditMouseControl,AngleMeasurementEditTouchControl,AngleMeasurementsControl,AngleMeasurementsMouseControl,AngleMeasurementsPlugin,AngleMeasurementsTouchControl,AnnotationsPlugin,AxisGizmoPlugin,BCFViewpointsPlugin,Bitmap,ByteType,CameraMemento,CameraPath,CameraPathAnimation,CityJSONLoaderPlugin,ClampToEdgeWrapping,Component,CompressedMediaType,Configs,ContextMenu,CubicBezierCurve,Curve,DefaultLoadingManager,DepthFormat,DepthStencilFormat,DirLight,DistanceMeasurementEditControl,DistanceMeasurementEditMouseControl,DistanceMeasurementEditTouchControl,DistanceMeasurementsControl,DistanceMeasurementsMouseControl,DistanceMeasurementsPlugin,DistanceMeasurementsTouchControl,Dot3D,DotBIMDefaultDataSource,DotBIMLoaderPlugin,EdgeMaterial,EmphasisMaterial,FaceAlignedSectionPlanesPlugin,FastNavPlugin,FloatType,Fresnel,Frustum$1 as Frustum,FrustumPlane,GIFMediaType,GLTFDefaultDataSource,GLTFLoaderPlugin,HalfFloatType,ImagePlane,IntType,JPEGMediaType,KTX2TextureTranscoder,LASLoaderPlugin,LambertMaterial,LightMap,LineSet,LinearEncoding,LinearFilter,LinearMipMapLinearFilter,LinearMipMapNearestFilter,LinearMipmapLinearFilter,LinearMipmapNearestFilter,Loader,LoadingManager,LocaleService,LuminanceAlphaFormat,LuminanceFormat,Map$1 as Map,Marker,MarqueePicker,MarqueePickerMouseControl,Mesh,MeshSurfaceArea,MeshVolume,MetallicMaterial,MirroredRepeatWrapping,ModelMemento,NavCubePlugin,NearestFilter,NearestMipMapLinearFilter,NearestMipMapNearestFilter,NearestMipmapLinearFilter,NearestMipmapNearestFilter,Node$2 as Node,OBJLoaderPlugin,ObjectsKdTree3,ObjectsMemento,PNGMediaType,Path,PerformanceModel,PhongMaterial,PickResult,Plugin,PointLight,PointerCircle,PointerLens,QuadraticBezierCurve,Queue,RGBAFormat,RGBAIntegerFormat,RGBA_ASTC_10x10_Format,RGBA_ASTC_10x5_Format,RGBA_ASTC_10x6_Format,RGBA_ASTC_10x8_Format,RGBA_ASTC_12x10_Format,RGBA_ASTC_12x12_Format,RGBA_ASTC_4x4_Format,RGBA_ASTC_5x4_Format,RGBA_ASTC_5x5_Format,RGBA_ASTC_6x5_Format,RGBA_ASTC_6x6_Format,RGBA_ASTC_8x5_Format,RGBA_ASTC_8x6_Format,RGBA_ASTC_8x8_Format,RGBA_BPTC_Format,RGBA_ETC2_EAC_Format,RGBA_PVRTC_2BPPV1_Format,RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format,RGBA_S3TC_DXT3_Format,RGBA_S3TC_DXT5_Format,RGBFormat,RGB_ETC1_Format,RGB_ETC2_Format,RGB_PVRTC_2BPPV1_Format,RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format,RGFormat,RGIntegerFormat,ReadableGeometry,RedFormat,RedIntegerFormat,ReflectionMap,RepeatWrapping,STLDefaultDataSource,STLLoaderPlugin,SceneModel,SceneModelMesh,SceneModelTransform,SectionPlane,SectionPlanesPlugin,ShortType,Skybox,SkyboxesPlugin,SpecularMaterial,SplineCurve,SpriteMarker,StoreyViewsPlugin,Texture,TextureTranscoder,TreeViewPlugin,UnsignedByteType,UnsignedInt248Type,UnsignedIntType,UnsignedShort4444Type,UnsignedShort5551Type,UnsignedShortType,VBOGeometry,ViewCullPlugin,Viewer,WebIFCLoaderPlugin,WorkerPool$1 as WorkerPool,XKTDefaultDataSource,XKTLoaderPlugin,XML3DLoaderPlugin,ZoneEditControl,ZoneEditMouseControl,ZoneEditTouchControl,ZoneTranslateControl,ZoneTranslateMouseControl,ZoneTranslateTouchControl,ZonesMouseControl,ZonesPlugin,ZonesPolysurfaceMouseControl,ZonesPolysurfaceTouchControl,ZonesTouchControl,activateDraggableDot,activateDraggableDots,buildBoxGeometry,buildBoxLinesGeometry,buildBoxLinesGeometryFromAABB,buildCylinderGeometry,buildGridGeometry,buildLineGeometry,buildPlaneGeometry,buildPolylineGeometry,buildPolylineGeometryFromCurve,buildSphereGeometry,buildTorusGeometry,buildVectorTextGeometry,createRTCViewMat,frustumIntersectsAABB3,getKTX2TextureTranscoder,getPlaneRTCPos,isTriangleMeshSolid,load3DSGeometry,loadOBJGeometry,math,meshSurfaceArea,meshVolume,rtcToWorldPos,sRGBEncoding,setFrustum,stats,touchPointSelector,transformToNode,utils,worldToRTCPos,worldToRTCPositions};
|
|
30582
|
+
marker.update(worldPos);cleanups.forEach(function(c){return c();});onZoneCreated(zonesPlugin.createZone({id:math.createUUID(),geometry:{planeCoordinates:pos2D,altitude:zoneAltitude,height:zoneHeight},alpha:zoneAlpha,color:zoneColor}));}else{marker.update(worldPos);wire&&wire.update(worldPos);selectNextPoint(markers.concat(marker));}});})([]);return{closeSurface:function closeSurface(){throw"TODO";},deactivate:function deactivate(){deactivatePointSelection();cleanups.forEach(function(c){return c();});}};};var ZonesPolysurfaceMouseControl=/*#__PURE__*/function(_Component44){_inherits(ZonesPolysurfaceMouseControl,_Component44);var _super179=_createSuper(ZonesPolysurfaceMouseControl);function ZonesPolysurfaceMouseControl(zonesPlugin){var _this185;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,ZonesPolysurfaceMouseControl);_this185=_super179.call(this,zonesPlugin.viewer.scene);_this185.zonesPlugin=zonesPlugin;_this185.pointerLens=cfg.pointerLens;_this185._action=null;return _this185;}_createClass(ZonesPolysurfaceMouseControl,[{key:"active",get:function get(){return!!this._action;}},{key:"activate",value:function activate(zoneAltitude,zoneHeight,zoneColor,zoneAlpha){if(_typeof(zoneAltitude)==="object"&&zoneAltitude!==null){var params=zoneAltitude;var param=function param(name,defaultValue){if(name in params){return params[name];}else if(defaultValue!==undefined){return defaultValue;}else{throw"config missing: "+name;}};zoneAltitude=param("altitude");zoneHeight=param("height");zoneColor=param("color","#008000");zoneAlpha=param("alpha",0.5);}if(this._action){return;}var zonesPlugin=this.zonesPlugin;var viewer=zonesPlugin.viewer;var scene=viewer.scene;var self=this;var select3dPoint=mousePointSelector(viewer,function(origin,direction){return planeIntersect(zoneAltitude,math.vec3([0,1,0]),origin,direction);});(function rec(){self._action=startPolysurfaceZoneCreateUI(scene,zoneAltitude,zoneHeight,zoneColor,zoneAlpha,self.pointerLens,zonesPlugin,select3dPoint,function(zone){var reactivate=true;self._action={deactivate:function deactivate(){reactivate=false;}};self.fire("zoneEnd",zone);if(reactivate){rec();}});})();}},{key:"deactivate",value:function deactivate(){if(this._action){this._action.deactivate();this._action=null;}}},{key:"destroy",value:function destroy(){this.deactivate();_get(_getPrototypeOf(ZonesPolysurfaceMouseControl.prototype),"destroy",this).call(this);}}]);return ZonesPolysurfaceMouseControl;}(Component);var ZonesPolysurfaceTouchControl=/*#__PURE__*/function(_Component45){_inherits(ZonesPolysurfaceTouchControl,_Component45);var _super180=_createSuper(ZonesPolysurfaceTouchControl);function ZonesPolysurfaceTouchControl(zonesPlugin){var _this186;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,ZonesPolysurfaceTouchControl);_this186=_super180.call(this,zonesPlugin.viewer.scene);_this186.zonesPlugin=zonesPlugin;_this186.pointerLens=cfg.pointerLens;_this186.pointerCircle=new PointerCircle(zonesPlugin.viewer);_this186._action=null;return _this186;}_createClass(ZonesPolysurfaceTouchControl,[{key:"active",get:function get(){return!!this._action;}},{key:"activate",value:function activate(zoneAltitude,zoneHeight,zoneColor,zoneAlpha){if(_typeof(zoneAltitude)==="object"&&zoneAltitude!==null){var params=zoneAltitude;var param=function param(name,defaultValue){if(name in params){return params[name];}else if(defaultValue!==undefined){return defaultValue;}else{throw"config missing: "+name;}};zoneAltitude=param("altitude");zoneHeight=param("height");zoneColor=param("color","#008000");zoneAlpha=param("alpha",0.5);}if(this._action){return;}var zonesPlugin=this.zonesPlugin;var viewer=zonesPlugin.viewer;var scene=viewer.scene;var self=this;var select3dPoint=touchPointSelector(viewer,this.pointerCircle,function(origin,direction){return planeIntersect(zoneAltitude,math.vec3([0,1,0]),origin,direction);});(function rec(){self._action=startPolysurfaceZoneCreateUI(scene,zoneAltitude,zoneHeight,zoneColor,zoneAlpha,self.pointerLens,zonesPlugin,select3dPoint,function(zone){var reactivate=true;self._action={deactivate:function deactivate(){reactivate=false;}};self.fire("zoneEnd",zone);if(reactivate){rec();}});})();}},{key:"deactivate",value:function deactivate(){if(this._action){this._action.deactivate();this._action=null;}}},{key:"destroy",value:function destroy(){this.deactivate();_get(_getPrototypeOf(ZonesPolysurfaceTouchControl.prototype),"destroy",this).call(this);}}]);return ZonesPolysurfaceTouchControl;}(Component);var ZoneEditControl=/*#__PURE__*/function(_Component46){_inherits(ZoneEditControl,_Component46);var _super181=_createSuper(ZoneEditControl);function ZoneEditControl(zone,cfg,handleMouseEvents,handleTouchEvents){var _this187;_classCallCheck(this,ZoneEditControl);var viewer=zone.plugin.viewer;var scene=viewer.scene;_this187=_super181.call(this,scene);var altitude=zone._geometry.altitude;var dots=zone._geometry.planeCoordinates.map(function(planeCoord){var dotParent=scene.canvas.canvas.ownerDocument.body;var dot=new Dot3D(scene,{},dotParent,{fillColor:zone._color});dot.worldPos=math.vec3([planeCoord[0],altitude,planeCoord[1]]);dot.on("worldPos",function(){planeCoord[0]=dot.worldPos[0];planeCoord[1]=dot.worldPos[2];try{zone._rebuildMesh();}catch(e){if(zone._zoneMesh){zone._zoneMesh.destroy();zone._zoneMesh=null;}}});return dot;});var cleanupDrag=activateDraggableDots({viewer:viewer,handleMouseEvents:handleMouseEvents,handleTouchEvents:handleTouchEvents,pointerLens:cfg&&cfg.pointerLens,dots:dots,ray2WorldPos:function ray2WorldPos(orig,dir){return planeIntersect(altitude,math.vec3([0,1,0]),orig,dir);},onEnd:function onEnd(initPos,dot){if(zone._zoneMesh){_this187.fire("edited");}return!!zone._zoneMesh;}});var cleanup=function cleanup(){cleanupDrag();dots.forEach(function(d){return d.destroy();});};var destroyCb=zone.on("destroyed",cleanup);_this187._deactivate=function(){zone.off("destroyed",destroyCb);cleanup();};return _this187;}_createClass(ZoneEditControl,[{key:"deactivate",value:function deactivate(){this._deactivate();_get(_getPrototypeOf(ZoneEditControl.prototype),"destroy",this).call(this);}}]);return ZoneEditControl;}(Component);var ZoneEditMouseControl=/*#__PURE__*/function(_ZoneEditControl){_inherits(ZoneEditMouseControl,_ZoneEditControl);var _super182=_createSuper(ZoneEditMouseControl);function ZoneEditMouseControl(zone,cfg){_classCallCheck(this,ZoneEditMouseControl);return _super182.call(this,zone,cfg,true,false);}return _createClass(ZoneEditMouseControl);}(ZoneEditControl);var ZoneEditTouchControl=/*#__PURE__*/function(_ZoneEditControl2){_inherits(ZoneEditTouchControl,_ZoneEditControl2);var _super183=_createSuper(ZoneEditTouchControl);function ZoneEditTouchControl(zone,cfg){_classCallCheck(this,ZoneEditTouchControl);return _super183.call(this,zone,cfg,false,true);}return _createClass(ZoneEditTouchControl);}(ZoneEditControl);var ZoneTranslateControl=/*#__PURE__*/function(_Component47){_inherits(ZoneTranslateControl,_Component47);var _super184=_createSuper(ZoneTranslateControl);function ZoneTranslateControl(zone,cfg,handleMouseEvents,handleTouchEvents){var _this188;_classCallCheck(this,ZoneTranslateControl);var viewer=zone.plugin.viewer;var scene=viewer.scene;var canvas=scene.canvas.canvas;_this188=_super184.call(this,scene);var self=_assertThisInitialized(_this188);var altitude=zone._geometry.altitude;var pointerLens=cfg&&cfg.pointerLens;var updatePointerLens=pointerLens?function(canvasPos){pointerLens.visible=!!canvasPos;if(canvasPos){pointerLens.canvasPos=canvasPos;}}:function(){};var ray2WorldPos=function ray2WorldPos(orig,dir){return planeIntersect(altitude,math.vec3([0,1,0]),orig,dir);};var pickWorldPos=function pickWorldPos(canvasPos){var origin=math.vec3();var direction=math.vec3();math.canvasPosToWorldRay(canvas,scene.camera.viewMatrix,scene.camera.projMatrix,scene.camera.projection,canvasPos,origin,direction);return ray2WorldPos(origin,direction);};var copyCanvasPos=function copyCanvasPos(event,vec2){vec2[0]=event.clientX;vec2[1]=event.clientY;transformToNode(canvas.ownerDocument.documentElement,canvas,vec2);return vec2;};var canvasHandle=function canvasHandle(type,cb){var callback=function callback(event){event.preventDefault();cb(event);};canvas.addEventListener(type,callback);return function(){return canvas.removeEventListener(type,callback);};};var _cleanupCurrentDrag=function cleanupCurrentDrag(){};var startDrag=function startDrag(event,onMoveType,onEndType,matchesEvent){var e=matchesEvent(event);var canvasPos=copyCanvasPos(e,math.vec2());var pickRecord=viewer.scene.pick({canvasPos:canvasPos,includeEntities:[zone._zoneMesh.id]});var pickZone=pickRecord&&pickRecord.entity&&pickRecord.entity.zone;if(pickZone===zone){_cleanupCurrentDrag();canvas.style.cursor="move";viewer.cameraControl.active=false;var onChange=function(){var initCoords=zone._geometry.planeCoordinates.map(function(c){return c.slice();});var initWorldPos=pickWorldPos(canvasPos);var initDragCoord=math.vec2([initWorldPos[0],initWorldPos[2]]);var dPos=math.vec2();return function(canvasPos){var worldPos=pickWorldPos(canvasPos);dPos[0]=worldPos[0];dPos[1]=worldPos[2];math.subVec2(initDragCoord,dPos,dPos);zone._geometry.planeCoordinates.forEach(function(planeCoord,idx){math.subVec2(initCoords[idx],dPos,planeCoord);});try{zone._rebuildMesh();}catch(e){if(zone._zoneMesh){zone._zoneMesh.destroy();zone._zoneMesh=null;}}};}();var cleanupMove=canvasHandle(onMoveType,function(event){var e=matchesEvent(event);if(e){var _canvasPos4=copyCanvasPos(e,math.vec2());onChange(_canvasPos4);updatePointerLens(_canvasPos4);}});var cleanupEnd=canvasHandle(onEndType,function(event){var e=matchesEvent(event);if(e){var _canvasPos5=copyCanvasPos(e,math.vec2());onChange(_canvasPos5);updatePointerLens(null);_cleanupCurrentDrag();self.fire("translated");}});_cleanupCurrentDrag=function cleanupCurrentDrag(){_cleanupCurrentDrag=function cleanupCurrentDrag(){};canvas.style.cursor="default";viewer.cameraControl.active=true;cleanupMove();cleanupEnd();};}};var startDragCbs=[];if(handleMouseEvents){startDragCbs.push(canvasHandle("mousedown",function(event){if(event.which===1){startDrag(event,"mousemove","mouseup",function(event){return event.which===1&&event;});}}));}if(handleTouchEvents){startDragCbs.push(canvasHandle("touchstart",function(event){if(event.touches.length===1){var touchStartId=event.touches[0].identifier;startDrag(event,"touchmove","touchend",function(event){return _toConsumableArray(event.changedTouches).find(function(e){return e.identifier===touchStartId;});});}}));}var cleanup=function cleanup(){_cleanupCurrentDrag();startDragCbs.forEach(function(cb){return cb();});updatePointerLens(null);};var destroyCb=zone.on("destroyed",cleanup);_this188._deactivate=function(){zone.off("destroyed",destroyCb);cleanup();};return _this188;}_createClass(ZoneTranslateControl,[{key:"deactivate",value:function deactivate(){this._deactivate();_get(_getPrototypeOf(ZoneTranslateControl.prototype),"destroy",this).call(this);}}]);return ZoneTranslateControl;}(Component);var ZoneTranslateMouseControl=/*#__PURE__*/function(_ZoneTranslateControl){_inherits(ZoneTranslateMouseControl,_ZoneTranslateControl);var _super185=_createSuper(ZoneTranslateMouseControl);function ZoneTranslateMouseControl(zone,cfg){_classCallCheck(this,ZoneTranslateMouseControl);return _super185.call(this,zone,cfg,true,false);}return _createClass(ZoneTranslateMouseControl);}(ZoneTranslateControl);var ZoneTranslateTouchControl=/*#__PURE__*/function(_ZoneTranslateControl2){_inherits(ZoneTranslateTouchControl,_ZoneTranslateControl2);var _super186=_createSuper(ZoneTranslateTouchControl);function ZoneTranslateTouchControl(zone,cfg){_classCallCheck(this,ZoneTranslateTouchControl);return _super186.call(this,zone,cfg,false,true);}return _createClass(ZoneTranslateTouchControl);}(ZoneTranslateControl);export{AlphaFormat,AmbientLight,AngleMeasurementEditMouseControl,AngleMeasurementEditTouchControl,AngleMeasurementsControl,AngleMeasurementsMouseControl,AngleMeasurementsPlugin,AngleMeasurementsTouchControl,AnnotationsPlugin,AxisGizmoPlugin,BCFViewpointsPlugin,Bitmap,ByteType,CameraMemento,CameraPath,CameraPathAnimation,CityJSONLoaderPlugin,ClampToEdgeWrapping,Component,CompressedMediaType,Configs,ContextMenu,CubicBezierCurve,Curve,DefaultLoadingManager,DepthFormat,DepthStencilFormat,DirLight,DistanceMeasurementEditControl,DistanceMeasurementEditMouseControl,DistanceMeasurementEditTouchControl,DistanceMeasurementsControl,DistanceMeasurementsMouseControl,DistanceMeasurementsPlugin,DistanceMeasurementsTouchControl,Dot3D,DotBIMDefaultDataSource,DotBIMLoaderPlugin,EdgeMaterial,EmphasisMaterial,FaceAlignedSectionPlanesPlugin,FastNavPlugin,FloatType,Fresnel,Frustum$1 as Frustum,FrustumPlane,GIFMediaType,GLTFDefaultDataSource,GLTFLoaderPlugin,HalfFloatType,ImagePlane,IntType,JPEGMediaType,KTX2TextureTranscoder,LASLoaderPlugin,LambertMaterial,LightMap,LineSet,LinearEncoding,LinearFilter,LinearMipMapLinearFilter,LinearMipMapNearestFilter,LinearMipmapLinearFilter,LinearMipmapNearestFilter,Loader,LoadingManager,LocaleService,LuminanceAlphaFormat,LuminanceFormat,Map$1 as Map,Marker,MarqueePicker,MarqueePickerMouseControl,Mesh,MeshSurfaceArea,MeshVolume,MetallicMaterial,MirroredRepeatWrapping,ModelMemento,NavCubePlugin,NearestFilter,NearestMipMapLinearFilter,NearestMipMapNearestFilter,NearestMipmapLinearFilter,NearestMipmapNearestFilter,Node$2 as Node,OBJLoaderPlugin,ObjectsKdTree3,ObjectsMemento,PNGMediaType,Path,PerformanceModel,PhongMaterial,PickResult,Plugin,PointLight,PointerCircle,PointerLens,QuadraticBezierCurve,Queue,RGBAFormat,RGBAIntegerFormat,RGBA_ASTC_10x10_Format,RGBA_ASTC_10x5_Format,RGBA_ASTC_10x6_Format,RGBA_ASTC_10x8_Format,RGBA_ASTC_12x10_Format,RGBA_ASTC_12x12_Format,RGBA_ASTC_4x4_Format,RGBA_ASTC_5x4_Format,RGBA_ASTC_5x5_Format,RGBA_ASTC_6x5_Format,RGBA_ASTC_6x6_Format,RGBA_ASTC_8x5_Format,RGBA_ASTC_8x6_Format,RGBA_ASTC_8x8_Format,RGBA_BPTC_Format,RGBA_ETC2_EAC_Format,RGBA_PVRTC_2BPPV1_Format,RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format,RGBA_S3TC_DXT3_Format,RGBA_S3TC_DXT5_Format,RGBFormat,RGB_ETC1_Format,RGB_ETC2_Format,RGB_PVRTC_2BPPV1_Format,RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format,RGFormat,RGIntegerFormat,ReadableGeometry,RedFormat,RedIntegerFormat,ReflectionMap,RepeatWrapping,STLDefaultDataSource,STLLoaderPlugin,SceneModel,SceneModelMesh,SceneModelTransform,SectionPlane,SectionPlanesPlugin,ShortType,Skybox,SkyboxesPlugin,SpecularMaterial,SplineCurve,SpriteMarker,StoreyViewsPlugin,Texture,TextureTranscoder,TreeViewPlugin,UnsignedByteType,UnsignedInt248Type,UnsignedIntType,UnsignedShort4444Type,UnsignedShort5551Type,UnsignedShortType,VBOGeometry,ViewCullPlugin,Viewer,WebIFCLoaderPlugin,WorkerPool$1 as WorkerPool,XKTDefaultDataSource,XKTLoaderPlugin,XML3DLoaderPlugin,ZoneEditControl,ZoneEditMouseControl,ZoneEditTouchControl,ZoneTranslateControl,ZoneTranslateMouseControl,ZoneTranslateTouchControl,ZonesMouseControl,ZonesPlugin,ZonesPolysurfaceMouseControl,ZonesPolysurfaceTouchControl,ZonesTouchControl,activateDraggableDot,activateDraggableDots,buildBoxGeometry,buildBoxLinesGeometry,buildBoxLinesGeometryFromAABB,buildCylinderGeometry,buildGridGeometry,buildLineGeometry,buildPlaneGeometry,buildPolylineGeometry,buildPolylineGeometryFromCurve,buildSphereGeometry,buildTorusGeometry,buildVectorTextGeometry,createRTCViewMat,frustumIntersectsAABB3,getKTX2TextureTranscoder,getPlaneRTCPos,isTriangleMeshSolid,load3DSGeometry,loadOBJGeometry,math,meshSurfaceArea,meshVolume,rtcToWorldPos,sRGBEncoding,setFrustum,stats,touchPointSelector,transformToNode,utils,worldToRTCPos,worldToRTCPositions};
|